COMPUTATIONAL SYMBOLIC GEOMETRY mourrain

6 downloads 0 Views 432KB Size Report
So we have a one-to-one correspondence between K-linear spaces of P and .... De nition 1.5 | A monomial m in xi;j is well-ordered if it is of the form m = x0;i0. 0 xk0;i0 ..... j k a b c f d e g h. Points : (a b c d e f g h i j k). Hypotheses : h1 : e ^ d ^ b ^ a = 0 .... which center is nowhere and of nite radius (R = ?1) (do not confuse with ...
COMPUTATIONAL SYMBOLIC GEOMETRY B. MOURRAIN, N. STOLFI

SAFIRy 2004 route des Lucioles 06565 Valbonne FRANCE

mourrain,[email protected]

The aim of this work is to present a framework for symbolic computations in Geometry. More precisely, we are interested in problems coming from robotics and vision, therefore we focus on points, linear spaces, spheres, displacements and matrices. The approach chosen consists in dealing with intrinsic properties, in order that we (most of the time) manipulate invariant quantities (independent of the referential frame) and we (as much as possible) avoid using coordinates. The reason for this choice is that computations are done in a more simple, synthetic and natural way than if we used coordinates. For each class of object mentioned before, we give one or more possible formal representations and we describe the relations that exist between the quantities introduced to represent these objects. Here is the general scheme that we follow : if we want to work in a space A, we use a free algebra of polynomials (or a free module) F where the variables represent generators of A and we consider the relations K that exist between these objects :  0!K!F ! A!0 The map  associates to a variable of F the object represented by this variable in A and K is the kernel of this map. We call such a map a representation of A. Notice that this representation is not unique. In order to be able to compute modulo K , we give a normal form algorithm which reduces every element of K to 0 . Important relations in this representation and operators corresponding to geometric properties are also given. Where possible we will exhibit intersection formulas for constraint problems on these objects and we end by suggesting applications in applied elds. The rst part is devoted to linear spaces, the second to spheres, the third to displacements and the last one to matrices, treated as non-commutative variables. The ensemble of this work aims to convince the reader that symbolic manipulations on such geometric objects can be e ectively handled in practice.

1. Linear spaces Here, we consider points, lines, planes, etc in an ane (resp. projective) space. We want to manipulate them directly, taking into account collinearity, concurrency, conjugation, etc without coordinates. For that, let us introduce now a natural space of representation, where these objects "live". y SAFIR is a common project to INRIA (Sophia-Antipolis), Univ. De Nice-Sophia-Antipolis, CNRS

2

B. MOURRAIN, N. STOLFI

1.1. THE EXTERIOR ALGEBRA

The ambient space where we want to work is a projective space P of dimension n (over the eld K ). After taking a referential, we can consider it as the projective space associated to a K -vector space E of dimension n + 1. If (u0 ; : : : ; un ) is a non-zero vector of E , we will denote by (u0 :    : un) the element of the projective space P = P(E) associated to it (that is the set of (n + 1)-tuples equal to (u0; : : : ; un) up to multiplication by a non-zero scalar). Let's denote by e0 ; : : : ; en a basis of E . We will use this basis to construct the exterior algebra ^E of E but our construction is independent of this choice (see (Lang, 1980), (Bourbaki, 1970)). The exterior algebra ^E is the K -algebra space generated by the "words" on the alphabet e0 ; : : : ; en denoted by ei1 ^    ^ eik with 0  ij  n (where ^ is the multiplication operator or concatenation) modulo the following relations: 1. ^ is bilinear: ei ^ ( ej +  ek ) =  ei ^ ej +  ei ^ ek , 2. ^ is anti-commutative: ei ^ ej = ?ej ^ ei . This implies that ^E = K  E  ^2 E      ^n+1E where ^k E is the K -vector space generated by the terms ei1 ^    ^ eik (with i1 <    < ik ). An element of ^k E is said to be of degree k. The dimension of ^E is 2n+1, a basis is ei1 ^    ^ eik and ^E contains E and K . For more information, we refer to (Lang, 1980). The space of representation of linear spaces, that we are going to use, is the projective space P(^E) associated to this K -vector space. In this representation, points in P(E) are elements of degree 1 in P(^E). A linear space L~ generated by the points v0; : : : ; vk is represented by the element L = v0 ^    ^ vk (of degree k + 1) of P(^E). Remark that if we choose another basis w0; : : : ; wk of L~ we have the relation w0 ^    ^ wk = detv (w) L where detv (w) 6= 0 is the determinant of the basis w in v. Moreover, a point v is in the space L~ = hv0; : : : ; vd i if and only if it satis es

v ^ v0 ^    ^ vk = 0 So we have a one-to-one correspondence between K -linear spaces of P and elements of P(^k+1E ) of the form v0 ^    ^ vk . De nition 1.1 | The subset of P(^kE ) of elements of the form v0 ^    ^ vk is called the Grassmannian Gk (E ) of k-spaces in E . The coordinates of an element of ^k+1 E in the basis ei0 ^    ^ eik are denoted by ([i0; : : : ; ik ]). Those of an element of the form v0 ^    ^ vk are the determinant (k + 1)  (k + 1) of the matrix [v0 ; : : : ; vk ] and satisfy the well-known Plucker relations (see (Doubilet et al., 1974), (Hodge and Pedoe, 1952)). We denote by G the union of all Gk (E )g for 1  k  n. Let K [Gk ] be the space of algebraic functions on Gk . A representation is given by the following map: Let x0; : : : ; xk be generic vectors xi = (x0;i; : : : ; xn;i) where xi;j are variables and denote by ji0; : : : ; ik j the determinant det(xi; )0; k (they are the generic coordinates of an element of Gk ). Let K [^k+1 E ] be the polynomial ring in the variables [i0; : : : ; ik ]. Then, the kernel Rk of the map   0 ! Rk ! K [^k+1 E ] ! K [Gk ] ! 0 [i0; : : : ; ik ] 7! ji0; : : : ; ik j

is the ideal generated by the Plucker relations.

3

COMPUTATIONAL SYMBOLIC GEOMETRY

The example of lines in a space P(E) of dimension 3 where e ; : : : ; e is a basis of E : The lines are represented by elements of P(^ E ). The coordinates of an element L in the basis e ^ e , e ^ e ,e ^ e , e ^ e , e ^ e ,e ^ e are denoted by (L ; : L ; : L ; : L ; : L ; : L ; ). A line through two points x; y will be represented by L = x ^ y. Its coordinates (which are the 2  2 minors of the matrix [x; y]) satisfy the relation L ; L ; ?L ; L ; +L ; L ; = 0 (1) Conversely an element of P(^ E ) which satis es this relation is of the form x ^ y and R is generated by the polynomial (1). The elements satisfying this relation form the Grassmannian G of P(E). The quadratic form (1) de nes a non-degenerate bilinear product (denoted by [ j ]) and we 0

2

0

1

0

2

1

2

0

3

1

01

3

03

2

3

02

01

13

03

2

02

3

12

03

13

23

12

2

2

have the following properties: ? For every element L of P(^2E ), [LjL] = 0 if and only if L 2 G2. ? For every points a; b; c; d 2 P, [a ^ bjc ^ d] = det(a; b; c; d). ? For every lines in L; L0 G2, [LjL0 ] = 0 if and only if L \ L0 6= ;. The rst point comes from the de nition of the inner-product. The second point is the expansion of a 4  4 determinant by the Laplace's rule in terms of 2  2 minors. For the third point, remark that L is of the form a ^ b, L0 of the form c ^ d and L meets L0 i the 4 points a; b; c; d are in a same plane : det(a; b; c; d) = 0. 1.2. ALGEBRA WITH STRAIGHTENING LAWS

Let's introduce here a fundamental tool which appears as soon as we are manipulating determinants. This is the structure of algebra with straightening laws, which corresponds to special properties of normal form, where the reduction is compatible with a partial order. The usual approach for normal form methods in a polynomial quotient K [X ]=I consists in nding a subset S of the monomials (in X ) such that K

S  I = K [X ]

where K S is the K -vector space generated by S in K [X ]. Then any polynomial p can be uniquely decomposed as a sum of an element of K S and an element of the ideal I . The normal form of p is just its projection (p) onto K S . We call S the set of standard monomials. In order to have a simple description of S and to obtain a reduction which is compatible with multiplication by monomials, one often requires for S to be the complementary (in the set of monomials) of an ideal generated by monomials (m1; : : : ; ms). Then one can use the rules mi ! (mi ) to obtain the normal form of an element of K [X ]. Precisely, any monomial m not in S , of the form m = m0 mj , can be transformed (modulo I) in m?> m0 (mj ) and as soon as a monomial appearing in the form m0 (mj ) does not belong to S we can iterate this process. Eventually, we stop with a polynomial in K S . But to be sure that this reduction ends (with a linear combination of monomials in S ), something must be decreasing. If for instance all monomials in (mi) are strictly lower than mj for a total Noetherian order  (on monomials) compatible with multiplication, then this reduction process nishes. In this case, the elements mi ? (mi) are called a standard basis of I . If instead of a total order, we take a partial order  (also compatible with multiplication), then we obtain what is called an algebra with straightening laws. Let's precise this notion: Let X be a set of variables and  be a partial order on X . We extend this order to monomials in X in the following way. For any monomials m; m0 in X , m is greater than m0 if any minimal variable (for ) in m is greater than a minimal variable in m0 .

4

B. MOURRAIN, N. STOLFI

In the following, we say that m is a standard monomial for  if it is of the form m = x1    xk with x1      xk . Let S be a subset of the standard monomials for . De nition 1.2 | The algebra A = K [X ]=I is an algebra with straightening laws for  on S if and only if  K S  I = K [X ] (ASL1)  For any variables x; y 2 X such that x yP62 S , we have (ASL2) x y  s2S s s with s 6= 0 implies s  x y. As x y 62 S , its minimal variables are x; y. So if s = x1    xk with x1      xk , the second point means that x  x1; y  x1. Here the standard monomials S form a basis of the quotient K [X ]=I . If S is the set of standard monomials for , its complementary is the monomial ideal generated by all products of variables x; y which are not comparable for . Let's come back now to our linear spaces. In order to have a global representation where we can manipulate these spaces all together, we introduce the set of variables XG = f[j0 ; : : : ; js ]; with 0  s  n; 0  j0 < j1 <    < js  ng: and n + 1 generic vectors xj = (x0;j ; : : : ; xn;j ) for 0  j  n. We denote by K [XG ] the polynomial ring over XG and jj0; : : : ; jsj the determinant det(xk;jl )0k;ls. Let K [G ] be the K -algebra generated by the determinants jj0; : : : ; jsj. We have the representation: 0 ! R ! K [XG ] ! K [G ] ! 0 (2) [j0; : : : ; jl ] 7! jj0 ; : : : ; jl j As K [^k+1 E ] is a sub-algebra of K [XG ], we see that this representation \contains" the representation of Gk . It is not exactly the direct product of the representation of Gk , because the kernel R contains the Plucker relations in Rk , but also some other relations between variables of di erent size. De nition 1.3 | Let  be the partial order on XG such that  p  q and 0 0 [j1; : : : ; jp ]  [j1; : : : ; jq ] i j  j 0 ; : : : ; j  j 0 : q 1 q 1 Let S be the set of standard monomials for . An element of S corresponds to a Young tableaux of the shape 2 i0 i1    il 3 0 0 0

66 66 66 64

i01

.. . .. .

i0k0

i11

.. .

i1

k1



.. .

ilk

l

77 77 77 75

where the indices are strictly increasing by columns and not decreasing by rows. A column of this tableaux represents a variable of XG . Proposition 1.4 | The algebra K [G ] is an algebra with straightening laws for  whose straightening rules are [i1; : : : ; ip] [j1; : : : ; jq ] (3) X     ! ?() [i1; : : : ; ik ; ik+1; : : : ; ip ][j1 ; : : : ; jk+1; jk+2 ; : : : ; jq ] 2Snfidg

COMPUTATIONAL SYMBOLIC GEOMETRY

5

with p  q, i1  j1; : : : ik  jk but ik+1 > jk+1 and where S is the set of permutations of fik+1 ; : : : ; ip; j1; : : : ; jk+1 g such that ik+1 <    < ip et j1 <    < jk+1. We don't give here the proof of this property but we are going to describe an algorithm which computes quickly the normal form with respect to these rules. In fact, the description of the algorithm contains the proof of this property. References for this proposition can be found in (DeConcini et al., 1982), (Mourrain, 1991a). Let  be the lexicographic order re ned by the degree on polynomials in xi;j such that x0;1  x0;2      x0;n  x1;1  x1;2      xn;n. For any element p of R, we denote by  (p) its leading term for this order (it is a scalar times a monomial). So the leading term of jj0; : : : ; jsj is x0;j0    xs;js . De nition 1.5 | A monomial m in xi;j is well-ordered if it is of the form m = x0;i00    xk0 ;i0k0 x0;i10    xk1 ;i1k    with k0  k1    and i0j  i1j    . 1

In other words, m is well-ordered if it corresponds (by the map ) to the leading term of a standard monomial [i00; i01; : : : ; i0k0 ] [i10; : : : ; i1k1 ]   . Let's call W the set of well-ordered monomials in xi;j . We have a one-to-one correspondence  : W ! S between elements of W and standard monomials in S . Remark that this implies the independence of the standard monomials S over K in the quotient K [XG ]=R. Algorithm of normalization: Input Output

q

: A polynomial

p

XG ].

in K [

2 K S ).

: Its normal form (

:= ;

end of while;

r

return( );

Let 1s1 + 2 s2 +    be the normal form of p and assume that the standard monomials si are ordered according to the leading term of their expansion by . As they are distinct, the leading term  of (p) gives the rst standard monomial t = ( ) = 1 s1 . The loop of this algorithm consists to replace (p) by (p) ? (t) = (2s2 +   ). As we are only interested by well-ordered monomials, it is enough to consider those monomials in any expansion . So in the loop instead of (p) replaced by (p) ? (t), we consider q replaced by q ? s. This process ends because the leading monomial is strictly decreasing at each step. The cornerstone of this algorithm is to be able to compute the well-ordered monomials (and only them) of the expansion (p) of a polynomial p 2 K [XG ]. We describe here a lazy but fast algorithm when p is a monomial. It is extended naturally to any polynomial p. The idea is to keep as much as possible the expansion determinants in a compact form and to cancel the useless terms at each level. So we introduce the following notation: Let (i1; : : : ; ik jj1 ; : : : ; jk ) (with 1  i1 <    < ik  k and 0  j1 <    < jk  n) be the determinant of row indices

6

B. MOURRAIN, N. STOLFI

i1 ; : : : ; ik and column indices j1; : : : ; jk of the matrix (xi;j ). We will use the expansion by the rst row: (i1; : : : ; ik jj1 ; : : : ; jk ) = (i1jj1)(i2; : : : ; ik jj2; : : : ; jk ) ?    + (?1)k?1(i1jjk )(i2; : : : ; ik jj1; : : : ; jk?1)

t = [i00; i01; : : : ; i0k0 ] [i10; : : : ; i1k1 ]   

XG ].

in K [

: The well-ordered monomials that appear in

(t).

c t (i00; i01; : : : ; i0k0 j0; : : : ; k0)(i10; : : : ; i1k1 j0; : : : ; k1)   ; while there are non-expanded determinant in r do s := a monomial of r of the form c t d1 d2    where d1 = (i1 ; : : : ; ik jj1 ; : : : ; jk ) with 1  i1 <    < ik  k and 0  j1 <    < jk  n; d := (i1jj1)(i2; : : : ; ik jj2; : : : ; jk ) ? (i1jj2)(i2; : : : ; ik jj1; : : : ; jk ) +    s0 := 0; for each l from 1 to k do t0 := ;  := ; c0 := (?1)l?1 c; s0 := s0 + c0 t0 ;

c

t

:= 1;

:= []; r :=

end of for; replace

s

by

s0

in

r;

end of while;

r

return( );

where

? puts j1 in the rst non-assigned place of the row il of t, checks if the 1 result is standard and returns 0 if not. ? yields a list where the determinants are also sorted according to the rst index of columns j1. To be correct, we must assume at the beginning that the variables [i00; i01; : : : ; i0k0 ] [i10; : : : ; i1k1 ] are sorted according to the rst index il0. Example " : We #want to compute the normal form of

1 2 4 = 3 6 5 := [] (1; 3; 8j0; 1; 2) (2; 6; 7j0; 1; 2) (4; 5; 9j0; 1; 2) 8 7 9 determinant expansion: (1; 3; 8j0; 1; 2) ! (1j0) (3; 8j1; 2) ? (1j1) (3; 8j0; 2) + (1j2) (3; 8j0; 1) insertion of (1j0); : : : in t and cancelation > t := [1](2; 6; 7j0; 1; 2) (3; 8j1; 2) (4; 5; 9j0; 1; 2) 1 1 2 > t := [ ] (3; 8j1; 2) (4; 5; 9j0; 1; 2) (6; 7j1; 2) ? 2 (3; 8j1; 2) (4; 5; 9j0; 1; 2) (6; 7j0; 2) "1# 1 2 (4; 5; 9j0; 1; 2) (6; 7j1; 2) (8j2) ? 2 (4; 5; 9j0; 1; 2) (6; 7j0; 2) (8j1) > t := 3 3 >t

COMPUTATIONAL SYMBOLIC GEOMETRY

1 1 2 4 (5; 9j1; 2) (6; 7j1; 2) (8j2) ? 3 > t := "3 1 2 # "1

+ 3  1 42 > t := 3 5



? 31

"1

? 2 3



7

2 (5; 9j0; 2) (6; 7j1; 2) (8j2) 4 4# (5; 9j0; 1) (6; 7j1; 2) (8j2) ? 2 (5; 9j1; 2) (6; 7j0; 2) (8j1) 3 " # " #  4 (7j2) (8j2) (9j2) ? 31 52 4 (7j1) (8j2) (9j2) ? 31 62 4 (7j2) (8j2) (9j1) 6 "6 1 2 5 # "5 1 4 6 #  2 5 (7j1) (8j2) (9j2) + 2 5 (7j2) (8j1) (9j2) 4 6 (7j2) (8j2) (9j2) + 36 4 3 4# 5 (7j0) (8j1) (9j2) 6

which leads to the result:

"1 2 4# "1 2 4# "1 2 5# "1 2 5# "1 4 6# "1 4 7# 3 5 6 ? 3 5 7 ? 3 4 6 + 3 4 7 + 2 5 8 ? 2 5 8 7 8 9 6 8 9 7 8 9 6 8 9 3 7 9 3 6 9

Note that the standard monomials are sorted by the lexicographic order by rows. This algorithm can be generalized, as we will see, to the bitableaux and to the algebra of inner-products. It corresponds to an general version of the algorithm in (Carre et al., 1992), where the "Yamanoushi" words are replaced by well-ordered monomials. 1.3. OPERATORS

In order to manipulate points X1; : : : ; Xm, we introduce here the space of representation F = mi=1 C Xi where C is a coecient ring that we will describe below. Elements of F are linear combinations (with coecients in C ) of the variables Xi . In the same way, we de ne the exterior algebra ^C F, which is the set of linear combinations (on C ) of the elements Xi1 ^    ^ Xik . These elements represent a linear spaces through the points (Xi)i . The usual ring C used for instance in (Barnabei et al., 1985), is the set of invariants of m points, that is the algebra generated by the determinants of n points among X1; : : : ; Xm. However, this is not sucient as we will see. We need a bigger coecient space that contains ^C F, which is in fact the set of covariants (see (Weyl, 1939), (Grosshans et al., 1987)). For this reason, we will consider elements a1 ^    ^ ak of ^k E as linear forms on ^E : (a1 ^    ^ ak jv1 ^    ^ vl ) = 0 if l 6= n ? k = ja1; : : : ; ak ; v1; : : : ; vn?k j We denote such an element by (a1; : : : ; ak ). Let t1 = (t1;1; : : : ; tn;1) : : : tn = (t1;n; : : : ; tn;n) be n generic vectors. We can identify (a1; : : : ; ak ) with the polynomial det(a1; : : : ; ak ; tk+1; : : : ; tn) 2 K [ti;j ]. If (t1 ; : : : ; tn ) represents a generic basis of E , taking (a1 ; : : : ; ak ) instead of the vector of all coecients of the monomials in ti;j in this polynomial, is a way to say that we forget the frame in which we are working and that we manipulate intrinsic values. As we are dealing with arbitrary points X1; : : : ; Xm , we introduce generic vectors x1 = (x1;1; : : : ; xn;1) : : : xn = (x1;m; : : : ; xn;m) that will represent our points. Let's take for C the polynomial ring K [XG ] that represents the algebra generated by the elements (xi1 ; : : : ; xik ) 2 K [xi;j ; ti;j ]. We are going to work in the following representation: 0 ! K ! ^C F ! K [xi;j ; ti;j ]n Xi 7! xi [i1; : : : ; ik ] 7! (xi1 ; : : : ; xik )

8

B. MOURRAIN, N. STOLFI

Notice that the kernel of this map, restricted to the elements of C is the same as the kernel of the map (2). For that, consider the map  on n + m indices where the points t1; : : : ; tn correspond to the indices m +1; : : : ; m + n. Identifying ([i1 ; : : : ; ik ]) and ([i1; : : : ; ik ; m + k +1; : : : ; m + n]), we can apply the same straightening laws on the n  n determinants as in (1.4). Remark also that the kernel K has the same type of structure of algebra with straightening laws. We can introduce n new generic vectors of indices ?n +1; : : : ; 0 and identify Xi1 ^  ^ Xik with [?n; : : : ; ?n ? 1+ k; i1 : : : ; ik ] and apply the rules (1.4). In other words, ^C F is an algebra with straightening laws in which we can reduce any element to a normal form. We are now going to quotient the space ^C F=K by relations coming from projective con gurations of points. 1.3.1. Cramer's rule Suppose that we have a relation of the form a ^ a1 ^    ^ ad = 0 where a1 ^ : : : ^ ad 6= 0. We would like to derive a relation on a. As ()a1; : : : ; ad ) 7! [a1; : : : ; ad ] is a multilinear alternate form, we can deduce that a[a1; : : : ; ad ] ? a1[a2; : : : ; ad ; a] + a2[a1; a3 ; : : : ; ad ; a] +    + (?1)d ad [a1; : : : ; ad?1; a] = 0 Moreover, as we are working in a projective space and as [a1 ; : : : ; ad ] 6= 0, we can use the rule of substitution a ! a1[a2; : : : ; ad ; a] ? a2[a1; a3; : : : ; ad ; a] +    + (?1)d?1ad [a1; : : : ; ad?1; a] This is the Cramer rule. 1.3.2. Intersection and sum We are now going to describe the operators of intersection and sum of linear spaces in this representation. We give here a generalization of the Cayley algebra operators to linear spaces in ^E with intersection of arbitrary dimension. The usual Cayley operators (see (Barnabei et al., 1985), (Doubilet et al., 1974)) assume implicitly that the intersection of linear space is generic (the dimension of intersection is the sum of dimensions minus the dimension of the ambient space). But in geometric problems, it is frequent that the intersection is not of the generic dimension. Think for instance to the intersection of two coplanar lines in a space of dimension  3. So we need to de ne an operator of intersection in ^F, which will be valid whatever the dimension of the intersection is. Our construction is based on the following key idea: The intersection of two spaces E1; E2 corresponds to the intersection of their product E1  E2 with the diagonal  of E  E . This means that we are going to double the number of variables and then to project onto components of this product. So consider the map: D : ^F C ^F ! ^F C ^F x 1 7! x 1 + 1 x 1 y 7! 1 y Using the structure of skew-exterior algebra (see (Bourbaki, 1970)) of ^C F ^C F, we can extend this map by compatibility with the exterior product and by linearity. For instance, if E1 = x1 ^    ^ xp, E2 = y1 ^    ^ yq , we have: D(E1 E2) = D(x1 1) ^    ^ D(x1 1) ^ D(1 y1) ^    ^ D(1 yq ) = D0(E1; E2) + D1(E1; E2) +    + Dp(E1; E2) where Di(E1; E2) is the component in ^p?iF ^q+iF of D(E1 E2).

COMPUTATIONAL SYMBOLIC GEOMETRY

9

Proposition 1.6 | The last non-null term of this development is of the form I S where I~ = E~ \ E~ and S~ = E~ + E~ . 1

2

1

2

(see (Mourrain, 1991a), (Mourrain, 1991b),(Mourrain, 1994b),). To come back to our space ^F, we can project on one of the component by using the injection ^F ,! C . It consists to transform a component in a scalar. Projection of the second component will give for instance 2 a ^ b ^ c [d; e; f ] [a; c; d] a ^ b ^ c d ^ e ^ f [a; c; d] !

We have now two operators : intersection and sum, which are dual in some way. Let Dl (E1; E2) = I S be the last non-zero term of D(E1 E2), then ? The projection of the second component gives the intersection: E1 4 E2 = I [S ]. ? The projection of the rst component gives the sum: E1 5 E2 = S [I ] Let's give the example of two planes E1 = a ^ b ^ c, E2 = d ^ e ^ f in a space of arbitrary dimension:

E1 4 E2 = = = =

1 [a; b; c; d; e; f ] if E1 \ E2 = f0g a [b; c; d; e; f ] ? b [a; c; d; e; f ] + c [b; c; d; e; f ] if E1 \ E2 is a point a ^ b [c; d; e; f ] ? a ^ c [b; d; e; f ] + b ^ c [a; d; e; f ] if E1 \ E2 is a line a ^ b ^ c [d; e; f ] if E1  E2

Remark that each term Dk (E1; E2) corresponds to an alternate shue, but with a di erent size. In this formalism, we see that no case is forgotten. 1.3.3. The hodge operator We de ne here an operator which allows us to identify the exterior algebra and its dual. Let~be the Hodge operator de ned by : ~ : ^(E ) ! ^(E ) 1 7! e1 ^    ^ e n ei1 ^ : : : ^ eik 7! (?1)i1 ++ik ?k(k+1)=2ej1 ^ : : : ^ ejn?k where i1; : : : < ik , j1 < : : : < jn?k and fi1; : : : ; ik g[fj1 ; : : : ; jn?k g = f1; : : : ; ng. So that we have ei1 ^ : : : ^ eik ^ ei1 ^ : ~: : ^ eik = e1 ^    ^ en . This operator is not so exotic as it seems. For instance, the usual vector product of the "Physicians" in K 3 is u  v = u ^~ v 2 E 3 . 1.4. APPLICATION TO THEOREM PROVING

We assume here that the hypothesis are in triangular form (a new point is construct with the previous ones) and involve incidence conditions. The algorithm:

10

B. MOURRAIN, N. STOLFI

Input

: A list of points a list

Output

R

H

of hypotheses

a conclusion

:

0

iff

T

(p1; p2; : : : ; pm),

T.

2 ^C E ,

is ``true'' with the hypotheses

H.

l := 1; while l  m do Let pl ^ H1 = 0; : : : ; pl ^ Hs = 0 be the hypotheses of H Construct the intersection I := ((H1 4 H2 ) 4   ), := ();

testing equality to zero with the rules Derive the Cramer rule

p l ? > rl

from the relation

Add this rule at the beginning of

l

:=

l + 1;

R;

R;

on the point

pl ;

pl ^ I = 0.

end of while; reduce

T

by

R;

In this algorithm, we assume that at each loop, the rules R are able to reduce to 0 any property of the points p1; : : : ; pl?1. As the terms H1; : : : ; Hs depend only on p1; : : : ; pl?1 (triangular form), we can use these rules to test the last non-zero term of I1;2 = D(H1; H2 ), I1;2;3 = D(I1;2; H3 ) : : : Then, the Cramer rule will give a way to rewrite pl for next loop. As usually, when dealing with geometric con gurations, there are some degenerate cases that must not be taken into account in the proof of a geometric theorem. From an algebraic point of view, the variety de ned by the constraints can be decomposed in components where the con guration is degenerated and others which correspond to \true" con gurations. We call these components generic components.

Proposition 1.7 | This algorithm reduces to 0 any property which is true on the generic com-

ponent of the con guration. This component is characterized by the dimension of its projections onto the subspaces de ned by the intermediate points.

See (Mourrain, 1991b), for the proof of this proposition. This means that we can check equal-

ity to zero in our space of representation ^C F, quotiented by triangular geometric relations. We give here the output of a lisp program (which implements this method) for a simple example in a space of dimension 3:

11

COMPUTATIONAL SYMBOLIC GEOMETRY k

j

Rules: r1 := k r2 := j r3 := i r4 := h

h

g e

d f

c

i

b

a

Points : (a b c d e f g h i j k)

r5 := g

Hypotheses : h1 : e d h2 : f b h3 : g d h4 : h f h5 : h f h6 : i c h7 : i a h8 : j c h9 : j a h10 : k f h11 : k b

r6 := f

^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^

^b^a= ^c^a= ^a^c= ^c^g= ^e^b= ^f=0 ^b=0 ^g=0 ^d=0 ^h=0 ^e=0

Conclusion: t : i

^

j

0 0 0 0 0

r7 := e

-> -> -> ->

+ + + -> -> -> + +

e g b f f e b d a c a d a

[h [d [f [g [g [g [g [g [g [f [f [e [e

f c c f f f f c d b c b d

b] + a] + a] + c b] e c] c b] e c] a] + c] a] + b] a] b]

b [h f c [g d a [f c [h e] [h b] [h f] [h f] c [g d

e] a] b]

a]

b [f c a] b [e d a]

------------------------------------| points: a b c d e f g h i j k | ------------------------------------|dimensions: 3 3 3 3 2 2 2 1 0 0 0 | ------------------------------------Reduction of t : 0

^

k =0

The table above corresponds to the degree of freedom of each point for the generic component. 1.5. APPLICATION TO MECHANICS

To analyze the critical locus of mechanisms, one is lead to study singularities in movement of solids. These singularities correspond to con gurations where the \tangent space" is not of the correct dimension. But how to compute the tangent space to the set of displacements: If we are dealing with a displacement Dt of a solid depending on a parameter (eg. the time t), the speed of a point M of the moving solid is given by @t (Dt(M )) = V + ODt(M ) 

where  is vector products of the Physicians, V the speed of the origine, and the angular velocity. In other words, (V; ) represents our tangent vector and we identify this torque with the element I of ^2 E : I = V1 e2 ^ e3 ? V2 e1 ^ e3 + V3 e1 ^ e3 + 1 e1 ^ e4 + 2 e2 ^ e4 + 3 e3 ^ e4: It represents the in nitesimal movement of the solid. Consider now the map which associates to the displacement of a platform, the square of the length of 6 arms of control (Xi ; Zi ) with Zi = Dt:Yi . This mechanism is controlled by the 6 lengths of the arms and this control corresponds to inverse locally the map  = ?1. We easily see that if the Jacobian of the map is of determinant 0, its inverse becomes \in nite" and the solid is not in a stable position (in fact the forces needed to stabilize the platform become also in nite). See (Merlet, 1990) for more informations.

12

B. MOURRAIN, N. STOLFI Z3

X4

X3

Z5

X5 X2

Z1

X6 X1

Figure 1. A special parallel robot

In order to compute the Jacobian of , we derive the inner-product with respect to the time and we obtain by easy computations: @t ([Dt:Yi ? Xi ; Dt:Yi ? Xi ]) = (V jXi Zi ) + (Zi  jXiZi ) = (V jXi Zi ) + ( jXi  Zi ) = [Xi ^ Zi jI ] where ( j ) is the inner-product in the Euclidean space and [ j ] the inner-product on lines de ned by the relation (1). So the Jacobian of the map is the linear map I 7! [Xi ^ Zi jI ]1i6 given by a 6  6 matrix whose rows are the vector Xi ^ Zi . Consequently this mechanism is unstable if and only if there exists an in nitesimal movement I such that [Xi ^ Zi ; I ] = 0 \orthogonal" to the bars (Xi ^ Zi )1i6, or equivalently if and only if the vectors (Xi ^ Zi )i are linearly dependent in ^2 E . For the con guration of gure (1) (the gray triangle is moving above the points Xi ), the determinant of this Jacobian matrix is [X1 ; Z1; Z3 ; Z5][X2; X3 ; X4; Z3 ][X5; X6 ; Z1; Z5 ] ? [X1; Z1 ; Z3; Z5 ][X2; X5; X6 ; Z5][X3 ; X4; Z1 ; Z3] ?[X2 ; Z1; Z3 ; Z5][X1 ; X3; X4; Z3 ][X5; X6 ; Z1; Z5 ] + [X2; Z1 ; Z3; Z5 ][X1; X5 ; X6; Z5 ][X3; X4; Z1 ; Z3] It corresponds to the positions of the triangle where the planes P1 = (X1; X2 ; Z1), P2 = (X3 ; X4; Z3 ), P3 = (X5; X6 ; Z5), P4 = (Z1; Z3; Z5 ) have a common point. Use the operator intersection of section (1.3.2) to obtain this formula.

2. The space of spheres

Let A 3 be the ane Euclidean space of dimension 3, and S (A 3 ) = S the set of all quadratic forms of the form : q(x; y; z ) = u0(x2 + y2 + z 2) ? 2 u1 x ? 2 u2 y ? 2 u3 z + u4 (4) that we identify with the projective space P4 of classes (u0 : u1 : : : : : u4). If u0 6= 0, the quadric V (q(x; y; z ) = 0) corresponds to a sphere of center (1; uu10 ; uu02 ; uu30 ) (or 4 ) where Q(u ; : : : ; u ) = u2 + u2 + (u0 :    : u3) in P3) and radius R such that R2 = Q(u0u;:::;u 0 4 1 2 0 u23 ? u0u4: If u0 = 0, the quadric V (q(t : x : y : z ) = 0) obtained by homogenization of (4) is the union of an ane plane and the plane at in nity V (t = 0) of P3. It corresponds to a \point at in nity" in P4. Moreover, if u0 = u1 = : : : = u3 = 0, we obtain the special sphere ! = (0 : : : : : 0 : 1), which center is nowhere and of nite radius (R = ?1) (do not confuse with (Descartes, 1596 1650) : : : ).

COMPUTATIONAL SYMBOLIC GEOMETRY

13

In the real case, if Q(u0; : : : ; u4) > 0, the quadric is a \real" sphere. If Q(u0; : : : ; u4) = 0, it is a sphere with zero radius and we will associate it to a point. If Q(u0; : : : ; u4) < 0, it is an \imaginary sphere". Consider more precisely the application which identi es a point to the sphere-point associated. It is de ne on A 3 by the map (a1; a2 ; a3) 7! (1 : a1 : a2 : a3 : a21 + a22 + a23) and projectively by : P3n ! P4 (a0 : a1 : a2 : a3) 7! (a20 : a0 a1 : a0a2 : a0a3 : a21 + a22 + a23) = (u0 : u1 : u2 : u3 : u4) where is the set of points such that a21 + a22 + a23 = a0 = 0. We call this map the blowing-up of : The image of is contained in the quadric Q = V (u21 + u22 + u23 ? u0u4 = 0). As we will see, this quadric plays an important role. Let's introduce some notations : For any sphere S in S , with u0 6= 0, we denote by S_ the representative sphere such that u0 = 1. For a point P in P3n , we denoted by P_ = (_P ) the corresponding point-sphere. The bilinear form associated to Q is denoted by Q(x; y) = (xjy). It is de ned 8S = (u0 :    : u4); S 0 = (u00 :    : u04) 2 S by : (S jS 0 ) = u1u01 + u2u02 + u3u03 ? 12 (u0u04 + u4u00) Let's note that for a sphere S (resp. S 0 ) with radius R (resp. R0 ), and center O = ( ; ; ) (resp. O0 = ( 0; 0 ; 0 )) (S_ jS_ 0 ) = 12 (R2 + R02 ? d2(O; O0)) where d2( ; ) is the square of the distance. A simple computation proves it : (S_ jS_ 0 ) = 0 + 0 +

0 + 21 (R2 ? 2 ? 2 ? 2 + R02 ? 02 ? 02 ? 02 ) = 12 (R2 + R02 ? ( ? 0 )2 ? ( ? 0 )2 ? ( ? 0 )2) = 21 (R2 + R02 ? d2(O; O0)) Remark that (S_ jS_ ) = R2 is the square of the radius of S . We introduce here a notation which will be useful in the following sections. For all spheres S1 ; : : : ; Sn; S10 ; : : : ; Sn0 2 S , let's denote by :

(S jS 0 )    (S jS 0 ) n .. (S ; : : : ; SnjS 0 ; : : : ; Sn0 ) = ... . (SnjS 0 )    (SnjSn0 ) 1

1

1

1

1

1

the determinant of the scalar products. 2.1. STRAIGHTENING LAWS

In this section, we assume that we are dealing with a set of generic spheres fS1 ; : : : ; Smg and we are computing with polynomial expressions in the inner-products (SijSj ). These are the invariants of the orthogonal group for the usual action (see (Weyl, 1939)). We denote by A = K [(SjS )] the algebra generated by the inner-products (SijSj ). We want to compute in this algebra.

14

B. MOURRAIN, N. STOLFI

So we introduce the following notations. Let (i1; : : : ; ik jj1 ; : : : ; jk ) (for 1  i1 <    < ik  m and 1  j1 <    < jk  m) be variables and denote by F = K [(ijj)] the associated polynomial ring. We use the following representation: 0!K !F ! A!0 (i1; : : : ; ik jj1; : : : ; jk ) 7! (Si1 ; : : : ; Sik jSj1 ; : : : ; Sjk ) Remark that if k > 5 then the image of such a variable is null, so in the following we assume that k  5 (the size of the variable is at most 5). We can now describe explicitly the kernel of this map. Consider the partial order  de ned by (i1; : : : ; ip j j1; : : : ; jp)  (i01; : : : ; i0q j j10 ; : : : ; jq0 ) if p  q and i1  i01; : : : ; iq  i0q ; j1  j10 ; : : : ; jq  jq0 Let S be the set of monomials m = x1    xk such that x1      xk and xi is of the form (i1; : : : ; ip j j1 ; : : : ; jp ) with i1  j1; : : : ; ip  jp. Theorem 2.1 | The algebra K [(SjS )] is an Algebra with Straightening Laws on S , whose normalization rules are:

+1 (?1)i P  (l1; : : : ; lp j c1; : : : ; cp )(l1; : : : ; lq j c1 ; : : : ; cq ) ! Pji=0  S ;0 =id R (i )(i )       (l1; : : : ; lk lk+1; : : : ; lp ; l1 ; : : : ; li j c1 ; : : : ; cp ; c1 ; : : : ; ci )(li+1; : : : ; lj+1 ; lj+2 ; : : : ; lq j ci+1; : : : lq ) if p  q and l1  l1; : : : ; lk  lk but lk+1 > lk+1 (and by symmetry, the same relations on columns).  (i1 ; :P: : ; ik ; ik+1 ; : : : ; ip j j1 ;: : : ; jk+1 ;jk+2; : : : ; jp) ! ? =id ()(i1; : : : ; ik ; ik+1 ; : : : ; ip j j1 ; : : : ; jk+1 ; jk+2; : : : ; jp ) if i1  j1 ; : : : ; ik  jk but ik+1 > jk+1 if (i1; : : : ; ip j j1 ; : : : ; jp ) 62 S . with the convention that variables of size bigger than r = 5 are canceled and that indices are ordered (with a sign) after rewriting. For a demonstration of this property, see (DeConcini et al., 1982). To obtain the normal form of an element of this algebra, we can in fact use the same algorithm as in section (1.2), by introducing a lexicographic ordering on the coordinates si;j of the generic spheres. The initial of a determinant (Si1 ; : : : ; Sik jSj1 ; : : : ; Sjk ) is then s1;i1 ; : : : ; sk;ik ; s1;j1 ; : : : ; sk;jk and we have a oneto-one correspondence between S and their initial. So we can use the same projection process to obtain the standard form. This also gives an another (e ective) proof of the theorem (see (Mourrain, 1991a)). Assume now, that we are dealing with generic points P1 ; : : : ; Pn of A 3 , and that the constrains on these points are only involving squares of distances. So we have polynomial expressions in d2(Pi ; Pj ). The Cayley-Menger determinant is de ned by : D(P1; : : : ; Pk ) = (!; P_1; : : : ; P_k j!; P_1; : : : ; P_k ) Proposition 2.2 | Polynomial in the squares of distances are polynomial in inner-products: 1 ::: 1 0 2 2 1 0 d ( P ; P ) : : : d ( P ; P ) 1 2 1 k k ( ? 1) 2 1 d ( P ; P ) 0 : : : 1 2 D(P1; : : : ; Pk ) = 2k?1 . .. . .. . . 1 d2(P. ; P ) ::: ::: 0 1 k (v jv ) : : : (v jv ) 2 k 2 2 .. = ... . (v2jvk ) : : : (vk jvk ) 0

i

i

6

0

0

0

i

0

0

0

0

0

i

0

i

0

i

i2

i

0

6

i

i

i2 0

i

0

0

0

i

0

i

COMPUTATIONAL SYMBOLIC GEOMETRY

15

The proof is based on the remarks : (vijvj ) = 21 (d2(P1; Pi ) + d2(P1; Pj ) ? d2(Pi; Pj )) = ?((P_1jP_i ) + (P_1jP_j ) ? (P_ijP_i )) and on operations on rows and columns on the determinant (see (Berger, 1977)). Remark that D(P1; : : : ; Pk ) is just the square of the volume of the simplex P1 ; : : : ; Pk . The de nition of the Cayley-Menger determinant can be generalized : D(P1; : : : ; Pk jQ1; : : : ; Qk ) = (!; P_1; : : : ; P_k j!; Q_ 1; : : : ; Q_ k ) = (v2; : : : ; vk jw2; : : : ; wk ) where vi = P1 ? Pi et wi = Q1 ? Qi . We can transform any polynomial in d2(Pi ; Pj ) in a polynomial (vijvj ). According to this remark, the algebra of square of distances K [d2 (E 3 )] is the algebra generated by the inner-products (vijvj ) . It shares the same properties of Algebra with the same type of Straightening laws, as in proposition (2.1) but on a space of dimension one less (with k  4). This can be used directly to deal with the invariants of the Euclidean group of A 3 (see (Dalbec, 1992)). 2.2. GEOMETRIC PROPERTIES

1. Let S; S 0 2 S be two spheres, S is orthogonal to S 0 i (S_ jS_ 0 ) = 0. Spheres are orthogonal i their radius in the intersection points are orthogonal, or using Pythagore theorem i R2 + R02 ? (OO0jOO0) = 0 (= 2 (S_ jS_ 0 )). (In reality, that means that the notion of orthogonality in the space of spheres is the same as the one used usually in an Euclidean space). In particular, we have (S_ jS_ ) = R2 . 2. For all sphere S 2 S , and for all point P 2 A 3 , P 2 S i (P_ jS_ ) = 0. Remark that (P_ jS_ ) = 21 (R2 + 0 ? (OP jOP )). It is the equation of all the points at distance R from O, that is the sphere S . 3. The set of all spheres orthogonal to a given one S 2 S is an hyperplane , which is the polar hyperplane of the sphere S with respect to Q. If S is represented by (u0 : : : : : u4) in P4, the equation of the hyperplane  is u1x + u2y + u3z ? 21 (u0w + u4t). The set of intersection points between  and the quadric Q is the set of spheres-points orthogonal to S , that is the points of the sphere S . 4. The set of all spheres passing through a point P 2 A 3 is the set of all spheres orthogonal to the sphere-point P_ . So it is an hyperplane , and as P_ 2 Q it is the tangent hyperplane to Q at P . 5. A pencil of spheres, that is the set of linear combination of two spheres S1 ; S2, transforms into a line passing through the two points S_1; S_2 in P4. This line intersects the quadric in two points which are the base-points of the pencil. _ C; _ D; _ E_ j = 0. 6. 5 points A; B; C; D; E 2 A 3 belong to the same element S 2 S , i jA;_ B; 4 where j : : : j is the usual determinant in P ). The points belong to the same sphere i the system in S : (A_ jS ) =    = (E_ jS ) = 0 has a unique solution in P4, which is equivalent to jA;_ : : : ; E_ j = 0. Remark that : (A;_ : : : ; E_ jA;_ : : : ; E_ ) = jA;_ : : : ; E_ jdet(Q)jA;_ : : : ; E_ j = ?jA;_ : : : ; E_ j2 so A; B; : : : ; E belong to the element in S i (A;_ : : : ; E_ jA;_ : : : ; E_ ) = 0. 7. The mediator plane P of A, B is A_ ? B_ . Points belonging to P are such that d(A; x)2 = d(B; x)2, so (A_ jx_ ) ? (B_ jx_ ) = 0 and (A_ ? B_ jx_ ) = 0. _ C; _ D; _ !j = 0. The points A; : : : ; D 8. 8A; B; C; D 2 A 3 , these 4 points are coplanar i jA;_ B; are coplanar i there exists S 2 P4 with coordinates (0 : u1 : u2 : u3 : u4) such that (A_ jS ) =    = (D_ jS ) = 0 or if there exists S 2 P4 such that (!; S ) = (A_ jS ) =    = (D_ jS ) = 0, that _ C; _ D; _ !j = 0. is i jA;_ B; 9. Let S be a sphere of center O = ( ; ; ), radius R, then S_ = O_ ? R2 !

16

B. MOURRAIN, N. STOLFI

The coordinates of S are such that (1; ; ; ; ?R2 + 2 + 2 + 2 ) = (1; ; ; ; 2 + 2 + 2 ) + (0; 0; 0; 0; ?R2 ) = O_ ? R2 ! 10. Let A; B; C; D be 4 non-coplanar points of A 3 . Then the radius R of the sphere passing through these 4 points is given by : _ ; D_ jA;_ : : : ; D_ ) R2 = ? 41 (A; :D: :(A; : : : ; D) The quadratic form is invariant by translations in P3, so let's suppose that the center of the sphere is the origin of the frame. Let S be the sphere passing through the points A = ( 1; 1; 1 ), : : : D = ( 4; 4 ; 4 ), with radius R. 1 : : : 1 1 4 0 1 _ _ 4 0 jA; : : : ; D; S j = 1 1

4 0 R2 : : : R2 ?R2 0 1 : : : 4 1 : : : 1 1 B 1 4 C 4 ? 1 C = R2 B @ 1 4 A

4 1 1 : : : 1 1 : : : 4 : : : 4 1 4 2 1 = 2 R2 jA; : : : ; Dj = 2R

1 4 1 ::: 1 Thus, we show that : _ S jA;_ : : : ; D; _ S) (A;_ : : : ; D; = (A;_ : : : ; D_ jA;_ : : : ; D_ )(S jS ) for (S jA_ ) =    = (S jD_ ) = 0 _ S j2 = ?4 R4 jA; : : : ; Dj2 = R2 (A;_ : : : ; D_ jA;_ : : : ; D_ ) = ?jA;_ : : : ; D; which yields the previous relation. 11. Let A; B; C; D 2 A 3 be 4 non-coplanar points, S be the sphere passing through these 4 points _ S 0 j = 0. (with radius 6= 0), and S 0 be another sphere. Then S is orthogonal to S 0 i jA;_ : : : ; D; _ S jA;_ : : : ; D; _ S 0 ) = (A;_ : : : ; D_ jA;_ : : : ; D_ ) (S jS 0 ) (A;_ : : : ; D; _ S j jA;_ : : : ; D; _ S0j = ?jA;_ : : : ; D; _ S j 6= 0 according to the According to the hypotheses (A;_ : : : ; D_ jA;_ : : : ; D_ ) 6= 0 and jA;_ : : : ; D; 0 0 _ _ previous property. Thus (S jS ) = 0 i jA; : : : ; D; S j = 0. In R the rst condition \A; B; C; D non-coplanar" is sucient. This means that in some way S is A ^ B ^ C ^ D in ^S . 12. Let A; B; C; D 2 A 3 (resp. A0 ; B 0; C 0 ; D0 2 A 3 ) be non-coplanar points and S (resp S 0 ) the sphere passing through these 4 points. Then S is orthogonal to S 0 i (A;_ : : : ; D_ jA_ 0 ; : : : ; D_ 0) = 0:

COMPUTATIONAL SYMBOLIC GEOMETRY

17

Let S 00 2 S be another sphere. _ S 0 jA_ 0 ; : : : ; D_ 0; S 00 ) = ?jA;_ : : : ; D; _ S 0 j jA_ 0; : : : ; D_ 0; S 00 j (A;_ : : : ; D; = (A;_ : : : ; D_ jA_ 0 ; : : : ; D_ 0) (S 0jS 00 ) Choose S 00 such that (S 0 jS 00) 6= 0 or jA_ 0 ; : : : ; D_ 0; S 00 j 6= 0. Then we get the following equivalences : _ S 0 j = 0 , (A;_ : : : ; D_ jA_ 0; : : : ; D_ 0 ) = 0 (S jS 0 ) = 0 , jA;_ : : : ; D; For other examples of the use of distances, see (Havel, 1991). 2.3. THE BLOWING-UP OF

Let be the umbilic (or imaginary circle) of P3 de ned by = V (x2 + y2 + z 2 = t = 0). When dealing with constrains of distances on a point (eg. spheres, torus : : : ), the resulting equations often have for their leading term a power of x2 + y2 + z 2. It implies that when t = 0 we also have x2 + y2 + z 2 = 0 or in other words that the surfaces of P3 de ned by these equations contain the umbilic with some \multiplicity". Thus the intersection of 3 surfaces of this type is generally (or generically) the union of and a nite number of points in the ane part A 3 . As usually, we are interested in the ane part and we would like to have intersection formulas which bound this number of points when we know the degree and the multiplicity of for each surface. The natural way to do that is to use Bezout's theorem and to subtract the exceeding components. In our case, the intersection is not proper (the intersection of 3 surfaces is of dimension 1) and we need to transform it in a situation where it becomes proper. So let's introduce what is called the blowing-up of , which role is to throw away the redundant part. It consists to add as new information the \slope" of a line from any point to a point of the redundant part and to take the \graph" of this application (see (Hartshorne, 1977)[p 160-170]). As the umbilic is a complete intersection de ned by two equations x2 + y2 + z 2 = t = 0, its blow-up on an open subset U of P3 is the subset of U  P1 such that (x2 + y2 + z 2)jU T0 ? tjU T1 = 0, where (T0 : T1 ) are the coordinates in P1 (see (Fulton, 1984)[p. 437]). On the open subset T0 6= 0 of P1 and after a suitable change of coordinates, this blow-up can be de ned as a subset in P4 of Q = V (u21 + u22 + u23 ? u0 u4 = 0) , already seen in (2). Let Y be the blow-up of P3 along . Then we have a projection  from Y onto P3 ((u0 :    : u4) 7! (u0 :    : u3) with the previous notations). According to (Hartshorne, 1977)[p. 164], this projection is one-to-one on P3n . But ?1( ) is a surface, which is called the exceptional divisor and denoted by E . E ! Y

#

#

! P3 Let's consider three surfaces s1 ; s2 ; s3 of degree di , containing with multiplicity ci (valuation around a generic point of on si ). Their inverse image (si)1 can be decomposed in the surface E with multiplicity ci and a surface s~1 = ?1(si n ) (called the strict transform of si ). We want to know how many points there are in common outside or equivalently the intersection number of the strict transforms. We use here a generalization of Bezout's theorem, called the Chow Ring which associates to a variety a class and where the product of classes describes generically intersection (see (Fulton, 1984), (Hartshorne, 1977)). The coecients in this ring are integers which represent the multiplicities. The Chow ring of P3 is for instance Z[h]=(h4) (see (Hartshorne, 1977)). 1 Here  ?1 =  

18

B. MOURRAIN, N. STOLFI

So we want to compute (s~1:s~2:s~3 ) in the Chow ring associated to the blow-up of : As we have (si ) = s~i + ci E , (s~1:s~2 :s~3) = (((s1) ? c1 E ):(s2 ? c2 :E ):(s3 ? c3 E )) = (s1 :s2:s3 ) ?c1 (E:s2 :s3 ) ? c2(E:s1:s3 ) ? c3(E:s1 :s2 ) +c1 c2(E:E:s3) + c1 c3(E:E:s2) + c2 c3 (E:E:s1 ) ?c1 c2c3 (E:E:E ) The class of si in the Chow ring is di h where h is the class of a generic plane of P3. Let's denote by H = (h) the inverse image of h. So by linearity of the intersection product, it is enough to compute (H:H:H ), (E:H:H ), (E:E:H ) et (E:E:E ). As the umbilic is de ned by the intersection of plane H and a quadric Q which contains with multiplicity 1, their strict transforms do not have common point (no common tangents) and we have ~ Q~ = (H ? E ):(2 H ? E ) = 0 H: This yields the relation E:E = 3H:E ? 2H:H (5) that we can use here: (E:E:H ) = 3(H:H:E ) ? 2(H:H:H ) = ?2 (E:E:E ) = 3(H:E:E ) ? 2(H:H:E ) = ?6 Using the projection formula (see (Hartshorne, 1977)[p. 426]) we obtain (E:si :sj ) = (E:(si :sj )) = (E ):si:sj = 0 As E projects onto a space of lower dimension, using the projection formula we have (H:H:E ) = ((h:h):E ) = h:h:(E ) = 0 (see (Hartshorne, 1977)[p. 426]). As the intersection of 3 generic planes is one point, we have (H:H:H ) = 1. Thus we have proved: Theorem 2.3 | Let s1; s2 ; s3 be three surfaces of degree di , containing with multiplicity ci and intersecting in the ane part in N points (counted with multiplicity), then N  d1d2d3 ? 2 (c1 c2d3 + c1c3 d2 + c2c3 d1) + 6 c1 c2 c3 This theorem can also be proved by algebra on the equations and analysis of the valuation around points of (see (Mourrain, 1994a)). I would like to thank M. Merle and C. Walter, for helpful discussion on Chow ring and Blow-up. Here are some other applications of this result: Proposition 2.4 (Cayley's theorem) | Let's consider a segment (P1; P2) of xed length such that Pi is on a (smooth) curve of degree di containing ci points on . Then the line (P1; P2 ) describes a variety (in the Grassmannian of lines) of dimension 1 and degree 4 d1 d2 ? 2 c1 d2 ? 2 d1 c2. Proof. Let's consider in P3  P3 the blow-up Y1  Y2 of the two umbilics 1; 2 and its Chow ring. The two exceptional divisors are denoted by E1; E2 and the classes of a plane in each component are H1; H2 . The class of the variety f(P1; P2); Pi 2 Ci g is by de nition di Hi2 ? ci Hi Ei. The constrain of distance (P1jP1) ? 2 (P1jP2) + (P1jP2) ? cst = 0 de nes a variety of Y1  Y2 of class 2 H1 + 2 H2 ? E1 ? E2, for it is of degree 2 in each point and contains each umbilic with multiplicity 1 (homogenization with respect to Pi and substitution ti = 0 yields (PijPi ) = 0). Q 2 Expend now the product i=1(di Hi2 ? ci Hi Ei) (2 H1 + 2 H2 ? E1 ? E2 ) and use the rules (5) for each component to obtain the previous formula. 2

19

COMPUTATIONAL SYMBOLIC GEOMETRY

Proposition 2.5 | Let's consider a triangle (P ; P ; P ) of xed shape such that Pi is on a (smooth) curve of degree di containing ci points on . Then there are at most 16 ( d d d ? d d c ? d d c ? d c d + d c c + d c c + d c c ? c c c ) positions of this triangle. Same method but in P  P  P . 1

2

3

1

1

2

3

2

3

1

1

2

3

3

1

3

2

3

3

1

2

2

1

3

2

3

2

3

1

3

2.4. APPLICATIONS

Here are some examples of the use of geometry of distances. 2.4.1. The theorem of Simson in this context We are working here in the space of circles which has the same properties as the space of spheres but with one dimension less. D

A

C

C G

E

B

D

F ω

A

B

E

G

F

In the ane plane In the space of circles Assume we have 4 points A; B; C; D on a circle and let E; F; G be the projection of D on the 3 sides of the triangle A; B; C . Then Simson's Theorem says that E; F; G are collinear. Let's translate it in the space of circles. As A; B; C; D are on a same circle, the circle-points _ E_ are on a A;_ : : : ; D_ are on a same plane. In the same way, \E 2 (A; B )" means that !; A;_ B; _ _ _ _ same plane. As E and F are orthogonal projections, we also have D; C; F; G on a same plane. And so on. So we have 8 circle-points, constituting a \cube" (see above gure) for which 5 faces _ F; _ G_ ) is also in a plane. are plane and we want to prove that the last face (!; E; Let's consider the four quadrics Q1 = A;B;E;!  C;D;F;G, Q2 = A;C;G;!  B;D;E;F , Q3 = A;B;C;D  E;F;G and Q0 the quadric of points-circles. We want to prove that Q3(!) = 0. The space of quadrics of P3 is of dimension (3+2 2 ) = 10. These quadrics contain 7 \independent" points so that 0 Q0 + 1 Q1 + 2 Q2 + 3 Q3 = 0 As Q0(!) = Q1(!) = Q2(!) = 0 et 3 6= 0 (else any circle of Q1 \ Q2 would be in Q0), we also have Q3(!) = 0. The same proof applies to Miquel's theorem and its variants. 2.4.2. Curvature and torsion of a curve We consider now the situation where a geometric object is described as a polygon, by approximation. Distances between edges of this approximation are then easy to obtain but we would like to know curvature and torsion. For a curve C at a regular point p, ? the curvature is s lim 2 2 D(p ; p D) D(p(1p; p;2p; p)3D) (p ; p ) p1 ;p2 ;p3 !p;pi2C 1 2 2 3 1 3

20

B. MOURRAIN, N. STOLFI

? the torsion is lim p ;p ;p ;p !p;p 2C 1 2 3 4

i

v u u = 3t 2

(see (Blumenthal, 1970)).

D(p1; p2; p3; p4) (i1 ;i2 ;i3 D(pi1 ; pi2 ; pi3 )) 21

3. The space of displacements In this section, we will discuss algebraic properties of the set of displacements, beginning with some recalls on their representations. A displacement D is usually represented in a referential by a 3  3 matrix of rotation R and a translation T . The matrix R satis es the following properties: R Rt = Rt R = Id3; det(R) = 1. If we know the axis of rotation and the angle, we can reconstruct R with Rodriguez representation: R = (1 ? cos())u u + cos() Id + sin() tu where  is the angle of rotation, u = (u1; u2; u3) the unit vector along the axis, u u is given by the matrix [ui uj ]1i;j 3 and tu (x) = u ^ x. Using the formula of double vector products v  (v  x) = (vjx) v ? x we can transform this expression in R = 1 +1  tv  tv + Id + tv (where  = cos() and v = sin() u) which is the Cayley representation of rotations. With these notations we have 2 + (vjv) = 1. Taking a = cos( 2 ) and (b; c; d) = sin( 2 )u = 21a v, we obtain after homogenization a matrix of the form 1 0 a2 + b2 ? c2 ? d2 2 b c ? 2 d a 2 b d + 2 c a R = a2 + b2 +1 c2 + d2  @ 2 b c + 2 d a a2 ? b2 + c2 ? d2 2cd ? 2ab A 2 2bd ? 2ca 2ab + 2cd a ? b2 ? c2 + d 2 which corresponds to the representation of R by quaternions. To a unitary quaternion q = pa2 +b21+c2 +d2 (a + i b + c j + d k) is associated the map x 7! q x q?1 which restriction on hi; j; ki has the previous matrix. Other representations decomposing R in a product of rotations around the axes are also classically used. Here is Euler representation: 0 cos( ) ? sin( ) 0 1 0 1 0 0 1 0 cos() ? sin() 0 1 R = @ sin( ) cos( ) 0 A @ 0 cos() ? sin() A @ sin() cos() 0 A 0 0 1 0 sin() cos() 0 0 1 (rotation in z , x and z ) or Bryant representation: 0 cos(x ) ? sin(x ) 0 1 0 cos(y ) 0 ? sin(y ) 1 0 cos(z ) ? sin(z ) 0 1 A @ sin(z ) cos(z ) 0 A 1 0 R = @ sin(x ) cos(x) 0 A @ 0 y y 0 0 1 sin( ) 0 cos( ) 0 0 1 (rotation in z , y and x). 3.1. QUATERNIONS AND DUAL QUATERNIONS

In this section we describe a representation of the displacements which is well-suited for symbolic manipulations. This representation uses Cli ord Algebras, which, as we will, see are \deformations" of exterior algebras.

COMPUTATIONAL SYMBOLIC GEOMETRY

21

3.1.1. Cli ord algebra Let ^E be the exterior algebra on the n-dimensional vector space E . De nition 3.1 | The Cli ord algebra of E associated to a quadratic form Q is the quotient of the tensor algebra T (E ) by the two-sided ideal generated by the relations x x ? Q(x) = 0 for x 2 E . We will denote it by C (E ; Q) or C (E ). Remark that the previous relation shows that for all x; y 2 E , x y + y x = 2Q(x; y) where (x; y) 7! Q(x; y) = (xjy) is the symmetric bilinear form associated to Q. Denote by C + (E ) (resp. C ? (E )) the sub-space of C (E ) obtained as the quotient of T + (E ) = p T 2 p (E ) (resp. T ? (E ) = p T 2 p+1(E )) by the same relation as before. It can be shown that if (e1 ; : : : ; en ) is a basis of E , then C (E ) is an algebra of dimension 2n of basis (1; ei1 : : : eik ; 1  i1 <    < ik  n). Moreover if (e1; : : : ; en) is an orthogonal basis for Q, then ^(E ) ! C (E ) ei1 ^ : : : ^ eik 7! ei1 : : : eik is an isomorphism independent of the chosen basis (ei ) of E . See (Lang, 1980), (Crumeyrolle, 1990). Now we will identify C (E ) and ^E extended by a new operator of multiplication. For all elements x; y 2 E , the Cli ord product is : x y = x^y +(xjy). ItPis neither commutative, nor anticommutative. Any element A in C (E ) can be written as : A = nk=0 hA k where hA k is an extensor of length k. Here are the classical rules for computation in C (E ) : 1. Ar ^ Bs = (?1)rs BP s ^ Ar 2. (xjx1 ^    ^ xr ) = rk=1(?1)k+1 (xjxk )x1 ^    ^ xk?1 ^ xk+1 ^    ^ xr 3. (x1 ^    ^ xr jy1 ^    ^ ys) = (x1 ^    ^ xr?1j(xr jy1 ^    ^ ys)) 4. (Ar jBs) = (?1)r(s?r) (BsjAr ); s  r 5. xAr = (xjAr ) + x ^ Ar (see (Hestenes and Sobczyk, 1984), (Hestenes and Ziegler, 1991)) 3.1.2. Cli ord Group and Twisted Cli ord Group Let C (E ) be the multiplicative group of invertible elements of C (E ). For all g 2 C (E ) , we construct the following map : g : C (E ) ! C (E ) x 7! (?1)ng x~~g?1 where the operator~is the Hodge operator de ned previously. We denote by G the sub-group of C (E ) of elements g such that g (x) 2 E ; 8x 2 E and G+ = G \ C + (E ). Using properties of the Cli ord product like (Ar jBr ) = hAr Br i0 (where hi0 means the part of the extensor of length 0), and (A~jA~) = (AjA), we nd that : (gx~g?1jgx~g?1) = hgx~g?1gx~g?1i0 = hgx~x~g?1i0 = (gx~jx~g?1) = (~xg?1jgx~) = hx~g?1gx~i0 = (~xjx~) which proves that g is an isometry. Another computation shows that for g 2 G\E and Q(g) 6= 0 : (?1)ngx~g?1 = (?1)ngx~ Qg(g) n = (Q?(1)g) (2g ^ x~ + (?1)nx~g)g = x~ + (?1)n Q(2g) (g ^ x~)g

22

B. MOURRAIN, N. STOLFI

Thus :

g (x)

= = = =

x + (?1)n Q2(g) (gjx)e1~: : : eng x + (?1)n Q(2g) (gjx)(?1)n?1(gje1 ~: : : en ) x + (?1)n Q(2g) (gjx)(?1)n?1Pnk=1(~gjek )e~k x ? 2 (Qg(jxg)) g

so we found that g (x) = x ? 2 (Qg(jxg)) g. This application g is the symmetry relative to g?. As any isometry is a composition of symmetries, we are going to use this application to describe isometries. 3.1.3. Quaternions Let's consider the case E = E 3 = K 3 and Q(a; b; c) = a2 + b2 + c2 . Denote by (e1 ; e2; e3) the orthogonal basis of E 3 . A basis of C (E 3 ) is (1; e1; e2 ; e3; e1 e2; e1e3 ; e2e3 ; e1e2 e3). With the previous de nition, we found that G+ = G \ C + (E 3 ) = h1; e1 e2; e1 e3; e2e3 i. Let's de ne i = e2 e3, j = e1 e3, k = e1 e2. We found that ~i = e1 ; ~j = ?e2; k~ = e3. These elements are such that :

i j = ?j i = k; i k = ?k i = j; j k = ?k j = i; i = j = k = ?1 This is the well known quaternions algebra H. Using this embedding E ,! H; (x; y; z ) 7! xi + yj + z k, we can describe isometries in E by elements in H, with the previous application g . ? rotation angle and axis s = (sx ; sy ; sz ) 2 E with ksk = 1 : 2

2

2

3

3

q = cos( 2 ) + sx sin( 2 )i + sy sin( 2 )j + sz sin( 2 )k = c0 + c1i + c2j + c3 k

The vector X 2 E 3 is identi ed to the quaternion X = x i + y j + z k 2 H. The image of X by the rotation is X 0 = q (X ) where q?1 = c0 ? c1i ? c2j ? c3k ? uv is the rotation axis u ^ v and angle such that = 2 cos k(uu^jvv)k , for uv = (ujv)+ u ^ v = (ujv) + (u ^ v)1i + (u ^ v)2j + (u ^ v)3 k. This corresponds to a decomposition of a rotation in a product of two axial symmetries. 3.1.4. Dual Quaternions Let's consider the case E = E 4 and Q(a; b; c; d) = a2 + b2 + c2 . Remark that Q is a degenerated quadratic form. Let (e0; : : : ; e3) be the canonic basis of E . The sub-algebra C + (E 4 ; Q) is generated by the 8 elements : 1; e0e1 ; e0e2 ; e0e3 ; e1e2 ; e1 e3; e2 e3; e0 e1e2 e3 De ning  = e0e1 e2 e3, a simple computation shows that 2 = 0. As for the quaternions algebra, we de ne: i = e2 e3; j = e3 e1; k = e1 e2. Then, we have:  i = i  = ?e0e1 ;  j = j  = ?e0 e2 ;  k = k  = ?e0 e3 Let's de ne H = h1; i; j; ki, and H = h; e0e1 ; e0e2 ; e0e3i, then C + (E 4 ; Q) = H + H.

? Rotations:

The image of x 2 E 4 by the rotation axis u = (u1; u2; u3) such that kqk = 1 and angle  is the point x0 = q (x) where

? Translations:

q = cos( 2 ) + u1sin( 2 )i + u2sin( 2 )j + u3sin( 2 )k

The image of x 2 E 4 by the translation of vector v = (v1; v2 ; v3 ) is q (x) where q = 1+ 21 e0 v.

COMPUTATIONAL SYMBOLIC GEOMETRY

23

For instance, the translation of vector e1 : q = 1 + 21 e0e1 and q?1 = 1 ? 12 e0e1 . (1 + 21 e0 e1)~ei (1 ? 12 e0e1 ) = e~i ; i = 1; 2; 3 (1 + 21 e0e1 )e~0(1 ? 12 e0 e1) = e~0 + e~1 So for x = e0 + x1e1 + x2e2 + x3e3, we get g (x) = e0 + (x1 + 1)e1 + x2e2 + x3e3 So we can identify the space of displacements with H + H. 3.1.5. Space of spheres and Cli ord algebra Let's recall that is S the space of spheres in which the sphere of equation u0(x2 + y2 + z 2) ? 2u1 x ? 2u2 y ? 2u3z + u4 = 0 represents the point of coordinates (u0 : u1 : u2 : u3 : u4) in P4. We construct the Cli ord algebra on C (E 5 ; Q) with the quadratic form : Q(x) = u21 + u22 + u23 ? u0u4 de ning the set of spheres-points in S . The canonic basis of E 5 is (e0; : : : ; e4). ? In the hyperplane H : (u4 = 0), the quadratic form is Q(u0; u1; u2; u3) = u21 + u22 + u23. It is degenerate. Identifying H with E 4 , we recover the dual quaternions. Therefore, with the same notations as before, we know that we can describe the isometries of O(E ) with applications g with g belonging to H + H. ? We would like to extend this to the whole space of spheres. What does the application g represent on a point S_ associated to a sphere with g 2 H + H ? Consider S_ 2 S . It can be written S_ = O_ ? R2 !, where O_ is the sphere-point associated to the center O of the sphere, and R the radius of this sphere. g (S_ ) = g (O_ ) ? R2 g (!) Let's compute g (!) : for all g 2 H +  H, we have g!~ = !~ g (for !~ = e4), so g!~ g?1 = !~ . Besides, g (O_ ) = g (_O). The center O_ is the intersection point of the line (!; O) and the quadric Q. So using linearity, g (O_ ) 2 ( g (!); g (O)) \ g (Q), then g (O_ ) 2 (!; g (O)) \ Q (for g is an isometry, g (Q) = Q). So that g (O_ ) = g (_O). See also (Dress and Havel, 1991). 3.2. OUR REPRESENTATION OF DISPLACEMENTS

We return now to the representation of displacement of the form D = [R; T ] where R Rt = Rt R = Id3; det(R) = 1. As we will see, the quantities  = (T jT ); ui = (RijT ) (6) appear naturally in applications. Other variables which also appear easily are wi;j = (i; j jk; 4) = (Rk  T )l (7) (with fi; j; lg = f1; 2; 3g). Thus let  be the set of variables fri;j ; ; ui; wi;j g and consider the representation of K [D], the set of algebraic functions on the displacements: 0 ! I ! K [] ! K [D] ! 0 where I is the ideal generated the relations on R = [ri;j ] and the equations (6), (7). The role of these variables is to \blow-up" a common degenerate part of the varieties we will encounter, just like the umbilic for the spheres. Let's also denote by (ijj ) = ri;j ; (ij4) = ti (with 1  i; j  3).

24

B. MOURRAIN, N. STOLFI

Lemma 3.1 | The ideal I is generated by the relations: 1. (RijRj ) = i;j , (Ri jT ) = ui for 1  i; j  3. 2. (Ri jRj ) = i;j , (Ri jU ) = ti for 1  i; j  3. 3. (T jT ) ?  = 0, (U jU0) ?  = 0, 4. (i; j ji0; j 0 ) = (?1)k k (kjk0) with fi; j; kg = fi0; j 0 ; k0g = f1; 2; 3g, , 5. wi;j = ?wj;i 6. wi;l (j jm) ? wj;l (ijm) = um(kjl) ? l;m(kj4) where fi; j; kg = f1; 2; 3g and 1  m  4, 7. wi;l uj ? w j;l ui = ?tm(kjl) + l;muk where fi; j; kg = f1; 2; 3g, k;l uk rj;k 8. wi;k wj;l = ul  tj , with 1  i; j; k; i0; j 0 ; k0  3. ri;l ti i;j +

Using these relations, we can exhibit a structure of algebra with straightening laws for the partial order  de ned by the following Hasse diagram (the greatest variable being above): j

? @ j @ j ? @ ? @ j j @ j @@ j? C@@ j? CC ? ? @ @ C j C j C CC C@C@ j?C C C C C C CC CC CC; jCC; CC C CC ?C @CC C C CC ?CC ; @@j ;CC ? ;@@j ; ; j ;C ; j; ; j; @@C ?; j ; @ ?;?j ; @@u3 @@ ?; j ; @@u2?? @ u1?? ?  (3 4)

(3 3)

? j @@

(3 1)

(3 2)

(2 4)

(2 3)

(2 2)

(2 1)

(1 4)

(1 3)

(1 2)

(1 1)

(2 3 3 4)

(2 3 2 4)

(2 3 1 4)

(1 3 3 4)

(1 3 2 4) (1 2 3 4)

(1 3 1 4) (1 2 2 4) (1 2 1 4)

We can prove that a basis S of the quotient k[D] consists of a subset of the standard monomials for this partial order. The veri cation by a powerful computer algebra system that the relations of lemma (3.1) are a Grobner basis of I for a good order, is given as exercise. This lemma leads to the following results: Theorem 3.2 | The multiplicity of k[D] = k[]=I is 40. (see (Mourrain, 1994a) for details). In other words, quotienting this representation by 6 generic linear forms yields 40 solutions counted with mutiplicity. 3.3. APPLICATIONS

3.3.1. The direct kinematic of a parallel robot Let's consider a platform attached to the ground by six extensible bars. Changing the length of the bars entails a little displacement of the platform so that this mechanism is well-suited for doing precise movements of adjustment. Moreover, small forces on the bars are needed, compared with a serial robot for an equivalent force on the platform. This is the reason why this parallel

COMPUTATIONAL SYMBOLIC GEOMETRY

25

robot (also called Stewart Platform or left-hand) is used as ying simulator or hand of a serial robot. But this type of con guration exists in many other mechanisms.

Figure 2. A general parallel robot

The direct kinematic problem of this robot can be summarized as followed. Let Xi be the end points of the bars on the ground and Zi = R Yi + T be the points attached to the platform, which is moved by a displacement D = [R; T ]. The problem is to nd D for given lengths of the bars d(Xi; Zi )2 = i . So we have the equations (R:Yi + T ? Xi jR:Yi + T ? Xi ) = i or

(T jT ) + 2 (YijU ) ? 2 (Xi jT ) ? 2 (R:Yi jXi) ? i + (YijYi ) + (XijXi ) = 0 for 1  i  6. This system is linear in the variables of K [D]. It has at most 40 solutions (over K ). We have solved the system for a special con guration. It has 40 distinct solutions (see (Mourrain, 1994a)). 3.3.2. Reconstruction with a calibrated camera Here is a classical problem of reconstruction in Vision. Given N points Pi in E 3 , we know their images on two cameras pi = (xi; yi; 1) (resp. p0i = (x0i; yi0 ; 1)) and we want to determine the displacements D = (R; T ) of the second frame camera relatively to the rst one. P

p’

O’

p

e’ e

O

Figure 3. Reconstruction from points

Let O; O0 be the centers of projection of the cameras and pi (resp. p0i) the projection of the point Pi on the rst (resp. second) retina plan. As the vectors OO0 = T; OPi =  pi ; O0Pi = 0 p0i are

26

B. MOURRAIN, N. STOLFI

in a same plane, we must have

jpi; T; R p0i + T j = pti T ^ R p0i = 0 These equations are linear in the coordinates wi;j of Ri^T . The matrix (wi;j ) is an essential matrix. To x the scaling degree of freedom, we add: (T jT ) ? 1 = 0 or  ? 1 = 0 Here again, for N = 5, we have 6 linear equations in the variables of K [D] and 40 solutions, regrouped by 4 : (R; T ); (R; ?T ); (T R; T ); (T R; ?T ) (T is the symmetry around T ). These groups correspond to at most 10 possible reconstructions. (see (Demazure, 1988), (Faugeras and Maybank, 1990) for other approaches).

4. The matrices and their invariants We want to compute with matrices, forgetting their coecients. 4.1. REPRESENTATIONS

We represent them by variables X = fX1 ; X2 ; : : :g and work in khX i, the non-commutative associative free algebra generated by X. The coecients will be the invariants of Gln(E ) by conjugation (see (Procesi, 1976)), that is the space of traces T (X ): Tr(X1 X2 X3 ) Tr(X1 )    with cyclic permutation inside the traces: T (X1 X2 X3) T (X4 X5 ) = T (X5 X4 ) T (X3 X1 X2 ). So we manipulate polynomials of K hXi T (X) and we take the representation: 0 ! In ! khXi T (X) ! k[uki;j ]nn Xk 7! Uk = [uki;j ]1i;j n

(8)

which replaces Xi by a generic matrix Ui . If we want to compute with this representation, we need to know explicitly when an element is in the kernel. We have for instance, for 2  2 matrices:

X12 ? T (X1 )X1 + 21 (T (X1)2 ? T (X12 )) I  0 which is the Cayley-Hamilton identity.

Theorem 4.1 | Any identity of matrices can be reduced to zero by the Cayley-Hamilton identity.

(see (Mourrain, 1992)). Here is the algorithm:

27

COMPUTATIONAL SYMBOLIC GEOMETRY

Input Output

: A polynomial

P

: Its normal form

hX i T (X). for matrices n  n,

of K

(1) Polarize the polynomial (replacing (2) Multiply par a new variable

X0

X1

by

which is

X1 + X2

0

iff

P 2 I.

and simplifying);

and take the trace

(3) Transform it in combination of permutations, (4) Reduce it by terms of the form

(P2Sn+1 () )

as soon as the "leading" permutation as a height larger than (5) Transform the complete reduction in a polynomial in

X

n + 1.

by the inverse operations of the step (3), (2), (1).

Example:

1. P := X1X2 T (X3 X4) ? X2X1 X3T (X4 ) + X1X3 X2X4 +    and take n = 2. 2. T (X0 P ) := T (X0 X1 X2)T (X3 X4) ? T (X0 X2X1 X3)T (X4 ) + T (X0 X1 X3X2 X4) +    3. s = (0; 1; 2) (3; 4) + (0; 2; 1; 3)(4) + (0; 1; 3; 2; 4) 4. The rst term (0 1; 2) (3; 4) is the map (0; : : : ; 4) 7! (1; 2; 0; 4; 3) and has a height (length of the longest increasing sequence in the image) larger than 3. So it can be reduced by a term of P the form ( 2S3 () ) (corresponding to an identity derived from the Cayley-Hamilton identity). 5. iterate this reduction. Some experimentations done in Le Lisp: Let's show that p1 = [x1; [x2; x3]2] is an identity for 2  2 matrices : + x1 x2 x3 x2 x3 + x1 x3 x2 x3 x2 - x1 x2 x3 x3 x2 - x1 x3 x2 x2 x3 - x2 x3 x2 x3 x1 - x3 x2 x3 x2 x1 + x2 x3 x3 x2 x1 + x3 x2 x2 x3 x1 > (:dim 2) > (:norm p2) ()

P

In the same way p3 = 2S4 X(1)X(2) X(3) X(4) is an identity : + x1 x2 + x2 x3 + x1 x4 + x1 x3 + x3 x4 + x2 x4 > (:norm p3) ()

x3 x1 x2 x4 x1 x3

x4 x4 x3 x2 x2 x1

-

x2 x3 x4 x3 x4 x4

x1 x2 x1 x1 x3 x2

x3 x1 x2 x4 x1 x3

x4 x4 x3 x2 x2 x1

-

x1 x1 x2 x1 x2 x3

x3 x2 x4 x4 x3 x4

x2 x4 x1 x3 x4 x2

x4 x3 x3 x2 x1 x1

+ + + + + +

x3 x2 x4 x4 x3 x4

x1 x1 x2 x1 x2 x3

x2 x4 x1 x3 x4 x2

x4 x3 x3 x2 x1 x1

It's not an identity for 3  3 matrices : > (:dim 3) > (:norm p3) -2 x4 x3 x1 x2 -2 x4 x2 x3 x1 -2 x4 x1 x2 x3 - x3 x4 x2 x1 + x3 x4 x1 x2 + x3 x2 x4 x1 -2 x3 x2 x1 x4 ... + x4 x3 x2 Tr(x1) + x4 x3 x1 Tr(x2) + .... + x4 x3 Tr(x1 x2) - x4 x3 Tr(x2) Tr(x1) + ... +2 x4 Tr(x1 x3 x2) + 2 x4 Tr(x1 x2 x3) + ...

28

B. MOURRAIN, N. STOLFI

4.2. APPLICATION TO THE IDENTITIES OF QUATERNIONS

Let H = R + R i + R j + R k be the skew eld of quaternions. It contains the complex eld C of elements of the form a + i b and any quaternion q = a + i b + j c + k d can be decomposed in q =  + j  with  = a + i b;  = c ? i d in C . So that H is a free C -module of rank 2 and the left-multiplication by q =  +  j is given by the matrix :

  ?  (q) =  

(9)

In other words, we can identify the quaternions with the algebra of 2  2 matrices of form (9). Remark that: ? the trace of (q) is two times the real part R(q) = a of q, ? the determinant of (q) is the square of the norm kqk2 =   +   of q. Thus we can check the following identity (Hamilton-Cayley identity): q2 ? 21 R(q) q + kqk2 = 0. Based on the following proposition and on the computable identities of matrices 2  2, we can in fact use this representation of quaternions to compute in the algebra of rotations. Test to zero and normal form computations are possible, for polynomial of rotations, without taking any coordinate system. Theorem 4.2 | The identities between quaternions whose coecients are real parts and square of norms, are those satis ed by matrices 2  2 whose coecients are traces and determinants. Proof. We want to prove that the map  which associates to quaternions qi generic matrices of the form (9) has the same kernel as the map (8) for n = 2 which replaces Xk by [uki;j ]1i;j 2 where the uki;j are variables. Consider a polynomial p(uki;j ) in the image of the map (8). We must prove that it is zero if an only if the corresponding image by  is zero. This image is obtained by replacing (uk1;1; uk1;2; uk2;1; uk2;2) by (k ; ?k ; k ; k ) in p(uki;j ). They are null if and only if they vanish for any complex values of the variables. But for any complex polynomial p(x; y), 8x 2 C ; p(x; x) = 0 is equivalent to p  0 (invertible linear change of variable (x; x) = (a + i b; a ? i b)). Using this remark, we can show by induction that a polynomial is in the kernel of the map (8) if and only if it is in the kernel of  . 2 Using the representation of displacements by dual quaternions (see section (3.1.4)), we can also check identities in the algebra of displacements, by expanding the polynomial in H +  H and compute the normal form on the components H and  H  H.

5. Conclusion As we have seen, geometrical objects such as points, lines, : : : , spheres, displacements can be treated in a symbolic way, by homogeneous methods. These methods consist in choosing variables for intrinsic quantities such as determinants, inner-products, distances, etc and taking into account the relations that exist between these variables. What is remarkable is that reductions to normal forms are based on similar structures of algebras with straightening laws, in which a natural partial order on the variables appears. Developping ecient algorithms of normalization in these cases, involves close connections between combinatorics, algebra, and geometry. The usefulness of this approach has been illustrated by several examples. Two great advantages of this approach are a better presentation of the problem and an easier and more synthetic way to conduct calculus. However, the main obstacle for a broadcast of such a technic, is the lack of implementations of these algorithms in specialized and ecient systems. This is one of our goal for future work in this area.

COMPUTATIONAL SYMBOLIC GEOMETRY

References

29

M. Barnabei, A. Brini, and G.C. Rota. On the exterior calculus of invariant theory. J. of Algebra, 96:p 120{160, 1985. M. Berger. Geometrie, volume 5, L'espace des spheres. Cedic/Fernand Nathan, 1977. L.M. Blumenthal. Theory and Applications of Distance Geometry. Chelsea Publishing Company, Bronx, New York, second edition, 1970. N. Bourbaki. Elements de Mathematiques, Algebre, Ch. 3. Hermann, Paris, 1970. C. Carre, A. Lascoux, and B. Leclerc. Turbo-straightening for decomposition into standard bases. Int. J. Alg. Comp., 3[2]:275{290, 1992. A. Crumeyrolle. Orthogonal and Simplectic Cli ord Algebra. Kluwer Academic Plublishers, 1990. J. Dalbec. Straightening euclidean invariants. Preprint, 1992. C. DeConcini, D. Eisenbud, and C. Procesi. Hodge algebras. Asterisque, 91, 1982. M. Demazure. Sur deux problemes de reconstruction. Rapport de Recherche INRIA, 882, 1988. R. Descartes. Discours de la methode et Essais, volume VI of uvres de Descartes. Ed. Tannery, 1596-1650. P. Doubilet, G. C. Rota, and J. Stein. Foundations of Combinatorics IX: Combinatorial methods in Invariant Theory. Studies in Appl. Math., 53:185{216, 1974. A.W.M. Dress and T.F. Havel. Distance geometry and Geometric algebra. Foundations of Physics, 23[10]:1357{ 1374, October 1991. O. Faugeras and S. Maybank. Motion from point matches: Multiplicities of solutions. Int. J. of Computer Vision, 4:225{246, 1990. William Fulton. Intersection theory. Springer-Verlag, 1984. F.D. Grosshans, G.C. Rota, and J.A Stein. Invariant Theory and Superalgebras, volume 69 of Reg. Conf. Series. AMS, 1987. R. Hartshorne. Algebraic Geometry. Springer-Verlag, 1977. T.F. Havel. Some examples of the use of distances as coordinates in Euclidean geometry. Journal of Symbolic Computation, 11[5 & 6]:579{593, May/June 1991. D. Hestenes and G. Sobczyk. Cli ord Algebra to Geometric Calculus, A uni ed Language for Mathematics and Physics. D.Reidel Publishing Company, 1984. D. Hestenes and R. Ziegler. Projective geometry with Cli ord algebra. Acta App. Math., 23:25{63, 1991. W. Hodge and D. Pedoe. Methods of algebraic geometry. Cambridge University Press, 1952. S. Lang. Algebra. Addison-Wesley, 1980. J.P. Merlet. Les robots paralleles. Traites de nouvelles technologiques. Hermes, 1990. B. Mourrain. Approche e ective de la theorie des invariants des groupes classiques. PhD thesis, Ecole Polytechnique, September 1991. B. Mourrain. Geometrie et interpretation generique ; un algorithme. In E ective Methods in Algebraic Geometry (MEGA), volume 94 of Progress in Math., pages 363{377. Birkhauser, 1991. B. Mourrain. Computable identities in the algebra of formal matrices. Theoretical Computer Science, 98:115{133, 1992. B. Mourrain. Enumeration problems in Geometry, Robotics and Vision. In E ective Methods in Algebraic Geometry (MEGA), Progress in Math. Birkhauser, to appear, 1994. B. Mourrain. New aspects of geometrical calculus with invariants. Advances in Mathematics, 1994. to appear. C. Procesi. The invariant theory of n  n matrices. Adv. in Math., 19:306{381, 1976. H. Weyl. The Classical Groups, their invariants and representations. Princeton University Press, 1939.

30

B. MOURRAIN, N. STOLFI

Table of Contents

1 COMPUTATIONAL SYMBOLIC GEOMETRY 1

2

3 4 5

Linear spaces : : : : : : : : : : : : : : : : : : : : : 1.1 The exterior algebra : : : : : : : : : : : : : 1.2 Algebra with straightening laws : : : : : : : 1.3 Operators : : : : : : : : : : : : : : : : : : : 1.4 Application to theorem proving : : : : : : : 1.5 Application to mechanics : : : : : : : : : : The space of spheres : : : : : : : : : : : : : : : : : 2.1 Straightening laws : : : : : : : : : : : : : : 2.2 Geometric properties : : : : : : : : : : : : : 2.3 The blowing-up of : : : : : : : : : : : : : 2.4 Applications : : : : : : : : : : : : : : : : : The space of displacements : : : : : : : : : : : : : 3.1 Quaternions and dual quaternions : : : : : 3.2 Our representation of displacements : : : : 3.3 Applications : : : : : : : : : : : : : : : : : The matrices and their invariants : : : : : : : : : : 4.1 Representations : : : : : : : : : : : : : : : : 4.2 Application to the identities of quaternions Conclusion : : : : : : : : : : : : : : : : : : : : : :

31

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

: : : : : : : : : : : : : : : : : : :

1

1 1 3 7 9 11 12 13 15 17 19 20 20 23 24 26 26 27 28