Lecture Notes in Artificial Intelligence Edited by J. G. Carbonell and J. Siekmann
Subseries of Lecture Notes in Computer Science
2930
Berlin Heidelberg New York Hong Kong London Milan Paris Tokyo
Franz Winkler (Ed.)
Automated Deduction in Geometry 4th International Workshop, ADG 2002 Hagenberg Castle, Austria, September 4-6, 2002 Revised Papers
Series Editors Jaime G. Carbonell, Carnegie Mellon University, Pittsburgh, PA, USA J¨org Siekmann, University of Saarland, Saarbr¨ucken, Germany Author Franz Winkler Johannes Kepler University Institute for Symbolic Computation (RISC) Altenbergerstr. 69, 4040 Linz, Austria E-mail:
[email protected]
Cataloging-in-Publication Data applied for A catalog record for this book is available from the Library of Congress. Bibliographic information published by Die Deutsche Bibliothek Die Deutsche Bibliothek lists this publication in the Deutsche Nationalbibliografie; detailed bibliographic data is available in the Internet at
.
CR Subject Classification (1998): I.2.3, I.3.5, F.4.1, I.5, G.2 ISSN 0302-9743 ISBN 3-540-20927-1 Springer-Verlag Berlin Heidelberg New York This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer-Verlag. Violations are liable for prosecution under the German Copyright Law. Springer-Verlag is a part of Springer Science+Business Media springeronline.com c Springer-Verlag Berlin Heidelberg 2004 Printed in Germany Typesetting: Camera-ready by author, data conversion by DA-TeX Gerd Blumenstein Printed on acid-free paper SPIN: 10985618 06/3142 543210
Lecture Notes in Artificial Intelligence (LNAI)
Vol. 2930: F. Winkler (Ed.), Automated Deduction in Geometry. VII, 231 pages. 2004. Vol. 2923: V. Lifschitz, I. Niemel¨a (Eds.), Logic Programming and Nonmonotonic Reasoning. IX, 365 pages. 2004. Vol. 2913: T.M. Pinkston, V.K. Prasanna (Eds.), High Performance Computing - HiPC 2003. Proceedings, 2003. XX, 512 pages. 2003. Vol. 2903: T.D. Gedeon, L.C.C. Fung (Eds.), AI 2003: Advances in Artificial Intelligence. Proceedings, 2003. XVI, 1075 pages. 2003. Vol. 2902: F.M. Pires, S.P. Abreu (Eds.), Progress in Artificial Intelligence. Proceedings, 2003. XV, 504 pages. 2003.
Vol. 2797: O.R. Za¨ıane, S.J. Simoff, C. Djeraba (Eds.), Mining Multimedia and Complex Data. XII, 281 pages. 2003. Vol. 2792: T. Rist, R. Aylett, D. Ballin, J. Rickel (Eds.), Intelligent Virtual Agents. Proceedings, 2003. XV, 364 pages. 2003. Vol. 2782: M. Klusch, A. Omicini, S. Ossowski, H. Laamanen (Eds.), Cooperative Information Agents VII. Proceedings, 2003. XI, 345 pages. 2003. Vol. 2780: M. Dojat, E. Keravnou, P. Barahona (Eds.), Artificial Intelligence in Medicine. Proceedings, 2003. XIII, 388 pages. 2003.
Vol. 2892: F. Dau, The Logic System of Concept Graphs with Negation. XI, 213 pages. 2003.
Vol. 2777: B. Sch¨olkopf, M.K. Warmuth (Eds.), Learning Theory and Kernel Machines. Proceedings, 2003. XIV, 746 pages. 2003.
Vol. 2891: J. Lee, M. Barley (Eds.), Intelligent Agents and Multi-Agent Systems. Proceedings, 2003. X, 215 pages. 2003.
Vol. 2752: G.A. Kaminka, P.U. Lima, R. Rojas (Eds.), RoboCup 2002: Robot Soccer World Cup VI. XVI, 498 pages. 2003.
Vol. 2882: D. Veit, Matchmaking in Electronic Markets. XV, 180 pages. 2003.
Vol. 2741: F. Baader (Eds.), Automated Deduction – CADE-19. Proceedings, 2003. XII, 503 pages. 2003.
Vol. 2871: N. Zhong, Z.W. Ra´s, S. Tsumoto, E. Suzuki (Eds.), Foundations of Intelligent Systems. Proceedings, 2003. XV, 697 pages. 2003.
Vol. 2705: S. Renals, G. Grefenstette (Eds.), Text- and Speech-Triggered Information Access. VII, 197 pages. 2003.
Vol. 2854: J. Hoffmann, Utilizing Problem Structure in Planing. XIII, 251 pages. 2003.
Vol. 2703: O.R. Za¨ıane, J. Srivastava, M. Spiliopoulou, B. Masand (Eds.), WEBKDD 2002 - MiningWeb Data for Discovering Usage Patterns and Profiles. IX, 181 pages. 2003.
Vol. 2843: G. Grieser, Y. Tanaka, A. Yamamoto (Eds.), Discovery Science. Proceedings, 2003. XII, 504 pages. 2003. Vol. 2842: R. Gavald´a, K.P. Jantke, E. Takimoto (Eds.), Algorithmic Learning Theory. Proceedings, 2003. XI, 313 pages. 2003. Vol. 2838: N. Lavraˇc, D. Gamberger, L. Todorovski, H. Blockeel (Eds.), Knowledge Discovery in Databases: PKDD 2003. Proceedings, 2003. XVI, 508 pages. 2003. Vol. 2837: N. Lavraˇc, D. Gamberger, L. Todorovski, H. Blockeel (Eds.), Machine Learning: ECML 2003. Proceedings, 2003. XVI, 504 pages. 2003. Vol. 2835: T. Horv´ath, A. Yamamoto (Eds.), Inductive Logic Programming. Proceedings, 2003. X, 401 pages. 2003. Vol. 2821: A. G¨unter, R. Kruse, B. Neumann (Eds.), KI 2003: Advances in Artificial Intelligence. Proceedings, 2003. XII, 662 pages. 2003. Vol. 2807: V. Matouˇsek, P. Mautner (Eds.), Text, Speech and Dialogue. Proceedings, 2003. XIII, 426 pages. 2003. Vol. 2801: W. Banzhaf, J. Ziegler, T. Christaller, P. Dittrich, J.T. Kim (Eds.), Advances in Artificial Life. Proceedings, 2003. XVI, 905 pages. 2003.
Vol. 2700: M.T. Pazienza (Eds.), Extraction in the Web Era. XIII, 163 pages. 2003. Vol. 2699: M.G. Hinchey, J.L. Rash, W.F. Truszkowski, C.A. Rouff, D.F. Gordon-Spears (Eds.), Formal Approaches to Agent-Based Systems. IX, 297 pages. 2002. Vol. 2691: V. Maˇr´ık, J.P. M¨uller, M. Pechoucek (Eds.), Multi-Agent Systems and Applications III. Proceedings, 2003. XIV, 660 pages. 2003. Vol. 2684: M.V. Butz, O. Sigaud, P. G´erard (Eds.), Anticipatory Behavior in Adaptive Learning Systems. X, 303 pages. 2003. Vol. 2671: Y. Xiang, B. Chaib-draa (Eds.), Advances in Artificial Intelligence. Proceedings, 2003. XIV, 642 pages. 2003. Vol. 2663: E. Menasalvas, J. Segovia, P.S. Szczepaniak (Eds.), Advances in Web Intelligence. Proceedings, 2003. XII, 350 pages. 2003. Vol. 2661: P.L. Lanzi, W. Stolzmann, S.W. Wilson (Eds.), Learning Classifier Systems. VII, 231 pages. 2003. Vol. 2654: U. Schmid, Inductive Synthesis of Functional Programs. XXII, 398 pages. 2003. Vol. 2650: M.-P. Huget (Eds.), Communications in Multiagent Systems. VIII, 323 pages. 2003.
Vol. 2645: M.A. Wimmer (Eds.), Knowledge Management in Electronic Government. Proceedings, 2003. XI, 320 pages. 2003.
Vol. 2514: M. Baaz, A. Voronkov (Eds.), Logic for Programming, Artificial Intelligence, and Reasoning. Proceedings, 2002. XIII, 465 pages. 2002.
Vol. 2639: G. Wang, Q. Liu, Y. Yao, A. Skowron (Eds.), Rough Sets, Fuzzy Sets, Data Mining, and Granular Computing. Proceedings, 2003. XVII, 741 pages. 2003.
Vol. 2507: G. Bittencourt, G.L. Ramalho (Eds.), Advances in Artificial Intelligence. Proceedings, 2002. XIII, 417 pages. 2002.
Vol. 2637: K.-Y. Whang, J. Jeon, K. Shim, J. Srivastava, Advances in Knowledge Discovery and Data Mining. Proceedings, 2003. XVIII, 610 pages. 2003.
Vol. 2504: M.T. Escrig, F. Toledo, E. Golobardes (Eds.), Topics in Artificial Intelligence. Proceedings, 2002. XI, 427 pages. 2002.
Vol. 2636: E. Alonso, D. Kudenko, D. Kazakov (Eds.), Adaptive Agents and Multi-Agent Systems. XIV, 323 pages. 2003.
Vol. 2499: S.D. Richardson (Eds.), Machine Translation: From Research to Real Users. Proceedings, 2002. XXI, 254 pages. 2002.
Vol. 2627: B. O’Sullivan (Eds.), Recent Advances in Constraints. X, 201 pages. 2003.
Vol. 2484: P. Adriaans, H. Fernau, M. van Zaanen (Eds.), Grammatical Inference: Algorithms and Applications. Proceedings, 2002. IX, 315 pages. 2002.
Vol. 2600: S. Mendelson, A.J. Smola (Eds.), Advanced Lectures on Machine Learning. IX, 259 pages. 2003. Vol. 2592: R. Kowalczyk, J.P. M¨uller, H. Tianfield, R. Unland (Eds.), Agent Technologies, Infrastructures, Tools, and Applications for E-Services. XVII, 371 pages. 2003. Vol. 2586: M. Klusch, S. Bergamaschi, P. Edwards, P. Petta (Eds.), Intelligent Information Agents. VI, 275 pages. 2003. Vol. 2583: S. Matwin, C. Sammut (Eds.), Inductive Logic Programming. X, 351 pages. 2003. Vol. 2581: J.S. Sichman, F. Bousquet, P. Davidsson (Eds.), Multi-Agent-Based Simulation. X, 195 pages. 2003. Vol. 2577: P. Petta, R. Tolksdorf, F. Zambonelli (Eds.), Engineering Societies in the Agents World III. X, 285 pages. 2003. Vol. 2569: D. Karagiannis, U. Reimer (Eds.), Practical Aspects of Knowledge Management. Proceedings, 2002. XIII, 648 pages. 2002. Vol. 2560: S. Goronzy, Robust Adaptation to Non-Native Accents in Automatic Speech Recognition. XI, 144 pages. 2002. Vol. 2557: B. McKay, J. Slaney (Eds.), AI 2002: Advances in Artificial Intelligence. Proceedings, 2002. XV, 730 pages. 2002. Vol. 2554: M. Beetz, Plan-Based Control of Robotic Agents. XI, 191 pages. 2002. Vol. 2543: O. Bartenstein, U. Geske, M. Hannebauer, O. Yoshie (Eds.), Web Knowledge Management and Decision Support. X, 307 pages. 2003.
Vol. 2479: M. Jarke, J. Koehler, G. Lakemeyer (Eds.), KI 2002: Advances in Artificial Intelligence. Proceedings, 2002. XIII, 327 pages. 2002. Vol. 2475: J.J. Alpigini, J.F. Peters, A. Skowron, N. Zhong (Eds.), Rough Sets and Current Trends in Computing. Proceedings, 2002. XV, 640 pages. 2002. Vol. 2473: A. G´omez-P´erez, V.R. Benjamins (Eds.), Knowledge Engineering and Knowledge Management. Ontologies and the Semantic Web. Proceedings, 2002. XI, 402 pages. 2002. Vol. 2466: M. Beetz, J. Hertzberg, M. Ghallab, M.E. Pollack (Eds.), Advances in Plan-Based Control of Robotic Agents. VIII, 291 pages. 2002. Vol. 2464: M. O’Neill, R.F.E. Sutcliffe, C. Ryan, M. Eaton, N.J.L. Griffith (Eds.), Artificial Intelligence and Cognitive Science. Proceedings, 2002. XI, 247 pages. 2002. Vol. 2448: P. Sojka, I. Kopecek, K. Pala (Eds.), Text, Speech and Dialogue. Proceedings, 2002. XII, 481 pages. 2002. Vol. 2447: D.J. Hand, N.M. Adams, R.J. Bolton (Eds.), Pattern Detection and Discovery. Proceedings, 2002. XII, 227 pages. 2002. Vol. 2446: M. Klusch, S. Ossowski, O. Shehory (Eds.), Cooperative Information Agents VI. Proceedings, 2002. XI, 321 pages. 2002. Vol. 2445: C. Anagnostopoulou, M. Ferrand, A. Smaill (Eds.), Music and Artificial Intelligence. Proceedings, 2002. VIII, 207 pages. 2002.
Vol. 2541: T. Barkowsky, Mental Representation and Processing of Geographic Knowledge. X, 174 pages. 2002.
Vol. 2443: D. Scott (Eds.), Artificial Intelligence: Methodology, Systems, and Applications. Proceedings, 2002. X, 279 pages. 2002.
Vol. 2533: N. Cesa-Bianchi, M. Numao, R. Reischuk (Eds.), Algorithmic Learning Theory. Proceedings, 2002. XI, 415 pages. 2002.
Vol. 2432: R. Bergmann, Experience Management. XXI, 393 pages. 2002.
Vol. 2531: J. Padget, O. Shehory, D. Parkes, N.M. Sadeh, W.E. Walsh (Eds.),Agent-Mediated Electronic Commerce IV. Designing Mechanisms and Systems. XVII, 341 pages. 2002. Vol. 2527: F.J. Garijo, J.-C. Riquelme, M. Toro (Eds.), Advances in Artificial Intelligence - IBERAMIA 2002. Proceedings, 2002. XVIII, 955 pages. 2002. Vol. 2522: T. Andreasen, A. Motro, H. Christiansen, H.L. Larsen (Eds.), Flexible Query Answering Systems. Proceedings, 2002. X, 383 pages. 2002.
Vol. 2431: T. Elomaa, H. Mannila, H. Toivonen (Eds.), Principles of Data Mining and Knowledge Discovery. Proceedings, 2002. XIV, 514 pages. 2002. Vol. 2430: T. Elomaa, H. Mannila, H. Toivonen (Eds.), Machine Learning: ECML 2002. Proceedings, 2002. XIII, 532 pages. 2002. Vol. 2427: M. Hannebauer, Autonomous Dynamic Reconfiguration in Multi-Agent Systems. XXI, 284 pages. 2002. Vol. 2424: S. Flesca, S. Greco, N. Leone, G. Ianni (Eds.), Logics in Artificial Intelligence. Proceedings, 2002. XIII, 572 pages. 2002.
Lecture Notes in Artificial Intelligence 2930 Franz Winkler (Ed.)
Automated Deduction in Geometry 4th International Workshop, ADG 2002 Hagenberg Castle, Austria, September 2002 Revised Papers
Algorithmic Tests for the Normal Crossing Property G´ abor Bodn´ ar Research Institute for Symbolic Computation Johannes Kepler University, A-4040 Linz, Austria [email protected]
Abstract. Given a finite set of varieties in some nonsingular affine variety W . They are normal crossing if and only if at every point of W there is a regular system of parameters such that each variety can be defined locally at the point by a subset of this parameter system. In this paper we present two algorithms to test this property. The first one is developed for hypersurfaces only, and it has a straightforward structure. The second copes with the general case by constructing finitely many regular parameter systems which are “witnesses” of the normal crossing of the varieties over open subsets of W . The ideas of the methods are applied in a computer program for resolution of singularities.
1
Introduction
The notion of normal crossing is ubiquitous in singularity theory and it has a prominent role in the problem of resolution of singularities (see e.g. [1] for the foundations of the classical theory, or [2] for a more recent survey on the field) and in constructing alterations (see e.g. [3]). Informally speaking, finitely many subvarieties of some nonsingular variety W are normal crossing iff at every point of W there exists an “algebraic coordinate system,” such that each of the varieties can be defined locally at the point by coordinate functions. This implies in particular that the varieties themselves cannot have singularities. From this we can obtain the intuition that the normal crossing singularities (that is, points where normal crossing varieties intersect) are, so to say, the best ones after nonsingular points. This is also reflected in the definition of embedded resolution of singularities, which requires that a desingularization morphism π : W → W of an embedded variety X ⊂ W (where W, W are nonsingular) has the property that the irreducible components of the total transform π −1 (X) are normal crossing and the strict transform, i.e. the Zariski closure of π −1 (X \ S), is nonsingular. Here S ⊂ X is the set of singularities of X and π is an isomorphism outside S. As the matter of terminology, π −1 (S) is called the set of exceptional components, which is a union of hypersurfaces in W . In the resolution algorithm of Villamayor (for the theoretical presentation see [4, 5], for the implementation see [6, 7, 8]) it is essential to keep the excepF. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 1–20, 2004. c Springer-Verlag Berlin Heidelberg 2004
2
G´ abor Bodn´ ar
tional components normal crossing in the intermediate steps, when the desingularization map π is constructed as the composition of well chosen elementary transformations, called blowups. It is not difficult to choose blowups that create new exceptional components which are normal crossing with the old ones. On the other hand, it is not always possible to have such transformations that at the same time also reduce the multiplicities of the singularities. Therefore the algorithm often has to apply “preparatory” blowups which do not reduce multiplicity; whose only job is to create an advantageous situation, in which the next transformation can achieve both goals at the same time. The subtask of the resolution which deals with this “preparation” is usually referred to as the transversality problem. The simplification of the solution of this problem motivated the investigation of the normal crossing property. The ideas and parts of the algorithms of this paper are applied in a recent implementation of the resolution algorithm. Their integration into the theory of Villamayor is beyond the scope of this presentation, and is planned to be described in an forthcoming paper. In Sect. 3 we present an easy algorithm to test the normal crossing of hypersurfaces, which cannot be generalized in a straightforward way to settle the question for varieties. Therefore in Sect. 4 we start with a different approach to tackle the general case. The resulting algorithm is more complicated than the one of Sect. 3; on the other hand, it does not only say “yes” or “no,” but it also computes a special representation of the input varieties. This consists of finitely many “algebraic coordinate systems” (i.e. regular parameter systems, see Sect. 2) together with corresponding open subsets and tags for each variety. The representation has the property that for each “coordinate system,” a given variety is defined, over the open subset belonging to the system, by the coordinate functions which are marked by the tag of the variety. The prerequisites for the reader to follow the paper are elementary results from commutative algebra, algebraic geometry and differential geometry. To my best knowledge, no algorithmic solution has ever been given for the subject of this paper. I would like to thank Herwig Hauser for his helpful remarks and suggestions. This work has been supported by the Austrian Science Fund (FWF) in the frame of the project “Explicit Resolution and Related Methods in Algebraic Geometry and Number Theory” (P15551).
2
Preliminary Definitions
For the sake of simplicity we take k to be an algebraically closed field of characteristic zero (e.g. the complex numbers). Actually, the methods of the paper would also work for algebraically closed fields of positive characteristic for almost every particular example. In characteristic p the failing cases would arise from the collapse of partial derivatives of pth powers. We denote the affine m-space over k by Am k , with coordinate ring R = is defined by a polynomial ideal k[x1 , . . . , xm ]. An affine algebraic set W ⊆ Am k
Algorithmic Tests for the Normal Crossing Property
3
J ⊆ R, where, because of noetherianity, we can always take finite generating sets for J. The coordinate ring of W is OW = R/J. The Krull dimension dim OW is the supremum of the height of all prime ideals in OW , where the height of a prime ideal P is the supremum of all integers n for which there exists a chain of prime ideals P0 ⊂ · · · ⊂ Pn = P ⊂ OW . The dimension dim W is by definition dim OW . We define the Zariski topology on an algebraic set W by taking the algebraic subsets of W to be the closed subsets. An algebraic set is called a variety iff it is irreducible in the Zariski topology. At a point a ∈ W , the local ring OW,a is the ring of regular functions at a, i.e. the ring of OW -rational functions with nonvanishing denominator at a. The (unique) maximal ideal of OW,a is denoted by ma , which, by default, can be generated by x1 − a1 , . . . , xm − am if a = (a1 , . . . , am ). The local ring OW,a is called regular if ma can be generated by dim OW,a many elements. The algebraic set W is nonsingular at a point a ∈ W iff OW,a is regular, and W is nonsingular iff it is nonsingular at all of its points. Definition 1. Let OW,a be a regular local ring, a minimal set of generators of ma is called a regular system of parameters of OW,a . Let n = dim W , so that p = (p1 , . . . , pn ) is a regular system of parameters of OW,a , where a is a nonsingular point of W . Then there exists an open neighborhood U ⊆ W of a such that for all a ∈ U , p1 − p1 (a ), . . . , pn − pn (a ) is a regular parameter system of OW,a (see Remark 1). In this case we call p a regular parameter system over U . We assume from now on that W is a nonsingular variety. Then without loss of generality we can assume that we have regular parameter systems over W , otherwise we could just pass to open subsets of a suitable covering of W . If p is a regular system of parameters over W , we have dp1 , . . . , dpn forming a basis of the module of differential forms ΩW/k . Accordingly, they give rise to partial derivations ∂p1 , . . . ∂pn ∈ Derk (W ). To compute derivatives over W it is enough to know the Jacobian of the generators of OW , that is P ∈ Mn×m , k where Pij = ∂pi xj . Then for a representative f ∈ k[x1 , . . . , xm ] of an element m from OW , ∂pi f = j=1 Pij ∂xj f represents its partial derivative. From now on, whenever we have a system of regular parameters over an affine variety, we assume to have also the matrix P available, so that we can effectively compute partial derivatives. Remark 1. Given a regular system of parameters p of OW,a , the largest open subset U ⊆ W over which p is (or with more precise terminology: gives rise to) a parameter system consists of the points where none of the denominators in p vanish and the vector field defined by dp1 , . . . , dpn is linearly independent. The latter condition follows from the fact that p is a regular system of parameters at a iff (the image of) p is a basis of the k-vector space ma /m2a (by Nakayama’s lemma). This is the case when the vectors defined by dp1 , . . . , dpn are linearly independent at a.
4
G´ abor Bodn´ ar
Next we provide other means to compute the singularities of subvarieties of W , which we will use in the algorithms of the upcoming sections. Let X ⊂ W be a subvariety of codimension r (= n − dim X), defined by f1 , . . . , fl ∈ OW . The Jacobian matrix of X with respect to the defining equations f1 , . . . , fl is JW (f1 , . . . , fl ) = (∂pj fi )j=1,...,n;i=1,...,l , and the Jacobian ideal JiW,r (f1 , . . . , fl ) is generated by all the r × r minors of the Jacobian matrix. The singular locus Sing(X) is then defined by f1 , . . . , fl + JiW,r (f1 , . . . , fl ) in OW . In the case of hypersurfaces the previous computation simplifies in the following way: Let X ⊂ W be a hypersurface defined by f ∈ OW , then Sing(X) is defined by f + ∂pj f | j = 1, . . . , n . Definition 2. Let X1 , . . . , Xs ⊂ W be varieties. They are normal crossing at a point a ∈ W iff there exists a regular parameter system p at a, such that each of the Xi can be defined, locally at a, by a (possibly empty) subset of this parameter system. We say that X1 , . . . , Xs are normal crossing (over W ) iff they are normal crossing at every point (of W ). Remark 2. (i) If X1 , . . . , Xs are normal crossing at a point a, then they are normal crossing in an open neighborhood of a. In other words, the “is normal crossing” predicate, considered as a function, is upper semi-continuous, that is, it can jump from true to false only at special points. This property follows from the remark after Definition 1. (ii) Being nonsingular is a necessary condition for all the varieties in order to be normal crossing, because a variety at a singular point cannot be defined by regular parameters. (iii) The definition can be extended to algebraic sets or even to subschemes of W . First of all, we would pass to the corresponding reduced subschemes, then to their irreducible components to reduce the problem to the one we gave above. This is the reason why we prefer to use the simpler language of varieties in this paper. In Fig. 1, we show a few negative and positive examples of the normal crossing property. The points of “non-normal crossing” are marked with black. In Fig. 1(a) all the singular points are not normal crossing. The surfaces in Fig. 1(b) are normal crossing (the second subfigure shows the same configuration from a different angle with the surfaces clipped). Finally, in Fig. 1(c) the varieties are not normal crossing, because at the origin there is no regular system of parameters which could define both in the sense of Definition 2.
3
The Hypersurface Case
We use the notation and the context from Sect. 2, where X1 , . . . , Xs are pairwise different hypersurfaces (reduced separated subschemes of codimension one). The following proposition provides an easy decision method to test normal crossing at a point.
Algorithmic Tests for the Normal Crossing Property
(a) x2 − yz 2
(b) x2 + y 2 + z 2 − 1, x2 − y + z 2 , x3 + y2 − z
5
(c) x3 − 3xy 2 − z, (x, z)
Fig. 1. Subfigures (a),(c): not normal crossing, (b): normal crossing Proposition 1. The hypersurfaces X1 , . . . , Xs ⊂ W , defined by f1 , . . . , fs ∈ OW respectively, are normal crossing at a point a ∈ W iff a ∈ Sing(Xi ) for all i and the {(dfi )(a) | fi (a) = 0} are linearly independent. Proof. First let us note that ΩW/k is a k-vector space. Since the hypersurfaces that do not contain a are defined by the empty parameter system, we just consider those i for which a ∈ Xi , so that fi OW,a ∈ ma . If all these Xi are nonsingular at a, the “gradients” (dfi )(a) are nonzero, and if they are also linearly independent, then fi OW,a form a regular sequence in OW,a . This regular sequence is then extendible to a regular system of parameters. The “only if” part is immediate (see Definition 2 and Remark 2(ii)). The content of this proposition is well known, and the arising algorithm is the following. Let ∂p1 , . . . , ∂pn be the derivations on W coming from a regular system of parameters. For a given a ∈ W , collect the fi that vanish at a; without loss of generality we can assume that the relevant indices are 1, . . . , l (≤ s). Compute defining equations for Sing(Xi ) as in Sect. 2 and check whether a ∈ Sing(Xi ). If a is a singular point of any of the hypersurfaces, they are not normal crossing. Then compute (JW (f1 , . . . , fl ))(a) and compute its rank. If it is less than l, the hypersurfaces are not normal crossing at a, otherwise they are. The next step is to generalize this method so that we can perform the test over closed subsets of W in one stroke of computations. It is quite obvious what we have to do. Instead of evaluation we check for a selected subset of hypersurfaces, say X1 , . . . , Xl , whether there is a point a in their intersection where, after evaluation at a, we would get df1 , . . . , dfl linearly dependent. We should remark in advance that this computation has to be performed only when l ≤ n, since otherwise the arising matrix cannot be of rank l. Thus, when l > n the test reduces to check whether X1 ∩ · · · ∩ Xl is empty, which corresponds with the fact that in an n dimensional ambient variety at most n hypersurfaces, intersecting at a, can have normal crossing at a. Assuming l ≤ n, we have that JiW,l (f1 , . . . , fl ) defines the points where the vector field given by df1 , . . . , dfl is linearly dependent (in the sense explained above). Nevertheless, only those points are relevant for us which are contained
6
G´ abor Bodn´ ar
in X1 ∩ · · · ∩ Xl ; therefore the points in the intersection of the selected hypersurfaces at which they are not normal crossing are defined by f1 , . . . , fl + JiW,l (f1 , . . . , fl ). We can immediately note that when the selected subset of hypersurfaces is a singleton, the above computation provides the singular locus of the hypersurface. We can test now whether a given finite set of hypersurfaces in W are normal crossing by going through all the subsets, checking the selected hypersurfaces along their intersection. We use the method of Gr¨ obner bases (see [9, 10]) to test whether a given set of polynomials has a common zero. The algorithm isNCH summarizes our observations. Algorithm isNCH; Input: W a nonsingular affine variety, (f1 , . . . , fs ) a list of defining equations of hypersurfaces in W . Output: true or false, indicating the normal crossing property of the input hypersurfaces in W . isNCH (W ,(f1 , . . . , fs )) n := dim(W ); R/J := OW ; O := tdeg(Generators(R)); for l = 1 to s do for each {i1 , . . . , il } ⊆ {1, . . . , s} do if l ≤ n then G := gbasis(fi1 , . . . , fil + JiW,l (fi1 , . . . , fil ) + J, O); else G := gbasis(fi1 , . . . , fil + J, O); if NormalForm(1, G, O) = 0 then return false; return true;
Remark 3. (i) The termination of the algorithm is easy to see. (ii) The correctness is supported by Proposition 1, which implies the correctness of the elementary test for a selected subset of the input hypersurfaces, and the fact that the algorithm performs an exhaustive check. (iii) The algorithm is of exponential complexity in the number of input hypersurfaces, but please note that Gr¨ obner basis computation has double exponential worst case complexity in the number of indeterminates.
4
The General Case
We use the notation and the context from Sect. 2, and now X1 , . . . , Xs denote pairwise different varieties (integral separated subschemes of W ). We can easily check whether the varieties are nonsingular (see Sect. 2), thus till the formulation of the final algorithm we will just assume this property for all of them. For varieties of higher codimension, it is not enough to check linear dependence of vectors in their normal bundles. At a point a ∈ W , subvarieties with
Algorithmic Tests for the Normal Crossing Property
7
normal spaces generated by linearly dependent vectors can either be normal crossing (think of a line embedded in a plane both embedded in 3-space) or not (if, for instance, they happen to be hypersurfaces). Therefore our strategy is to try to construct regular parameter systems which will serve as witnesses for Definition 2. We do it in two steps: first we achieve that each variety is defined locally by regular parameters (this is what we call a local regular representation, see Subsect. 4.1), and then we try to unify these parameter systems (to find local witnesses, see Subsect. 4.2). We must, of course, take care that, as in algorithm isNCH, we test all varieties against each other at all of their intersection points in W , see Subsect. 4.3. 4.1
Local Regular Representations
A nonsingular subvariety of W is a local complete intersection (see e.g. Example 8.22.1 on page 185 in [11]). The next definition just collects the data that represent such a variety by codimension many regular parameters. Definition 3. Let X ⊂ W be a nonsingular variety of codimension r. A triple (U, p, t) is a local regular representation of X (over U ) iff U ⊆ W , p is a regular system of parameters over U and t ∈ {0, 1}n , such that X ∩ U is defined by X = ((Ui , p(i) , ti ) | i = {ti pi | i = 1, . . . , n}. A list of local regular representations s 1, . . . , s), is a regular representation of X iff X ⊆ i=1 Ui . Concerning the notation, elements of a regular system of parameters p are denoted by indexing: pi , while the ith parameter system in an enumeration is denoted by the parenthesized index: p(i) . The jth element of p(i) is denoted by p(i)j . In this subsection we present an algorithm that computes a regular representation for a given nonsingular variety. The algorithm is extracted from the implementation of Villamayor’s algorithm for resolution of singularities by J. Schicho and the author (see [7]). To make the details of the computations readily available first we briefly discuss two subalgorithms that will be used later. For the correctness proofs we refer to [7]. We do not need the matrix P of partial derivatives (see Sect. 2) in the local regular representations, but as partial derivation is ubiquitous in the algorithms, and we will have to change the parameter systems frequently, we present the transformation rules for P . If the reader is not interested in these details, they can be safely omitted. Given (U, p, P ), the first subalgorithm, Cover, passes to open subsets of U s . The ith subset is which are defined by its second parameter (f1 , . . . , fs ) ∈ OU isomorphic to U \ ZeroSet(fi ), which is described by introducing a new variable with a relation that makes it to be the inverse of fi . The p component does not change, while the P matrix needs to be updated for each subset, having a new column that contains the partial derivatives of the new variable with respect to p. The output subsets form a covering of U iff ZeroSet(f1 , . . . , fs ) = ∅. The subalgorithm Exchange replaces an element of the regular system of parameters of (U, p, P ) with a new function f ∈ OU , and it updates P accordingly.
8
G´ abor Bodn´ ar
Please note that the input specifications of the Exchange algorithm require that ∂pi f is invertible in OU . Algorithm Cover; Input: (U, p, P ), where U ⊆ W open, and p is a regular system of parameters over U with derivation matrix P ; and f1 , . . . , fs ∈ OU . Output: ((Ui , p(i) , Pi ) | i = 1, . . . , s) such that Ui ∼ = U \ ZeroSet(fi ) and p(i) is a regular system of parameters over Ui with derivation matrix Pi . Cover ((U, p, P ),(f1 , . . . , fs )) R/J := k[x1 , . . . , xl ]/J := OU ; for i = 1 to s do let Ui be defined by OUi := R[xl+1 ]/(J + xl+1 fi − 1); let Pi ∈ Mn×l+1 with (Pi )mj := Pmj , for m = 1, . . . , n, j = 1, . . . , l and k (Pi )m,l+1 := −x2l+1 ∂pm fi , for m = 1, . . . , n; return ((Ui , p, Pi ) | i = 1, . . . , s);
Algorithm Exchange; Input: (U, p, P ), where U ⊆ W open, and p is a regular system of parameters over U with derivation matrix P ; i an index to p; and f, q ∈ OU such that q = (∂pi f )−1 . Output: (U, p , P ) where pi is replaced by f in p so that p is a regular system of parameters over U with derivation matrix P . Exchange((U, p, P ), i, f , q) (p1 , . . . , pn ) := p; l := NumberOfColumns(P ); p := (p1 , . . . , pi−1 , f, pi+1 , . . . , pn ); let P ∈ Mn×l ; k for j = 1 to l do Pij := qPij ; := Pmj − qPij ∂pm f ; for m = 1 to n do if m = i then Pmj return (U, p , P );
Let now X ⊂ W be a nonsingular subvariety of codimension r, defined by its vanishing ideal I = f1 , . . . , fl OW . Let W be equipped with a regular system of parameters p with derivation matrix P . To construct a local regular representation of X we intend to find elements in I that we can exchange by elements of p. We can have the following situations: 1. There is a pi ∈ I, so we just tag pi . 2. We are not in case 1, but there is an f ∈ I and a pi ∈ p such that ∂pi f is invertible in OW . In this case we call Exchange to replace pi by f and we tag the new parameter f . 3. We are neither in case 1 nor in case 2, but since X is nonsingular, there can be no point of X where all the partial derivatives of the defining equations
Algorithmic Tests for the Normal Crossing Property
9
vanish. Then we can call Cover for (W, p, P ) by (∂pi fj | i = 1, . . . , n, j = 1, . . . , l). The subsets generated this way cover X, and over each of them we can call Exchange (since we made a partial derivative invertible), tagging the new parameters. This strategy is applied recursively over the subsets created by Cover, always considering only untagged parameters. The complete description can be found in the algorithm RegularRepresentation.
Algorithm RegularRepresentation; Input: (U, p, t), P , where U ⊆ W open, p is a regular system of parameters over U with derivation matrix P , t ∈ {0, 1}n tags for p; and X a nonsingular subvariety of U . Output: A regular representation of X over U with a derivation matrix for each regular parameter systems. RegularRepresentation((U, p, t), P , X) let I = ti pi | i = 1, . . . , n + f1 , . . . , fl define X such that fj ≡ 0 mod ti pi | i = 1, . . . , n, j = 1, . . . , l; r := codimW (X); s := n i=1 ti ; // if codimension many regular parameters are tagged, we are done if s = r then return ((U, p, t), P ); // case 1: look for a taggable p element for i = 1 to n do if ti = 0 and pi ∈ I then ti := 1; return RegularRepresentation((U, p, t), P , X); // case 2: look for exchangeable elements over U for i = 1 to n do if ti = 0 then for j = 1 to l do if (∂pi fj )−1 ∈ OU then (U, p, P ) := Exchange((U, p, P ), i, fj , (∂pi fj )−1 ); ti := 1; return RegularRepresentation((U, p, t), P , X); // case 3: in general we have to pass to open subsets ((Ui , p(i) , Pi ) | i = 1, . . . , (n − s)l) := Cover ((U, p, P ), (∂pi fj | j = 1, . . . , l, ti = 0, i = 1, . . . , n)); LRR := (); N := 0; for i = 1 to n do if ti = 0 then for j = 1 to l do N := N + 1; t := t; ti := 1; if ∂pi fj = 0 then // we skip empty subsets (UN , p(N) , PN ) := Exchange((UN , p(N) , PN ), i, fj , (∂pi fj )−1 ); append RegularRepresentation((UN , p(N) , t ), PN , X) to LRR; return LRR;
Theorem 1. Let X ⊂ W be a nonsingular subvariety of codimension r, and let p be a regular system of parameters over W with derivation matrix P . The procedure call RegularRepresentation((W, p, (0 | i = 1, . . . n)), P, X) computes a regular representation for X in finitely many steps. Proof. The computation branches each time the Cover procedure is called. Thus we have to show that the algorithm computes a local regular representation
10
G´ abor Bodn´ ar
for X over an arbitrarily chosen path of this computation tree and that the open subsets at the leafs cover X. We also note here that we will not count the last recursive calls in which the “s = r” condition is satisfied and the procedure returns immediately. To emphasize this we will talk only about relevant recursive calls, in which real computations are done. We proceed by induction on r (≤ n). In the case when X is a hypersurface defined by f ∈ OW , no relevant recursive call happens. The first two cases (numbered by 1 and 2 in our previous enumeration) are straightforward. In case 3, we have 1 ∈ f + ∂pi f | i = 1, . . . , n because X is nonsingular, thus the open subsets cover X and we are in case 2 over them. Let us assume that the algorithm fulfills the claims for codimension r − 1 and let X be of codimension r (> 1). First we observe that the relevant part of the recursion is exactly r-fold over the branches where U does not get disjoint from X. This is because the algorithm tags one regular parameter in one recursive call and a subvariety defined by i regular parameters is of codimension i. In the first call of the algorithm for X, if case 1 or case 2 applies, we immediately reduce the problem to solving one of codimension r − 1 over the closed Y ⊂ W defined by the tagged parameter. In case 3, considering X as a subvariety of the nonsingular subset of W defined by the tagged parameters, we have 1 ∈ f1 , . . . , fl +∂pi fj | j = 1, . . . , l, ti = 0, i = 1, . . . , n again because this ideal defines a subset of Sing(X) (which is defined via the Jacobian ideal) and X is nonsingular. Thus the union of the computed subsets contains X and over the nonempty ones case 2 applies. Therefore over a subset U from these last ones, we again reduced the problem to one of codimension r − 1 over the closed Y ⊂ U defined by the tagged parameter. This reduction is possible because being nonsingular is an intrinsic property of X and because X is a local complete intersection in any nonsingular variety containing it. Please note that Y is nonsingular in U and that the untagged elements of p form a regular system of parameters over Y . Finally, by the induction hypothesis, the algorithm computes a regular representation for X over Y which extends to a regular representation of X (possibly via the open cover constructed in case 3) with the tagged parameter. Remark 4. (i) A rough worst case complexity bound for the algorithm is (nl)r subsets in the final regular representation, where l is the maximal cardinality of the generating sets of the defining ideals used for X throughout the algorithm, and X is of codimension r in the n-dimensional W . (ii) The correctness proof does not talk about P , since this datum is not a member of a regular representation. However the correctness of these matrices, attached to the local regular representations of the output, can be easily seen via the correctness of the subalgorithms Cover and Exchange. 4.2
Common Regular Parameter Systems
We consider the original scenario, where we have X1 , . . . , Xs , subvarieties of W . Now that we can compute regular representations for each of them, our next
Algorithmic Tests for the Normal Crossing Property
11
goal is to test local “unifyability.” More precisely, if a selected subset of the given varieties, say X1 , . . . , Xl , has a nonempty intersection S, we want to determine whether for each point of S there exists a neighborhood U together with a regular system of parameters such that each selected variety is defined by a subset of this parameter system over U (see Definition 2). In this section we use the notational conventions introduced in Definition 3, and in the paragraph after it. Definition 4. Let p(1) , . . . , p(s) be regular parameter systems. (i) We call an element f ∈ OU locally exchangeable at index j for p(1) , . . . , p(s) iff ∂p(i)j f = 0 for all i = 1, . . . , s. We call f locally exchangeable over some open subset V ⊆ U (or at a point a ∈ U ) if ZeroSet(∂p(i)j f )∩V = ∅ (or (∂p(i)j f )(a) = 0 respectively) for all i = 1, . . . , s. (ii) Arrangements of p(1) , . . . , p(s) are elements of the set of all possible permutations of the indices of the parameters in the systems, i.e. {(σ1 p(1) , . . . , σs p(s) ) | σ1 , . . . , σs ∈ Sn }. Remark 5. (i) An element of OW which is locally exchangeable at a ∈ W necessarily defines a nonsingular hypersurface at a. On the other hand, if an element defines a singular hypersurface at a, it cannot be exchangeable over any neighborhood of a at any index with respect to any parameter system. (ii) The property of being locally exchangeable is locally stable, i.e. an element with this property for a given list of regular parameter systems and index j at a point a ∈ W has this property at all points of some neighborhood of a (cf. Remark 1). Example 1. Let W = A3k , p(1) = (x1 , x2 −x31 +x1 , x21 +x22 −x3 ), p(2) = (x1 , x2 , x3 ) and let f = x2 . The partial derivatives of f with respect to p(1) are (3x21 −1, 1, 0), thus f is locally exchangeable for p(1) at index 1 and 2. The corresponding open subsets over which the exchange is possible are W \ ZeroSet(3x21 − 1) for index 1 and W for index 2. The partial derivatives of f with respect to p(2) are (0, 1, 0), thus f is exchangeable for p(2) only at index 2, actually we have p(2)2 = f . If we have to keep p(1)2 in p(1) because it is used in a local regular representation, and we need to exchange f for p(1) at index 1, we have to rearrange either p(1) or p(2) . Say, we keep p(1) fixed, and take σ2 to map (1, 2, 3) → (2, 1, 3), getting σ2 p(2) = (x2 , x1 , x3 ). In this case we have that f is exchangeable for the arrangement p(1) , σ2 p(2) at index 1. The next lemma allows us to restrict the search for exchangeable elements in an ideal to a finite generating set. Lemma 1. Let p(1) , . . . , p(s) be regular parameter systems over W . The vanishing ideal I ⊂ OW of an algebraic set X ⊂ W contains an element which is locally exchangeable at index j for p(1) , . . . , p(s) over some neighborhood of a ∈ X iff any finite generating set of I does. Proof. The “if” part is immediate. For the “only if” part, let us assume that there exists f ∈ I locally exchangeable at index j for p(1) , . . . , p(s) , while there exists a finite generating set of I in which no element has this property. Now
12
G´ abor Bodn´ ar
observe that if all the elements from the finite generating set are not locally exchangeable then neither are their OW -linear combinations. We just have to apply the Leibniz rule and the fact that both the generators and their partial derivatives, for some of the parameter systems with respect to the jth parameter, vanish at a. Therefore, as we must be able to write f as a linear combination of the generators, f also cannot be locally exchangeable. The next lemma provides the core idea of the algorithm that tries to find a common regular representation for varieties from their given regular representations. It shows that locally at a point normal crossing of the varieties is equivalent with the existence of suitable arrangements of the parameter systems such that at each index there is an exchangeable element in the intersection of the ideals of the relevant varieties. Relevance just means that the corresponding local regular representation has a (1) tag at the index in question. Lemma 2. Let (Ui , p(i) , ti ) be a local regular representation s of Xi ⊂ W for i = 1, . . . , s, let Ii ⊂ OUi define Xi over Ui and let a ∈ i=1 (Ui ∩ Xi ). There exists an arrangement of the the parameter systems, and of thevalues in the tags accordingly, such that for each index j there exists pj ∈ t(i)j =1 Ii (the empty intersection defines OW ) with the property that pj is locally exchangeable at index j for all the p(i) over some neighborhood of a and pj − pj (a) ∈ p1 − p1 (a), . . . , pj−1 − pj−1 (a) OW,a when j > 1 iff the Xi are normal crossing at a. Proof. Let us assume that the Xi are normal crossing at a, so that we have a regular system of parameters p such that each Xi can be defined by p-parameters locally at a. For each i we can choose arrangements of p(i) for which each pj is locally exchangeable at index j for p(i) with the following properties: (i) pj becomes a parameter over some neighborhood of a. This can be achieved by ensuring that (∂p(i)j pj )(a) = 0, and the existence of a suitable arrangement follows from the fact that p and p(i) are regular parameter systems over neighborhoods of a. (ii) When j > 1, pj − pj (a) ∈ p1 − p1 (a), . . . , pj−1 − pj−1 (a) OW,a , which follows immediately from the fact that p is a regular system of parameters over some neighborhood of a. Now since p is a witness of normal crossing for the varieties at a, Xi can be defined by codimension many p-elements at a. Let these elements be identified by the tag Ti . But p(i) is also a regular parameter system with the same property, so there must be an arrangement of p(i) which fulfills requirement (i) and (ii) above and for which Ti = ti , otherwise the tagged parameters could not define the same variety at a. Choosing such an arrangement for each p(i) we get pj ∈ t(i)j =1 Ii . For the “only if” part, let us assume that the parameter systems are rearranged so that there exists pj ∈ t(i)j =1 Ii with all the required properties for j = 1, . . . , n. Then p1 , . . . , pn forms a regular system of parameters over some neighborhood of a such that Xi is defined locally at a by the parameters tagged by ti . That is, the Xi are normal crossing at a. Next we informally present the algorithm that tries to prove normal crossing of given varieties along their intersection by constructing witness regular
Algorithmic Tests for the Normal Crossing Property
13
parameter systems. For given local sregular representations (Ui , p(i) , ti ) of the varieties Xi , i = 1, . . . , s, let U = i=1 Ui ; we consider all the regular parameter systems and varieties restricted to U . Let Ii define Xi over U and let us also s assume that S = U ∩ i=1 Xi is nonempty (otherwise we have nothing to do). We try to unify the p(i) using the observations of Lemma 2, searching through all arrangements of the parameter systems. Our first goal is to compute local regular representations in which the regular parameter systems are the same for each Xi . Thus we start from a given list of local regular representations (one for each Xi ) and search through arrangements of their parameter systems to find ones that allow exchanges of elements from the corresponding ideal intersections. Algorithm CommonRR; Input: A list of regular representations ((Uij , p(ij) , tij ) | j = 1, . . . , mi ) of varieties Xi , i = 1, . . . , s, with derivation matrices Pij . Output: true, and (((Uij , p(ij) , tij ) | i = 1, . . . , s) | j = 1, . . . , m) a list of branches regular representations of the Xi over giving rise to U = i j Uij ⊃ S = i Xi , where for each fixed j, p(ij) is the same for all i. Or false if the varieties are not normal crossing over W , and then the list of regular representations is such that S \ U are the points where the varieties are not normal crossing. CommonRR(((((U sij , p(ij) , tij ), Pij ) | j = 1, . . . , mi ) | i = 1, . . . , s)) LW := (); S := i=1 Xi ; if S = ∅ then return (true, ()); for (j1 , . . . , js ) = (1, . . . , 1) to (m1 , . . . , ms ) do for each arrangement of the parameters in p(1j1 ) , . . . , p(sjs ) do L := ((((Uiji , p(iji ) , tiji ), Piji ) | i = 1, . . . , s)); // start with a single branch for j = 1 to n do N := (); // N collects branches created at index j for each(((Ui , p(i) , ti ), Pi ) | i = 1, . . . , s) in L do T := (h | t(h)j = 1); U := si=1 Ui ; S = U ∩ S; let Ii ⊆ OU define Xi ; F := (); if #T = 0 then F := (p(h)j | ∂p(l)j p(h)j = 0, l = 1, . . . , s); elif #T = 1 and ∂p(l)j p(T [1])j = 0, l = 1, . . . , s then F := (p(T [1])j ); #T else f1 , . . . , fr := l=1 IT [l] OU ; F := (fh | S ⊆ Sing(ZeroSet(fh )), ∂p(l)j fh = 0, l = 1, . . . , s, h = 1, . . . , r); if #F = 0 then next; // this branch is dropped and we take the next // each element of F will give rise to a separate branch for h = 1 to #F do // we get rid of extraneous components and prepare exchange for i = 1 to s do f1 , . . . , fri := (t(i)j F [h] + t(i)l p(i)l | l = j ) : Ii ; ((Vil , pl(i) , Pil ) | l = 1, . . . , ri + 1) := Cover ((Ui , p(i) , Pi ), (F [h]) + (fm ∂p(i)j F [l] | m = 1, . . . , ri )); for (l1 , . . . , ls ) = (2, . . . , 2) to (r1 + 1, . . . , rs + 1) do // exchange and create new branches i , Pili ) := for i = 1 to s do (Vili , pl(i) i Exchange((Vili , pl(i) , Pili ), j, F [h], (∂pli F [h])−1 ); (i)j
i , ti ), Pili ) | i = 1, . . . , s) to N ; append (((Vili , pl(i)
14
G´ abor Bodn´ ar
L := N ; s append (((Ui , p(i) , ti ) | i = 1, . . . , s) | S ∩ i=1 Ui = ∅, (((Ui , p(i) , ti ), Pi ) | i = 1, . . . , s) ∈ L) to LW ; s #LW if S ⊆ i=1 j=1 LW [j][i][1] then return (true, LW ); return (false, LW ); Such a list of local regular representations that we handle together in the hope that we will be able to reach the first goal (via several parameter exchanges and maybe by passing to open subsets) we call a branch. Definition 5. Using the notation of the previous three paragraphs, we define a branch to be a list ((Ui , p(i) , ti ) | i = 1, . . . , s), where (Ui , p(i) , ti ) is a local regular representation of Xi . We call a branch a local witness of the normal crossing of the Xi along their intersection in U iff all the p(i) in it are the same over U . Our second goal is to find sufficiently many local witnesses such that the intersection for all i of the open subsets over which the local regular representations give rise to regular representations for the Xi , contain S. We organize the search by going through all arrangements of the parameter systems, treating the indices incrementally. We may have to pass to open subsets in order to perform the exchange operations, which results in a tree of branches as the search progresses. We always consider the leaves of this tree. If on a certain branch we find no locally exchangeable elements at a certain index, the branch is dropped. Completed branches, on the other hand, provide local witnesses. The complete description of unifying local regular representations can be found in algorithm CommonRR. This time, in order to keep the presentation simple, we do not expand purely technical subalgorithms like “go through each arrangements of the parameter systems.” As usual the instruction “next” starts immediately the next execution of the innermost loop. Theorem 2. Given a list ((((Uij , p(ij) , tij ), Pij ) | j = 1, . . . , mi ) | i = 1, . . . , s) of regular representations for the Xi . If the represented varieties are normal crossing along their intersection, the procedure call CommonRR returns true and a list of local witnesses as given in its output specifications in finitely many steps. Otherwise it returns false, and the local regular representations cover some neighborhood of the points of the intersection of the Xi at which they are normal crossing but contain none of the points where they are not normal crossing. Proof. The notation comes from the algorithm CommonRR. The termination of the procedure follows from the fact that each loop runs only finitely many times and in the innermost loop only finitely many branches are created at each run. Assume that the input describes varieties which are normal crossing along their intersection. The existence of suitable arrangements of the parameter systems to construct local witnesses of normal crossing in some neighborhood of a point a ∈ S is ensured by Lemma 2. The construction, i.e. the local regular representation, is locally stable, thus, because of noetherianity, there is always
Algorithmic Tests for the Normal Crossing Property
15
a finite covering of (some neighborhood of) S so that one can choose the same witness at each point in an open subset of this covering. Since the algorithm examines all possible arrangement of the parameter systems starting with each possible initial branch and considers each locally exchangeable element from finite generating sets of the corresponding intersections of ideals at each index, which is sufficient by Lemma 1, moreover because it takes the largest possible open subsets over which the parameter exchange can be performed, the resulting local regular representations cover S. There are two more details to be settled here. The first is that since we have to exchange elements into the parameter system of a local regular representation of a variety that come from the intersection of its ideal with other ideals, after exchanging the parameter, extraneous components may appear. We eliminate them by passing to open subsets which do not contain them and whose union contains all points in their complement. The extraneous components cannot meet S because by definition the new parameter (which introduced them) has normal crossing with all the other parameters in the new system, at each point of the intersection of S and the open subset over which the exchange is possible. If an extraneous component passed through one of these points, the variety would become singular there and this would contradict the fact that the new parameter system provides a local regular representation for it at the point in question. The other issue is to make sure that for each j the new parameter pj fulfills pj − pj (a) ∈ p1 − p1 (a), . . . , pj−1 − pj−1 (a) OW,a for all a in the open subset over which the new parameter system will be considered. This is ensured by the fact that at index j we test local exchangeability with respect to the parameter systems in which the first j − 1 entries are already the new ones. That is, we construct the regular parameter system of a local witness (which is the same for all the local regular representations in it) in a way that we have regular parameter systems at each intermediate step of the process. Assume now that the varieties are not normal crossing over S ⊆ S, and let us take an a ∈ S. By Lemma 2 at each arrangement of the parameter systems there is an index j at which we cannot find a locally exchangeable element in the intersection of the ideals of the varieties identified by the tags at index j. Therefore, by Lemma 1, no branch containing a can complete and enter in LW . On the other hand, the varieties are normal crossing over W \ S thus the construction applies for this subset and the output verifies the normal crossing property over some neighborhood of S \ S. Remark 6. The worst case complexity of the algorithm is clearly super exponential. This causes a problem from the efficiency point of view mostly when the varieties are not normal crossing, since this fact is found out only after the search is completed. To ease this problem, if one does not need the regular representations over S \ S (defined in the proof of Theorem 2), in case the varieties are not normal crossing, the algorithm can be interrupted as soon as an ideal intersection is found in which all the (finitely many) generators define singular hypersurfaces at some point of the intersection of the varieties (see Remark 5(i)).
16
G´ abor Bodn´ ar
There is another technique with which we can reduce the number of local witnesses in the output and which deserves a few more words. It is referred by the name “focus” strategy in [12, 13]. Briefly, it requires the addition of a new data entry to local regular representations, let us call it F , which is a (possibly empty) list of polynomials. Consider a regular representation X of some nonsingular X. The role of F is to define the subset of Ui of a local regular representation in X , which is not covered by the Uj of X with j < i. Initially F := () and in the exchange operations it does not change its value. In a cover operation with input f1 , . . . , fl , when i > 1, for the ith new subset we append f1 , . . . , fi−1 to F (which is the “focus” for the input subset), to obtain the new “focus” for the ith output subset. We benefit from the data of F in the computations in that we know, when ZeroSet(F ) = ∅ over the underlying subset Ui , every point of Ui is already contained in subsets with smaller indices, thus Ui is redundant. Or, since for us only S, the intersection of the varieties is interesting, we can declare Ui redundant even if ZeroSet(F ) ∩ S = ∅. If in a branch we find that all the Ui are redundant, the whole branch can be dropped without loss of data that is relevant for the computation. 4.3
Normal Crossing Test for Varieties
The test of the normal crossing property for given varieties X1 , . . . , Xs ⊂ W is described by the algorithm isNC. It uses the algorithm RegularRepresentation to compute initial representations for the varieties. Then for each subset of the set of input varieties, the corresponding regular representations are checked by the algorithm CommonRR along their intersection. Algorithm isNC; Input: W a nonsingular affine variety, and varieties X1 , . . . , Xs ⊂ W . Output: true or false, indicating the normal crossing property of the input varieties in W , and a list of branches giving rise to regular representations of the Xi over some neighborhood of the points where the Xi are normal crossing. isNCH (W , (X1 , . . . , Xs )) let p be a regular system of parameters over W with derivation matrix P ; n := dim(W ); N C := true; for l = 1 to s do Ri := RegularRepresentation(W, p, (0 | i = 1, . . . , n), P , Xi ); for l = 1 to s do for each {i1 , . . . , il } ⊆ {1, . . . , s} do (N, L) := CommonRR((Ri1 , . . . , Ril )); append L to LW ; if not N then N C := false; return (N C, LW );
Algorithmic Tests for the Normal Crossing Property
17
Theorem 3. Given X1 , . . . , Xs ⊂ W , calling isNC (W, (X1 , . . . , Xs )) determines in finitely many steps whether the varieties are normal crossing over W and returns a list of local witnesses which gives rise to regular representations of the varieties over some subset of W which does not contain the points where the Xi are not normal crossing. Proof. The claim follows from the termination and the correctness of the subalgorithms and from the fact that the algorithm performs an exhaustive search.
5
An Extended Example
The algorithm in Sect. 3 is straightforward; therefore in this section we present an example only for the general case, discussed in Sect. 4. Let k := Q, W := A3k , OW := k[x1 , x2 , x3 ], p := (x1 , x2 , x3 ), P := 13 . Let X1 be defined by I1 := x2 , (x1 − 1)2 + x23 − 1 and X2 be defined by I2 := x3 , (x1 + 1)2 + x22 − 1 (see Fig. 2(a)). In the first phase, we compute local regular representations for the varieties, e.g. for X1 we call RegularRepresentation((W, p, (0, 0, 0)), P , X1 ). The algorithm finds that x2 ∈ I1 is a regular parameter (case 1); therefore it tags it, and calls itself with (W, p, (0, 1, 0)), P , X1 . Naturally I1 = p2 + f1 = x2 + (x1 − 1)2 + x23 − 1 where (x1 − 1)2 + x23 − 1 ≡ 0 mod x2 , and we are in case 3 since neither ∂p1 f1 = 2x1 − 2 nor ∂p3 f1 = 2x3 is invertible over W . We pass to open subsets by Cover ((W, p, P ), (∂p1 f1 , ∂p3 f1 )), Obtaining: – U11 OU11 = k[x1 , x2 , x3 , x4 ]/x4 (2x1 − 2) − 1 , over which we can call Exchange((U11 , p(11) , P11 ), 1, (x1 − 1)2 + x23 − 1, x4 ), – U12 OU12 = k[x1 , x2 , x3 , x4 ]/2x4 x3 − 1 , over which we can call Exchange((U12 , p(12) , P12 ), 3, (x1 − 1)2 + x23 − 1, x4 ).
(a)
(b)
(c)
Fig. 2. (a): X1 , X2 , (b),(c): the relevant subsets of the local regular representation of X1
18
G´ abor Bodn´ ar
Over U11 and U12 the situation is analogous (see Figs. 2(b)(c)), so let us take, say, U11 , where after the exchange operation we get (U11 , p(11) = ((x1 − 1)2 + x23 − 1, x2 , x3 ), (1, 1, 0)) with P11 : x4 0 0 −2x34 0 1 0 0 . −2x3 x4 0 1 4x3 x34 In the following we do not present the derivation matrices since they become more cumbersome. Over U11 the first parameter p(11)1 gets tagged while over U12 it is the third, p(12)3 . For these subsets the next recursive call will find s = r, i.e. the number of tagged parameters is the same as the codimension of X1 , so it returns immediately. The computed regular representation X1 of X1 consists of two local regular representations: – (U11 , ((x1 − 1)2 + x23 − 1, x2 , x3 ), (1, 1, 0)), – (U12 , (x1 , x2 , ((x1 − 1)2 + x23 − 1), (0, 1, 1)). Analogously, for X2 we get X2 : – (U21 , ((x1 + 1)2 + x22 − 1, x2 , x3 ), (1, 0, 1)), – (U22 , (x1 , (x1 + 1)2 + x22 − 1, x3 ), (0, 1, 1)). Then, in the second phase of the algorithm, for each nonempty subset of {X1 , X2 } we call CommonRR. The first is {X1 }, in which the intersection S is X1 itself, and the outermost loop simply runs through the local regular representations in X1 . Each of them will result an execution without branching, because the “common” parameters are the ones in the regular parameter systems no matter which arrangement we take. When the second local regular representation is processed for the first time the condition that S is covered by the Ui of the local regular representations in LW is satisfied and the algorithm returns true. The procedure is analogous for {X2 }. When {X1 , X2 } is passed to CommonRR, nothing interesting happens when one of the chosen local regular representations is over U12 or U22 . In these cases one (or both) of the varieties is outside U , the open subset under consideration. So let us take (U11 , ((x1 −1)2 +x23 −1, x2 , x3 ), (1, 1, 0)) for X1 and (U21 , ((x1 + 2 1) +x22 −1, x2 , x3 ), (1, 0, 1)) for X2 . Their intersection U can be defined by OU = k[x1 , x2 , x3 , x4 , x5 ]/x4 (2x1 − 2) − 1, x5 (2x1 + 2) − 1 , and the inclusion map U '→ U11 gives rise to the ring homomorphism OU1 → OU , xi → xi , i = 1, 2, 3, 4, while for U21 it is xi → xi , i = 1, 2, 3 and x4 → x5 . For the arrangement that does not change the initial order of the parameters, we get that for index 1 there are two tagged parameters and that in the ideal intersection (I1 ∩ I2 )OU there is an element which is exchangeable for both parameter systems at this index: f = x31 + x22 x1 + x1 x23 + 2x23 − 4x1 − 2x22 (see figure 3(a)). The redundant component appearing in X1 is a line parallel to the x3 -axis standing at the point (−2, 0, 0), whose ideal over U is generated
Algorithmic Tests for the Normal Crossing Property
(a)
(b)
19
(c)
Fig. 3. (a): ZeroSet(f ), (b),(c): extraneous components appearing in X1 , X2 respectively
by x2 , x1 + 2 (see Fig. 3(b)). Moreover the element we have to make invertible over U11 is ∂p(11)1 f = (3x21 + x22 + x23 − 4)x4 , which is nonvanishing at S. For X2 the redundant component is another line parallel to the x2 -axis passing through the point (2, 0, 0), whose ideal over U is generated by x3 , x1 − 2 (see Fig. 3(c)). Over U21 the partial derivative which we have to make invertible is formally the same as the one over U11 (as f is symmetric in x2 , x3 and swapping → −x1 , which is hidden in the partial derivative them in p(11)1 , p(21)1 induces x1 since it is quadratic in x1 ): ∂p(2)1 f = (3x21 + x22 + x23 − 4)x4 . In the cover operations we have to make the corresponding partial derivative and a generator of the extraneous component invertible simultaneously, thus we take their product. For instance U11 is covered along f, x2 ∂p(11)1 f, (x1 +2)∂p(11)1 f . The first subset will always be disjoint from S; therefore it will be discarded in the next loop, where the subsets obtained from U11 and U21 are combined. In this example four branches are created and collected in N . After the exchange operations are done, in the new branches we have regular representations for X1 and X2 in which the first regular parameters are the same. As the algorithm continues for index two and three, it needs to do nothing since there is only one parameter tagged at both indices which actually appears in both of the parameter systems. Thus the branches complete, and since S will be contained by the intersection of the union of the open subsets in the regular representations of X1 , X2 given by these branches, the termination condition is fulfilled. We can also note that the branches over which x2 ∂p(11)1 f or x3 ∂p(21)1 f were made invertible are again disjoint from S. Thus the only interesting branch is: – X1 : (U, (f, x2 , x3 ), (1, 1, 0)), – X2 : (V, (f, x2 , x3 ), (1, 0, 1)), where OU ∼ = k[x1 , x2 , x3 , x4 , x5 ]/x4 (2x1 − 2) − 1, x5 (x1 + 2)(∂p(11)1 f ) − 1 and OV ∼ = k[x1 , x2 , x3 , x4 , x5 ]/x4 (2x1 + 2) − 1, x5 (x1 − 2)(∂p(21)1 f ) − 1 (the partial
20
G´ abor Bodn´ ar
derivatives are naturally included in the superrings). This branch is a witness of the normal crossing of X1 and X2 .
References [1] Hironaka, H.: Resolution of singularities of an algebraic variety over a field of characteristic zero I-II. Ann. Math. 79 (1964) 109–326 1 [2] Hauser, H.: Seventeen obstacles for resolution of singularities. In Arnold, V.I., Greuel, G.M., Steenbrink, J., eds.: Singularities. The Brieskorn Anniversary Volume. Birkh¨ auser, Boston (1998) 1 [3] de Jong, A.J.: Smoothness, semi-stability and alterations. Publ. Math. IHES 83 (1996) 189–228 1 [4] Encinas, S., Villamayor, O.: A course on constructive desingularization and equivariance. In Hauser, H., Lipman, J., Oort, F., Quir´ os, A., eds.: Resolution of Singularities, A research textbook in tribute to Oscar Zariski. Volume 181 of Progress in Mathematics., Basel, Birkh¨ auser (2000) 1 [5] Villamayor, O.: Constructiveness of Hironaka’s resolution. Ann. Scient. Ecole Norm. Sup. 4 22 (1989) 1–32 1 [6] Bodn´ ar, G., Schicho, J.: desing – A computer program for resolution of singularities. RISC, Johannes Kepler University, Linz, Austria (1998-2003) Available at http://www.risc.uni-linz.ac.at/projects/basic/adjoints/blowup. 1 [7] Bodn´ ar, G., Schicho, J.: Automated resolution of singularities for hypersurfaces. Journal of Symbolic Computation 30 (2000) 401–428 1, 7 [8] Bodn´ ar, G., Schicho, J.: A computer program for the resolution of singularities. In Hauser, H., Lipman, J., Oort, F., Quir´ os, A., eds.: Resolution of Singularities, A research textbook in tribute to Oscar Zariski. Volume 181 of Progress in Mathematics. Birkh¨ auser, Basel (2000) 231–238 1 [9] Becker, T., Weispfenning, V.: Gr¨ obner bases - a computational approach to commutative algebra. Graduate Texts in Mathematics. Springer, New York (1993) 6 [10] Buchberger, B.: An Algorithm for Finding a Basis for the Residue Class Ring of a Zero-Dimensional Polynomial Ideal. PhD thesis, Universit¨ at Innsbruck, Institut f¨ ur Mathematik (1965) German. 6 [11] Hartshorne, R.: Algebraic Geometry. Springer, New York (1977) 7 [12] Bodn´ ar, G., Schicho, J.: An improved algorithm for the resolution of singularities. In Traverso, C., ed.: Proceedings of ISSAC 2000, New York, Association for Computing Machinery (2000) 29–36 16 [13] Bodn´ ar, G., Schicho, J.: Two computational techniques for singularity resolution. Journal of Symbolic Computation 32 (2001) 39–54 16
The Projection of Quasi Variety and Its Application on Geometric Theorem Proving and Formula Deduction XueFeng Chen and DingKang Wang Key Laboratory of Mathematics Mechanization, Institute of Systems Science, AMSS, Academia Sinica, Beijing 100080, P.R. China {xfchen, dwang}@mmrc.iss.ac.cn
Abstract. In this paper, we present an algorithm to compute the projection of a quasi variety over an algebraic closed field. Based on the algorithm, we give a method to prove geometric theorem mechanically, and the non-degenerate conditions that we get by the method are proved to be the ”weakest”, i.e. the geometric theorem is true if and only if these non-degenerate conditions are satisfied. A method for automatic geometric formula deduction is also proposed based on the algorithm. The algorithm given in this paper has been implemented in computer algebra system Maple.
1
Introduction
Wu’s method[1], as well as others based on computing of Gr¨ obner basis, has been fruitfully applied to automatic theorem proving in elementary geometry. Using Wu’s method, more than 600 theorems have been proved by computer[2]. For both Wu’s method and Gr¨ obner basis method, often a geometric theorem is true only in a ”generic” sense, that is, certain degenerate cases must be ruled out. As for other methods based on Gr¨ obner bases, various way to find nondegenerate conditions are reported. Kapur[3] describes a complete method of Gr¨ obner bases to prove geometry theorems, including how to obtain nondegenerate conditions. As Kapur claims that ”conditions found using this approach are often simple and weaker than the ones reported by using Wu’s method or reported by Kutzler & Stifter’s [4] and Chou & Schelter [5] based on the Gr¨ obner basis method.” F.Winkler[6] has given a method whereby to compute the simplest nondegenerate conditions. His criteria for simplest is ”of as low a degree as possible” or ”involving only certain variables.” In many cases, the non-degenerate condition is too strong. The theorem is still true even the non-degenerate condition is not satisfied. F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 21–30, 2004. c Springer-Verlag Berlin Heidelberg 2004
22
XueFeng Chen and DingKang Wang
In this paper, we present an algorithm of the projection of quasi variety which is based on Wu’s method and his theorems about the projection of quasi variety[7]. A new method is given for mechanical geometric theorem proving and formula deduction based on the projection of quasi varieties. During proving geometry theorem, the weakest non-degenerate conditions can be obtained by this method. Moreover, the variables occurring in such conditions are determined in advance. As for geometry formula deduction, we can derive all conclusions about certain variables. At last, we give two examples to show how the method works.
2
Non-degenerate Condition and Projection of Quasi Variety
In this paper, all polynomials are in polynomial ring K[x1 , · · · xn ], where K is a computable field of character 0. E is an algebraic closed extension field of K. For a geometric theorem, after setting up an appropriate coordinate system, the corresponding geometric configuration of hypothesis can be expressed by a finite set of polynomial equations P S = 0 i.e. P S = {p1 , · · · , ps }, p1 = 0, · · · , ps = 0, pi ∈ K[x1 , · · · , xn ]. The geometric configuration of the conclusion can be expressed by a polynomial equation C = 0, i.e. c = 0, c ∈ K[x1 , · · · , xn ]. If P S = 0 ⇒ C = 0, then the theorem T = (P S, C) is called to be universally true. i.e. ∀x ∈ E n , p1 (x) = 0, · · · , ps (x) = 0 ⇒ c(x) = 0. In most cases, a geometric theorem is not universally true. It is true only if the non-degenerate condition is satisfied. g = 0 is called the non-degenerate condition if (I)(∀x ∈ Kn )(p1 (x) = · · · = ps (x) = 0 ∧ g(x) = 0 ⇒ c(x) = 0) (II)(∃x ∈ Kn )(p1 (x) = · · · = ps (x) = 0 ∧ g(x) = 0) From the above definition, we can see that the non-degenerate condition is a sufficient condition for a geometric theorem to be true. Wu’s non-degenerate condition: In Wu’s method, the non-degenerate condition is defined as the product of the initials of the characteristic set notequal to zero. Suppose CS : C1 , · · · , Cm is the characteristic set of P S, J = i Ii where Ii is the initial of Ci . If the pseudo-remainder of the conclusion polynomial C w.r.t the characteristic set CS is 0, i.e. there are non-negative integers si s.t. sm I1s1 · · · Im C = Q1 C1 + · · · + Qm Cm + 0, then J = 0 is the non-degenerate condition for the theorem to be true. obner basis of ideal (PS) Kapur’s non-degenerate condition: Let G1 , G2 be the Gr¨ and (P S ∪ {Cz − 1}). if G1 = {1} and G2 = {1}, then the theorem is true when gi = 0. If gi satisfy / (P S) (a)gi ∈ G2 ∩ K[x] ∧ gi ∈ (b)1 ∈ / Gr¨ obnerBasis(P S ∪ {gi z − 1}) gi = 0 is the non-degenerate condition.
The Projection of Quasi Variety and Its Application
23
Winkler’s non-degenerate condition: Winkler has proved that all polynomials satisfying (I) constitute an ideal, and among the polynomials in the Gr¨ obner basis of the ideal which satisfies (II), there is a polynomial g which has the least leading term, g = 0 is the simplest non-degenerate condition. All the non-degenerate conditions mentioned above, are sufficient conditions for a geometric theorem to be true. Let P S be a polynomial set and D be a single polynomial in K[x1 , · · · , xn ]. E is an algebraic closed extension field of K as before. We define Zero(P S) = {e ∈ E n |∀P ∈ P S, P (e) = 0} = 0} Zero(/D) = {e ∈ E n |D(e) Zero(P S/D) = Zero(P S) Zero(/D) Definition 1. (Quasi Variety)For any finite number of polynomial sets P Si and polynomials Gi in K[x1 , · · · , xn ], the set Zero(P Si /Gi ) i
is called a quasi variety. Definition 2. (Projection)To eliminate variables xm+1 , · · · , xn , the map projection is P rojxm+1 ,··· ,xn : E n → E m which sends (a1 , · · · , an ) to (a1 , · · · , am ). If V is an affine variety in E n , P rojxm+1 ,··· ,xn (V ) may not be a variety in E m , but it is contained in a variety in E n . For a polynomial set P S and a polynomial D , we apply projection P rojxm+1 ,··· ,xn to Zero(P S/D). Then we have P rojxm+1 ,··· ,xn Zero(P S/D) = {e ∈ E m | ∃a ∈ E (n−m) s.t.(e, a) ∈ Zero(P S/D)} when m = 0, we define P rojx1 ,··· ,xn Zero(P S/D) = true, if Zero(P S/D) = ∅; and f alse otherwise. The projection of a quasi variety in E n to E m is a quasi variety in E m . Please see[7] for the details. The projection of a quasi variety has been investigated by Wu[7],Wang[8] and Gao[10].
3
Algorithm to Compute Projection of Quasi Variety
In Wu[7], a method for computing the projection of a quasi variety is given. Before giving a new algorithm, we will give several theorems which are needed for constructing the new algorithm.
24
XueFeng Chen and DingKang Wang
Theorem 1. Let P S be a polynomial set and D a polynomial , there is an algorithm to decompose P S into a finite set of ascending set ASi s.t. Zero(P S/D) = Zero(ASi /Ji D) i
where each ASi is an ascending set, Ji is the production of the initials of the polynomials in ASi . The proof and the algorithm can be found in Wu [1]. In [9], an improved algorithm has been given to decompose a polynomial set into a series of ascending sets. Lemma 1. If Zero(P S/D) = i Zero(ASi /Ji D), then we have P rojxm+1 ,··· ,xn Zero(P S/D) = P rojxm+1 ,··· ,xn Zero(ASi /Ji D) i
Proof. It is enough to prove P rojxm+1 ,··· ,xn i Zero(ASi /Ji D) = i P rojxm+1 ,··· ,xn Zero(ASi /J i D). Take any element a = (a1 , · · · , am ) ∈ E m from P rojxm+1 ,··· ,xn i Zero(ASi / Ji D), then there exists a = (am+1 , · · · , an ) ∈ E (n−m) s.t. (a1 , · · · , an )∈ i Zero(ASi /Ji D), then there exists an i s.t. (a1 , · · · , an ) ∈ Zero(ASi /Ji ). According to the definition of projection, (a1 , · · · , am ) ∈ P rojxm+1 ,··· ,xn Zero(ASi /Ji ), it follows that a= (a1 , · · · , am ) ∈ ∪i Projxm+1 ,··· ,xn Zero(ASi /Ji D). It shows P rojxm+1 ,··· ,xn i Zero(ASi /Ji D) ⊂ i P rojxm+1 ,··· ,xn Zero(ASi /Ji D). The inclusion of reversal direction also can be proved by the same way. Lemma 2. AS = {A1 , · · · As } is an ascending set w.r.t. variable ordering (x1 < x2 < · · · < xn ),AS = {A1 , · · · , As−1 }, J and J are the products of the initials of polynomials in AS and AS respectively. Is is the initial of As . d = degree(As , xn ), R = P rem(Dd , As , xn ). 1. if degree(As , xn ) = 0, degree(D, xn ) = 0 then P rojxm+1 ,··· ,xn Zero(AS/JD) = P rojxm+1 ,··· ,xn Zero(AS /J (Is R)) 2. if degree(As , xn ) = 0, degree(D, xn ) = 0 then P rojxm+1 ,··· ,xn Zero(AS/JD) = P rojxm+1 ,··· ,xn−1 Zero(AS /J (Is D)) i 3. if degree(As , xn ) = 0, degree(D, xn ) = 0 Let D = i=0 Di xn , Di ∈ K[x1 , · · · , xn−1 ], then P rojxm+1 ,··· ,xn Zero(AS/JD) = P rojxm+1 ,··· ,xn−1 Zero(AS /J (Is Di )) i
4. If degree(As , xn ) = 0, degree(D, xn ) = 0, then P rojxm+1 ,··· ,xn Zero(AS/JD) = P rojxm+1 ,··· ,xn−1 Zero(AS/JD))
The Projection of Quasi Variety and Its Application
25
Proof. (1)(2)(4) are obviously according to the definition of projection and the fundamental theorem of algebra. For (3), please see [7] for details. According to the lemmas given above, we can eliminate one variable. All the variables which will be eliminated can be eliminated successively if we compute it recursively. Let P S be a polynomial set and D be a polynomial in K[x1 , · · · , xn ]. If we want to compute P rojx1 ,··· ,xn Zero(P S/D). The computing process can be divided into two steps. The variable ordering should be xn > · · · > xm+1 > xm > · · · > x1 . Under this variable ordering, first we will decomposethe polynomial set P S into a series of ascending sets ASi s.t. Zero(P S/D) = i Zero(ASi /Ji D). Each ASi is an ascending set for the variable ordering xn > · · · > xm+1 > xm > · · · > x1 . Then for each Zero(ASi /Ji D) we can compute its projection. In the following, we will give the algorithm in detail. Step 1. Decompose polynomial set P S into a series of ascending sets ASi s.t. Zero(ASi /Ji D) Zero(P S/D) = i
where Ji is the product of the initials of the polynomials in ASi . Please see [9] for the detail of the algorithm. Step 2. Compute the projection of Zero(AS/JD), AS is an ascending set. J is the product of the initials of the polynomials in AS,D is a polynomial. ProjectAS(AS,J,D,X,Y) Input: AS: an ascending set w.r.t X; D: a polynomial; J: the product of the initials of the polynomials in AS; X: a list of all variables with descending order; Y: a list of variables to be eliminated, also with descending order; Output: a list, its element is also a~list with the form [’as’,’d’], ’as’ is an ascending set and ’d’ is a~polynomial. begin y:=First(Y), A:=Last(AS); Y’:=Y/y, AS’:=AS/A; I:=initial(A); if Y = [ ] then result:=(AS,J*D); if degree(A,y) =0 and degree(D,y)=0 then result:= ProjectAS(AS,J,D,X,Y’); else if degree(A,y) != 0 and degree(D,Y)=0 then
26
XueFeng Chen and DingKang Wang
result:= ProjectAS(AS’,J’,I*D,X,Y’); else if degree(A,y)=0 and degree(D,y) != 0 then result:=[]; cf:=coeffs(D,y); for each c in cf do { result:= result union ProjectAS(AS,J,c,X,Y’); } else if degree(A,y)!= 0 and degree(D,y) != 0 then d:=degree(A,y); R:=Prem(D^d,A,y); result:= ProjectAS(AS’,J’,I*R,X,Y); end if return result; end In the above algorithm, ”/” means a list gotten by removing the element behind it from the list before it; ”!=” means not equal to; initial(A) return the initial of A; degree(A, y) return the degree of the polynomial A w.r.t the variable y; coef f s(D, y) return a list composed of all the coefficients of the polynomial D w.r.t variable y. P rem(Dd , A, y) return the pseudo-remainder of Dd to A w.r.t variable y.
4
Application on Geometry Theorem Proving and Formula Deduction
Let K = Q be the rational number field. E = C be the complex number field. The corresponding geometric configuration of hypothesis is expressed by a finite set of polynomial equations P S = 0 i.e. P S = {p1 , · · · , ps }, p1 = 0, · · · , ps = 0, pi ∈ Q[x1 , · · · , xn ]. The geometric configuration of the conclusion is expressed by a polynomial equation C = 0.i.e..c = 0, c ∈ Q[x1 , · · · , xn ]. We will divide the the variables x1 , · · · , xn into two parts x1 , · · · , xm and xm+1 · · · , xn . Applying P rojxm+1 ,··· ,xn to the quasi variety Zero(P S/C), the following theorem determines that a geometric theorem is universally true or not. If not, a series of polynomial equations and inequations about the variables x1 , · · · , xm are given(i.e. P rojxm+1 ,··· ,xn Zero(P S/C)) , which is the sufficient and necessary condition for the theorem to be false. Theorem 2. For polynomial set P S and polynomial C as shown above, then (1) if P rojxm+1 ,··· ,xn Zero(P S/C) = ∅ and P rojxm+1 ,··· ,xn Zero(P S/D) = ∅, then the theorem T is universally true. (2) if P rojxm+1 ,··· ,xn Zero(P S/C) = ∅, ∀(a1 , · · · , am ) ∈ P rojxm+1 ,··· ,xn Zero(P S /C) , then there is (am+1 , · · · , an ) s.t. P S(a1 , · · · , an ) = 0 and C(a1 , · · · , an ) = 0; (3) if there is (a1 , · · · , an ) s.t. P S(a1 , · · · , an ) = 0 and C(a1 , · · · , an ) = 0, then
The Projection of Quasi Variety and Its Application
27
(a1 , · · · , am ) ∈ P rojxm+1 ,··· ,xn Zero(P S/C), so that P rojxm+1 ,··· ,xn Zero(P S/C) is not empty. Proof. (1)we claim that P rojxm+1 ,··· ,xn Zero(P S/C) = ∅ ⇔ Zero(P S/C) = ∅. It is obviously by the definition of projection. Since P rojxm+1 ,··· ,xn Zero(P S/C) = ∅, it follows that Zero(P S/C) = ∅, i.e. Zero(P S) ⊆ Zero(C) i.e. ∀ a = (a1 , · · · , an ) ∈ E n , p1 (a) = 0, · · · , ps (a) = 0 ⇒ c(a) = 0 so that the theorem T = (P S, C) is universally true. (2)(3) are obviously by the definition of projection. Based on the above theorem, we can prove geometric theorem mechanically and give the non-degenerate conditions automatically by computing the projection of a quasi variety . It’s obvious to see that we can predetermine the variables occurring in nondegenerate conditions. So it’s convenient for us to observe the range of possible value for any variables. As a rule, we will eliminate all the dependent variables . Moreover, we can be certain that the conditions found through this method are the weakest compared to the condition obtained by Wu’s method and the others based on Gr¨obner basis such as Kapur’s and Winkler’s approaches. Now we consider the application of projection method on formula deduction. Theorem 3. The hypothesis of a geometric statement is expressed by a set of polynomial equations P S = 0, then P rojxm+1 ,··· ,xn Zero(P S) gives a series of polynomial equations and inequations which involve the variables x1 , · · · , xm only. While deducing the unknown geometric formula by the projection method, all the variables which do not occur in the final formula will be eliminated.
5
Examples
In this section, we will give two examples to show that how the projection method is applied to automatic theorem proving and formula deduction. The first example is taken from Wang [8]. We will prove it by computing the projection of quasi variety and give the non-degenerate conditions and compared the result with Wu’s method. The second example is to derive the geometric formula automatically from the given hypothesis. Example 1. The bisectors of the three angles of an arbitrary triangle, three-tothree, intersect at four points. Let the triangle be ∆ABC, the two bisectors of ∠A and ∠B intersect at point D. We need to show that CD is the bisector of ∠C. We take the coordinates of the points as A(x1 , 0), B(x2 , 0), C(0, x3 ), D(x4 , x5 ). The hypothesis of the theorem consists of the following relations. H1 = x3 [x25 − (x4 − x1 )2 ] − 2x1 x5 (x4 − x1 ) = 0 (DA is the bisector of ∠ CAB) H2 = x3 [x25 − (x4 − x2 )2 ] − 2x2 x5 (x4 − x2 ) = 0 (DB is the bisector of ∠ ABC)
28
XueFeng Chen and DingKang Wang
C
D’
D A
O
B
Fig. 1. Three bisectors go through the same point
The conclusion to be proved is C = 0 C = [x1 (x5 − x3 ) + x3 x4 ][x3 (x5 − x3 ) − x2 x4 ]+ [x2 (x5 − x3 ) + x3 x4 ][x3 (x5 − x3 ) − x1 x4 ] The characteristic set of {H1 , H2 } is CS = [C1 , C2 ] C1 = x33 (x1 − x2 )x44 + lowerterms C2 = x3 (x1 − x2 )(x1 + x2 − x4 )x5 + lowerterms The pseudo-remainder of the conclusion polynomial C w.r.t the characteristic set CS is 0. The theorem is true under the non-degenerate conditions which are x3 = 0,x1 = x2 , and x1 + x2 − x4 = 0 in Wu’s sense. There are three degenerate cases. They are: Case 1 x1 = x2 . In this case, A and B are coincide, then ABC is not a real triangle anymore. Case 2: x3 = 0. In this case, C is on the line AB, the ABC is not a real triangle also. Case 3:x1 + x2 − x4 = 0. In this case, the intersection point of the bisectors is on line x = x1 + x2 . In Wu’s method, we can’t determine the theorem is true or not at this time. If we want to know if the theorem is still true, we should put the polynomial P = x1 + x2 − x4 to the original polynomial set {H1 , H2 } to form a new polynomial set {H1 , H2 , P }, compute its characteristic set again, and decide the theorem is true or not under the condition x1 + x2 − x4 = 0. Now we will prove the theorem and give the non-degenerate conditions by computing the projection of the quasi variety. In this example, x1 , x2 , x3 are the free variables and x4 , x5 are the dependent variables. We compute the projection of Zero({H1 , H2 }/C) to eliminate the variables x4 , x5 : P rojx4 ,x5 Zero({H1 , H2 }/C) = Zero({−x2 + x1 }/{x3 , x21 + 2 x3 }) Zero({−x2 + x1 , x3 }/{x1 })
The Projection of Quasi Variety and Its Application
29
N
R
Q
M A
P
O
B
Fig. 2. The relation among three line segments P Q,P M and P N
There are only two degenerate cases. They are: Case 1: x2 = x1 , x3 = 0. In this case, A is coincidence with B, and C is not on the line y = 0. Case 2: x1 = x2 and x3 = 0 and x1 = 0, In this case, A is coincide with B,but A is not coincide with C. This theorem is false only under these two degenerate cases and it is always true except these two degenerate cases. Example 2. Let R be a point on the circle with diameter AB. At a point P (not A or B) of AB a perpendicular is drawn meeting BR at N , AR at M ,the circle at Q, Find the relation among P Q,P M and P N . First, take the coordinate of the points as O = (0, 0), A = (x1 , 0), B = (x2 , 0), P = (x3 , 0), R = (x4 , x5 ), M = (x3 , y1 ), Q = (x3 , y2 ), N = (x3 , y3 ) The hypothesis is expressed as following polynomial equations. H1 H2 H3 H4 H5
= x1 + x2 (AB is diameter) = x21 − x25 − x24 (|AO| = |RO|) = −y3 (x4 − x3 ) − (x5 − y3 )(x2 − x3 ) (N, R, B are collinear) = x5 (x3 − x1 ) − y1 (x4 − x1 ) (A, M, R are collinear) = x21 − y22 − x23 (|AO| = |QO|)
Since we want to derive formula about P Q,P M and P N , it is a formula about the variables about y3 , y2 , y1 . Since P = A, P = B and A = O, let D = {x3 − x1 , x3 − x2 , x1 } in advance. Then eliminate the variables x5 , x4 , x3 , x2 , x1 by computing the projection of Zero({H1 , H2 , H3 , H4 , H5 }/D).
30
XueFeng Chen and DingKang Wang
P rojx5 ,x4 ,x3 ,x2 ,x1 Zero({H1 , H2 , H3 , H4 , H5 }/D) = Zero({y3 y1 − y22 }/{y2 }) ∪ Zero({y1 }/{y2}) ∪ Zero({y3 }/{y2 }) There are three degenerate cases. They are: Case 1: y3 y1 − y22 = 0, y2 = 0 i.e. When R doesn’t coincide with A or B, we have |P N | ∗ |P M | = |P Q|2 . Case 2: y1 = 0,y2 = 0 i.e. R coincides with B Case 3: y3 = 0,y2 = 0 i.e. R coincides with A
6
Conclusion
We give an algorithm to compute the projection over an algebraic closed field. Applying this algorithm to automatic theorem proving, we can get the weakest non-degenerate condition for which the theorem is true. In fact, we can get the sufficient and necessary condition for a geometric theorem to be false by computing the projection of a quasi variety. This algorithm also can be applied to automatic geometric formula deduction. There are more than one hundred geometric theorems which have been proved by this method. Experiments show that the projection of the quasi variety can be computed out if we can get the zero decomposition for the given polynomial system.
References [1] Wu Wen-tsun: Basic Principles of Mechanical Theorem Proving in Elementary Geometries, J.Sys.Sci.& Math. Scis., 4 (1984) 207-235 21, 24 [2] Shang-Ching Chou: Mechanical geometry theorem proving, D. Reidel, Dordrecht, Boston (1988) 21 [3] D.Kapur: Using Gr¨ obner bases to reason about geometry problems. Journal of Symbolic Computation, 2(4),(1986) 399-408 21 [4] Kutzler,B.,Stifter,S.: On the application of Buchberger’s algorithm to automatic Geometry theorem Proving, Journal of Symbolic Computation,2(4),(1986)389-397 21 [5] Chou,S. C.,Schelter,W. F.: Automated Geometry Theorem Proving Using Rewrite Rules, Dept of Mathematics, University of Texas, Austin.(1985). 21 [6] Franz Winkler: Automated Theorem Proving in Nonlinear Geometry, Advances in Computing Research, Volume 6, (1992) 138-197 21 [7] Wu Wen-tsun: On a Projection Theorem of Quasi-Varieties in Elimination Theory,MM Research Preprints, No.4, Ins. of Systems Science, Academia Sinica,(1991) 22, 23, 25 [8] Dongming Wang: Elimination method, Springer 2001. 23, 27 [9] Dingkang Wang: Zero Decomposition Algorithms for System of Polynomial Equations, Computer Mathematics, World Scientific, (2000) 67-70 24, 25 [10] X. S.Gao, S. C.Chou: Solving Parametric Algebraic Systems, Proc. of ISSAC’92, (1992) 335-341 23
Using Computer Algebra Tools to Classify Serial Manipulators Solen Corvez1 and Fabrice Rouillier2 1 2
IRMAR, Universit´e de Rennes I,France [email protected] LORIA, INRIA-Lorraine, Nancy, France [email protected]
Abstract. In this paper we present a classification of 3-revolute-jointed manipulators based on the cuspidal behaviour. It was shown in a previous work [16] that this ability to change posture without meeting a singularity is equivalent to the existence of a point in the workspace, such that a polynomial of degree four depending on the parameters of the manipulator and on the cartesian coordinates of the effector has a triple root. More precisely, from a partition of the parameters’space, such that in any connected component of this partition the number of triple roots is constant, we need to compute one sample point by cell, in order to have a full description, in terms of cuspidality, of the different possible configurations. This kind of work can be divided into two parts. First of all, thanks to Groebner Bases computations, the goal is to obtain an algebraic set in the parameters’space describing the cuspidality behavior and then to compute a CAD adapted to this set. In order to simplify the problem, we use strongly the fact that a manipulator cannot be constructed with exact parameters, in other words, we are just interested in the generic solutions of our problem. This consideration leads us to work with triangular sets rather than with the global Groebner Bases and to adapt the CAD of Collins as we will just take care of the cells of maximal dimension. Keywords: Groebner Basis, Cylindrical Algebraic Decomposition, Triangular Sets, Serial Manipulators, Semialgebraic Sets
1
Introduction
Industrial robotic 3-DOF manipulators are currently designed with very simple geometric rules on the designed parameters, the ratios between them are always of the same kind. In order to enlarge the possibilities of such manipulators, it may be interesting to relax the constraints on the parameters. The behavior of the manipulators when changing posture depends strongly on the design parameters and it can be very different from the one of manipulators commonly used in Industry. F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 31–43, 2004. c Springer-Verlag Berlin Heidelberg 2004
32
Solen Corvez and Fabrice Rouillier
d3
y z
θ3
r2
O
θ2
d2
d4 θ1
x
11111 00000 00000 11111 00000 11111
Fig. 1. The manipulator under our hypothesis P. Wenger and J. El Omri [9], [16] have shown that for some choices of the parameters, 3-DOF manipulators may be able to change posture without meeting a singularity in the joint space. This kind of manipulators is called cuspidal. It is worth noting that in case of obstructed environment, this property would yield more flexibility which can be very useful in practice for industrial purpose. They succeed in characterizing 3-revolute jointed manipulators using a homotopy based classification scheme [15], but they needed general conditions on the design parameters, more precisely they wanted to find answers to the following issues: – Problem 1 : For given parameters, is the manipulator cuspidal? – Problem 2 : How to obtain an algebraic set in the parameters’space such that in each connected components of the complementary, the cuspidality behavior is fixed? And then can we caracterize each connected component with a test manipulator? We restrict the study to 3-DOF manipulators as described in figure 1. The geometrical modelisation of the manipulator is explained in the first section of this paper. As recalled in the second section, testing if such a manipulator is cuspidal or not is equivalent to deciding if an algebraic set has real roots or not, this set corresponding to the existence of a triple root of a given polynomial of the fourth degree. We manage to answer both questions under a few hypotheses which are not restricting ones according to roboticians : for example it is impossible to construct, in practice, a manipulator whose parameters lies on a strict hypersurface of the space of the parameters. We explain in the third section how we obtained the algebraic set, depending only on the parameters, which complementary interests us for the study of the cuspidality behavior. Then in the fourth section, we show how to compute a partition of the space of parameters, such that in each cell of maximal dimension,
Using Computer Algebra Tools to Classify Serial Manipulators
33
the behavior of the manipulator is known (cuspidal or not), while the other cells are embedded inside a strict algebraic subset of the parameters’space. Many authors propose to use computer algebra tools for solving geometrical models of serial manipulators (see [7] for example), mainly using resultants theory. In this paper, the main computational objects are Gr¨ obner bases (as in [4]) and triangular sets ([2],[14]).
2
The Kinematic Map
The 4 design parameters are d2 , d3 , d4 and r2 . In order to normalize (d2 , d3 , d4 , r2 ) and to reduce the number of parameters, we assume that d2 is equal to 1. So the space of design parameters is (R+ )3 . Along our study of the behavior of the manipulator, we will work into two spaces: – the joint space described by the joint variables (θ1 , θ2 , θ3 ), this space is 3 isomorphic to ] − π, π] as the joint limits will be ignored. Moreover, as the manipulator turns around the axe of the first revolute joint, the joint space can be represented by the torus (in the variables (θ2 , θ3 )). – the task space representing the position of the end-effector in the Cartesian coordinates (x, y, z), which is isomorphic to R3 if we suppose there are no obstacles. The kinematic map f maps the joint space on the task space : f : ] − π, π]3 −→ R3 (θ1 , θ2 , θ3 ) −→ (x, y, z) The image of this map in the task space is called the workspace. To express f , we just have to express the change of bases between the bass of the origin and the basis of the effector, which gives us the following expression for f: x = (d3 + cos θ3 d4 )(cos θ1 cos θ2 ) + (r2 + d4 sin θ3 ) sin θ1 + cos θ1 y = (d3 + cos θ3 d4 )(sin θ1 cos θ2 ) − (r2 + d4 sin θ3 ) cos θ1 + sin θ1 (1) z = (d3 + cos θ3 d4 ) sin θ2 For the user, it is of first importance to know the workspace, he wants to be able to divide the task space into accessible or not accessible zones, and to know the number of joint’s configurations corresponding to the same position.
3
Algebraic Characterization of Cuspidal Manipulators
In the classical cases used in Industry, manipulators, to change posture, need to pass through a singularity of the joint space, in other words the end-effector must bump into the frontiere of the workspace.
34
Solen Corvez and Fabrice Rouillier
But this behavior is not general at all. It was shown by P. Wenger that a 3-DOF manipulator can execute a non singular change of posture if and only if there exist at least one point in its workspace with exactly three coincident inverse kinematic solutions (corresponding in a cross section of the workspace to cusp points, hence the word cuspidal). As it is difficult to express such a condition directly from the kinematic map, the idea is to eliminate joint variables from the system, let say θ1 and θ2 , in order to obain a condition over the last joint variable. By taking si = sin(θi ) and ci = cos(θi ), i = 1 . . . 3, and adding the algebraic relations s2i + c2i = 1 i = 1 . . . 3 to the equations defining f , we have to study an algebraic system of equations. In order to eliminate θ1 and θ2 , we compute a Groebner Basis of the system under the following elimination order: [c1 , s1 , c2 , s2 ] > [c3 , s3 , r2 , d3 , d4 , x, y, z]. The Groebner basis G3 of the Elimination Ideal is composed of two polynomials : c23 + s23 − 1 and m5 c23 + m4 s23 + m3 c3 s3 + m2 c3 + m1 s3 + m0 where :
m0 m1 m2 m3 m4 m5
= = = = = =
2
Z − R + r22 + (R+1−L) 4 2r2 d4 + (L − R − 1)d4 r2 (L − R − 1)d4 d3 2r2 d3 d24 d24 (r22 + 1) d24 d23
with R = x2 + y 2 + z 2 , Z = z 2 and L = d24 + d23 + r22 . After a change of variables in t = tan( θ23 ), the second polynomial becomes: P (t) = at4 + bt3 + ct2 + dt + e with:
a b c d e
= = = = =
m5 − m2 + m0 −2m3 + 2m1 −2m5 + 4m4 + 2m0 2m3 + 2m1 m5 + m2 + m0
Deciding if a manipulator is cuspidal is equivalent to deciding if this polynomial P of degree 4 in t (whose coefficients are polynomial with respect to x, y, z, d4 , d3 , r2) admits real triple roots. It is important to note that every solution in t = tan( θ23 ) is uniquely lifted in a 3-uplet (θ1 , θ2 , θ3 ), except if z = 0 or x2 + y 2 = 0, but this case will be treated later. We will show that the design parameters d3 , d4 , r2 of manipulators such that z(x2 + y 2 ) = 0 are in a strict hypersurface of R3 . So, finding parameters’
Using Computer Algebra Tools to Classify Serial Manipulators
35
values defining cuspidal manipulators remains to find the values of d4 , d3 , r2 such that P (t) has triple points by solving the following system (as the boundaries of the workspace form a revolution surface around the axis Oz, it is generically zero-dimensional once the parameters are fixed) : P =0 ∂P =0 (2) 2 ∂∂t P = 0 2 ∂t
4
The Algebraic Set Defining the Classification
We want to obtain a partition of the space of parameters, such that the cuspidality behavior of the manipulators corresponding to the same cell is identical. As it is impossible to construct in practice a manipulator whose parameters correspond exactly to given parameters, we just deal with “generic” solutions. In other words, we are only interested in the cells of maximal dimension. In each of those cells we want that the number of real roots of our system is constant (in the generic cases it appears that the dimension of thr system when we fix the parameters is zero). In order to obtain some conditions on the parameters, we need to eliminate the variables t, Z, R from the system of equations by computing an eliminating polynomial depending on the parameters d4 , d3 , r2 , and on one of the three variables t, R and Z. But, moreover, we need to caracterize the solutions depending on these conditions which impose to compute simple expressions of the coordinates of the solutions with respect to the two remaining variables. The eliminating polynomial could be computed using Gr¨ obner basis as well as resultants, but none of the two algorithms may give simple expressions of the solutions as expected. For example, we have computed a Gr¨ obner Basis of the system with respect to an elimination order. This is possible using the most recents algorithms from J.C.Faug`ere [5]. But the result obtained is very huge and difficult to use because all the multiplicities as well as non real components of the variety, are kept along the computation. So, we choose to represent the solutions of system (2) as regular zeroes of regular and separable triangulars sets (with respect to the terminology of [2]). This ensure that the non “generic” solutions correspond to values of the parameters contained in strict hypersurfaces of the space of the parameters, that we will work with equidimensionnal ideals and that “generic” specializations of the parameters will lead to zero-dimensional systems without multiple complex roots (critical for the study of real roots). As the direct computation do not give a pleasant result, we decided to modify the variables and to simplify the problem. Thanks to the following change of
36
Solen Corvez and Fabrice Rouillier
variables: U X1 X2 h X3
= e−a = d − b = d − X3 − hU = U + 2a − c = r2 /d3 = b − hU
= 2(d24 + d23 + r22 − R − 1)d4 r2 = 8r2 d3 d24 = 4d24 (d23 − r22 − 1) = 4r2 d4 (1 − d3 d4 )
the Gr¨ obner basis of the new system with respect to the lexicographic order : t > a > U > X1 > X2 > X3 > h is so easy to compute that it can be done very quickly with the algorithm of Buchberger implemented under MAPLE. The basis obtain as the following form : surfU (U , X1 , X2 , X3 , h) = 0 g a,1 (a, U , X1 , X2 , X3 , h) = 0 g (a, U , X , X , X , h) = 0 a,2 1 2 3 . .. ga,14 (a, U , X1 , X2 , X3 , h) = 0 gt,1 (t, a, U , X1 , X2 , X3 , h) = 0 gt,2 (t, a, U , X1 , X2 , X3 , h) = 0 .. . gt,18 (t, a, U , X1 , X2 , X3 , h) = 0 where : – the polynomial ga,1 is of degree 1 in the variable a. – the polynomial gt,1 is of degree 1 in the variable t. We do not give here the full polynomials because of their size (more than 320 monomials for each of them). We extract from the system the following triangular set: surfU (U , X1 , X2 , X3 , h) = 0 ga,1 = lca (X1 , X2 , X3 , h)a + ca (U , X1 , X2 , X3 , h) = 0 (3) gt,1 = lct (X1 , X2 , X3 , h)t + ct (U, a, X1 , X2 , X3 , h) = 0 This triangular set T extracted from the system is regular and separable, it means that the product of the leading coefficients of T (lct lca lcsurfU ) as well as the derivatives of ga,1 and gt,1 with respect to their main variables, do not vanish on any prime component of the ideal < T > (this has been verified by localizing the system). Hence the saturation ideal of < T > is an equidimensional ideal which ensures us that the different projections (eliminations of variables) we will apply on this ideal will have a good behaviour (good dimension of the varieties obtained at each step). In fact we are working with the Zariski closure of the variety of the regular zeros of < T > which is here an equidimensional envelope of the
Using Computer Algebra Tools to Classify Serial Manipulators
37
variety of the zeros of the components of dimension 3 of the system (2). Note that basically, the system is of dimension 4, but one can easily show that the components of dimension 4 are included in the hypersurface d4 = 0. So coming back to our first variables, we can define the generic solutions of the problem as regular roots of a triangular system with the following shape: surf (R, d4 , d3 , r2 ) = 0 lcZ (d4 , d3 , r2 )Z + trZ (R, d4 , d3 , r2 ) = 0 (4) lct (d4 , d3 , r2 )t + trt (R, Z, d4 , d3 , r2 ) = 0 Now to obtain a description of the complementary of our algebraic set, we can compute directly a Cylindrical Algebraic Decomposition adapted to this set and then just keep the cells of maximal dimension. But the computation of the discriminant of the polynomial surf would be a limitating step. Let’s study the system more deeply. The set Vlc (Z, t) = {(d3 , d4 , r2 )|lcZ (d3 , d4 , r2 )lct (d3 , d4 , r2 ) = 0} defines an hypersurface in the parameters’space, which is a strict closed set.We can remark that lcZ = 0 has no real roots, so Vlc = {(d3 , d4 , r2 )| lct (d3 , d4 , r2 ) = 0}. Studying the generic solutions of the first system is exactly avoiding the parameters on this Vlc and then parameters for which the number of real roots of surf (R) varies. It means the parameters lying in the hypersurface : {(d3 , d4 , r2 )|lcsurf = 0 or discrim(surf, R) = 0} The real hypersurface lcsurf = 0 is empty and the discriminant factorise in three factors: – f1 = d23 − d24 + r22 – f2 = d24 d63 − d44 d43 + 3d24 d43 r22 − 2d24 d43 + 2d44 d23 − 2r22 d23 d44 + d24 d23 + 3d24 d23 r24 − d23 r22 − 2r22 d44 − d44 r24 − d44 + r26 d24 + d24 r22 + 2r24 d24 – f3 = 2r28 d24 d23 + 2r22 d24 d83 + 6r24 d24 d63 + 6r26 d24 d43 + 4r210 d44 + 6r210 d23 d44 + 15r28 d43 d44 + 15r24 d83 d44 + 12r28 d23 d44 − 4r24 d43 d44 + 6r28 d44 − 4d63 d44 + 6d83 d44 + r212 d44 − 4r22 d24 d63 + 4r26 d24 d23 + 20r26 d63 d44 − 8r24 d63 d44 + 8r26 d43 d44 + d44 r24 + 2d24 d23 r24 + 2d24 d43 r22 + d44 d43 − 12r22 d83 d44 − 2r22 d23 d44 + d43 r24 + 4r26 d23 d44 − 4r24 d23 d44 + 4r22 d43 d44 + 4r22 d63 d44 + 4r26 d44 + 4 10 4 2 10 4 d12 3 d4 − 4d3 d4 + 6r2 d3 d4 The real hypersurface f3 = 0 is also empty from the real point of view. Also we must remember that the variables Z and R − Z are strictly positive. Substituting Z = 0 or R − Z = 0 in the first system permits us to find two polynomial conditions on parameters, let say Z0 (d3 , d4 , r2 ) = 0 and RZ0 (d3 , d4 , r2 ) = 0. The polynomial RZ0 , does not present any real root. The polynomial Z0 factorises in two polynomials : – Z01 = d23 r22 + d23 − 2d33 + d43 − d24 + 2d3 d24 − d24 d23 – Z02 = d23 r22 + d23 + 2d33 + d43 − d24 − 2d3 d24 − d24 d23 The algebraic set to avoid : {Z01 = 0, Z02 = 0, f1 = 0, f2 = 0, lct = 0}
38
Solen Corvez and Fabrice Rouillier
gives us a partition of the space of parameters (where d3 > 0, d4 > 0, r2 > 0), such that in each cell of maximal dimension the number of cusp points in a cross section of the workspace is constant.
5
Partition’s Cells Computation
A way to represent such cells is now to compute a Cylindrical Algebraic Decomposition (CAD - see [3]) of R3 adapted to this set of polynomials. But it may give us a result very huge and difficult to analyse in practice, and with lots of cells we are not interested in. In order to obtain a decomposition easier to manipulate, we use the fact that we are just interested in the “generic” solutions, so in the cells of maximal dimension in our partition of the space of parameters. So we adapt the Collins’Algorithm to our case. – Projection phase At each step we keep the leading coefficients of the polynomials, the resultants and the discriminants, keeping in mind that the polynomials which have no real roots do not interest us. As we are not interested in the multiplicities of the singularities and intersections between hypersurfaces, we won’t compute the subresultants. – Lifting phase As we are just interested in the cells of maximal dimension, we do not need to compute real algebraic numbers and we can work only with rationnal test points (so we won’t have to work with towers of extention for example, or other ways of coding real algebraic numbers). 5.1
The Projection Phase
We want to give a description of the connected components of maximal dimension of the complementary of the algebraic set A = {f1 , f2 , , lct , Z01 , Z02 } where: f1 = d23 − d24 + r22 f2 = d24 d63 − d44 d43 + 3d24 d43 r22 − 2d24 d43 + 2d44 d23 − 2r22 d23 d44 + d24 d23 + 3d24 d23 r24 −d23 r22 − 2r22 d44 − d44 r24 − d44 + r26 d24 + d24 r22 + 2r24 d24 Z01 = d23 r22 + d23 − 2d33 + d43 − d24 + 2d3 d24 − d24 d23 Z02 = d23 r22 + d23 + 2d33 + d43 − d24 − 2d3 d24 − d24 d23 lct = −d3 + d4 r22 + d4 Let P ROJd4 (A) = {A ∩ Q[d3 , r2 ], disc(P, d4 ), res(P, Q, d4 ), lc(P ) | P, Q ∈ A}. It is the smallest family of polynomials in Q[d3 , r2 ] which keep in mind the structure of the connected components of maximal dimension of the complementary of A. After computations we obtain: P ROJd4 (A) = {C1 , ..., C6 }.
Using Computer Algebra Tools to Classify Serial Manipulators
(1,4)
39
(1,5) (2,4) (3,3) (4,2)
(1,3) (5,1)
(2,3) (3,2) (2,2)
(1,2)
(1,1)
(2,1)
(4,1) (3,1)
Fig. 2. Partition of the parameters’space (d3 , r2 )
where: C1 C 2 C3 C4 C 5 C6
= = = = = =
d3 − 1, −1 + 2 d3 , −d3 2 + d3 4 + 2 d3 2 r2 2 + r2 2 + r2 4 , d3 2 r 2 2 + 2 d3 2 − 2 d3 r 2 2 − 4 d3 + 3 r 2 2 + 3 + r 2 4 , −3 d3 2 + 3 r2 2 + d3 4 r2 2 + 2 d3 4 + 3 d3 2 r2 4 + 4 d3 2 r2 2 + 3 r2 6 + 6 r2 4 , 3 d3 2 − 3 r2 2 + 10 d3 4 − 10 d3 2 r2 2 − 3 r2 4 + 10 d3 r2 2 − 10 d3 3 − 5 d3 6 − 11 d3 4 r2 2 − 7 d3 2 r2 4 − r2 6 + 8 d3 3 r2 2 + 8 d3 r2 4 + 2 d3 r2 6 + 6 d3 3 r2 4 + 6 d3 5 r 2 2 + 2 d3 7 .
(5)
We can visualise this algebraic set and the partition of the parameters’space (d3 , r2 ) it implies, on the following figure. Then we define by the same way P ROJr2 (P ROJd4 (A)) = {−1 + 2d3 , d3 − 1, 2d3 − 3, −3 + 2d23 }. 5.2
The Lifting Phase
At each step of the lifting phase we use the variant of Descarte’s rule of sign based method proposed in [12] (many other methods like [6], [8] or [1] should be used) to find isolating intervals of the real roots appearing along the computation. For the first step, given the list of polynomials in the parameter d3 , we isolate in intervals with rational endpoints all the real roots of these polynomials. Then we choose the test values for d3 to be the middle points of each interval between the isolating intervals.We obtained the following test values for d3 :
40
Solen Corvez and Fabrice Rouillier (1)
– d3 = (2)
– d3 = (3)
– d3 = (4)
– d3 = (5)
– d3 =
219 ∈]0, P1 [, 1024 3 ∈]P1 , P2 [, 4 1139 ∈]P2 , P3 [, 1024 2791 ∈]P3 , P4 [, 2048 1011 ∈]P4 , ∞[, 512
After substituting those values in the list {C1 , ..., C6 }, we obtain 6 polynomials in r2 . In each case we isolate the real roots and obtain the following test values: 219 403 403 827 215 13657 : the test values for r2 are { , , , , }, 1024 4096 2048 4096 1024 64000 339 371 939 67189 3 (2) for d3 = : { , , , }, 4 2048 1024 2048 128000 259 785 32907 1139 (3) for d3 = : { , , }, 1024 2048 2048 64000 181 45439 2791 (4) : { , }, for d3 = 2048 1024 128000 1011 (5) and for d3 = : {1}. 512 (1)
– for d3 = – – – –
Then we do the same in the set of polynomials A. Over each 15 cells of the plane (r2 , d3 ) (discribed in figure 2) we obtain 7 test values in the parameter d4 (because the algebraic set A is generically composed of 6 leaves as the hypersurface f2 = 0 is composed of two leaves) , so we eventually found 105 test points (each one corresponding to a cell of maximal dimension). 5.3
Results
For each sample point, after specialisation in the given parameters, it is then sufficent to solve the following zero-dimensionnal system (counting the number of real roots) to get the number of cusp points in a cross section of the workspace corresponding to the selected parameters: P =0 ∂P =0 ∂t ∂2 P (6) =0 ∂t2 =0 T12 Z − 1 2 T2 (R − Z) − 1 = 0 where the equations T12 Z − 1 = 0 and T22 (R − Z) − 1 = 0 discriminate the admissible solutions. This can be done computing a Rationnal Univariate Representation of the system usign algorithms described in [10],[11] (other strategies like [13] should also be applied without any trouble to compute such a rational parametrization) and then isolating the real roots of this RUR with the algorithm described in [12]
Using Computer Algebra Tools to Classify Serial Manipulators
41
(this last computation is not the main one : numerous variants [6], [8] or [1] could be used as well as Sturm sequences).; As Z = z 2 , the number of cusp points appearing in a cross section of the workspace, equals twice the number of real roots of the RUR. Here are the results for each sample point: (d3 , r2 ) \ d4 1 2 3 4 5 6 7 (1,1) 0044200 (1,2) 0444200 (1,3) 0444200 (1,4) 0442200 (1,5) 0442000 (2,1) 0044220 (2,2) 0444220 (2,3) 0444220 (2,4) 0442220 (3,1) 0444224 (3,2) 0444224 (3,3) 0442224 (4,1) 0444224 (4,2) 0442224 (5,1) 0442224 In each line (i, j) of this table you can read the number of cusp points appearing in a cross section of the workspaces of the seven test robots above the cell (i, j) (see figure 2) corresponding to the seven distinct test values of d4 obtained (i) (j) in the fiber over the point (d3 , r2 ). Example Here are the different cross sections of the workspace obtained for the sample points from the fiber above the cell (5, 1). The drawings are from SCILAB. The value of the parameter d4 goes increasing from left to right. We can verify on those drawings that the number of cusp points corresponds to the corresponding number in the table. (d3 , r2 ) \ d4 1 2 3 4 5 6 7 (5,1) 0442224 Now, if, given parameters, the user wants to know in which cell lies the manipulator, he can do it using the lifting phase. The first step of the search is to locate the parameter d3 between the real roots of the set P ROJr2 (P ROJd4 (A)) = {−1 + 2d3 , d3 − 1, 2d3 − 3, −3 + 2d23 }. As each root is given by an isolating interval with rationnal bounds, which can
42
Solen Corvez and Fabrice Rouillier (5,1,1)
(5,1,2)
(5,1,3)
(5,1,4)
(5,1,5)
(5,1,6)
(5,1,7)
Fig. 3. Fiber above the cell (5, 1)
be refined if necessary, it is easy to find the first indice of the cell (the one corresponding to d3 ). Then we solve the differents equations of the set P ROJd4 (A) = {C1 , ..., C6 }. evaluated in the given parameter d3 (so we just have to find the real roots of low-degree polynomials in one variable). By the same way than before we locate the parameter r2 and obtain the second indice. By repeating this process with these two parameters and the set A we obtain the triple of indices corresponding to the cell in which lies the given robot. Before concluding this paper, we must remark that the classification we have made is not optimal as some neighbouring cells correspond to the same number of cusp points. We may explain that by the fact that some leaves of our hypersurfaces in A, do not give us informations on the real roots we are searching for. We are now trying to find a minimal decomposition in cells of maximal dimension of the space of parameters.
Conclusion In this paper, we manage to compute an algebraic set depending on the design parameters, such that in each connected component of its complementary the cuspidality behavior is the same . Thanks to an adapted CAD, we obtained a decomposition of this set in cells and at least one sample point,with rationnal coordinates, in the interior of each cell of higher dimension. Among those sample points, P.Wenger’s team found just one class of homotopy, in the torus representing the joint space, over the seven classes they encountered before for the cuspidal manipulators [15]. Generalization of this work to manipulators with one more design parameter (the parameter r3 of the DH parameters) would permit to find representants of other classes. We are now working on. Future research work is to try to generalize our study to other problems involving system of polynomial equations depending on parameters.
Using Computer Algebra Tools to Classify Serial Manipulators
43
References [1] A. G Akritas, A. Bocharov, and A. Strzebonski. Implementation of real roots isolation algorithms in mathematica. In Abstracts of the International Conference on Interval and Computer Algebraic Methods in Science and Ingineering, pages pp. 23–27, 1994. 39, 41 [2] P. Aubry, D. Lazard, and M. Moreno Maza. On the theories of triangular sets. Journal of Symbilic Computation, 28:105–124, 1999. 33, 35 [3] G. E. Collins. Quantifier elimination for real closed fields by cylindrical algebraic decomposition. Springer Lecture Notes in Computer Science 33, 33:515–532, 1975. 38 [4] D. Cox, J. Little, and D. O’Shea. Ideals, varieties, and algorithms an introduction to computational algebraic geometry and commutative algebra. Undergraduate texts in mathematics. Springer-Verlag New York-Berlin-Paris, 1992. 33 [5] J.-C. Faug`ere. A new efficient algorithm for computing gr¨ obner bases (f4). Journal of Pure and Applied Algebra, 139(1-3):61–88, June 1999. 35 [6] J. R. Johnson and W. Krandick. Polynomial real roots isolation using approximate arithmetic. Advances in Applied Mathematics, 17(3):308–336, 1996. 39, 41 [7] D. Manocha. Algebraic and Numeric Techniques for modeling and Robotics. PhD thesis, University of California at Berkeley, 1992. 33 [8] B. Mourrain, M. Vrahatis, and J. C. Yakoubsohn. On the complexity of isolating real roots and computing with certainty the topological degree. Journal of Complexity, 18(2):612–640, 2002. 39, 41 [9] J. El Omri. Analyse gomtrique et cinmatique des mcanismes de type manipulateur. PhD thesis, Universit de Nantes, Feb. 1996. 32 [10] F. Rouillier. Algorithmes efficaces pour l’´ etude des z´eros r´eels des syst`emes polynomiaux. PhD thesis, Universit´e de Rennes I, may 1996. 40 [11] F. Rouillier. Solving zero-dimensional systems through the rational univariate representation. Journal of Applicable Algebra in Engineering, Communication and Computing, 9(5):433–461, 1999. 40 [12] F. Rouillier and P. Zimmermann. Efficient isolation of a polynomial real roots. Technical Report RR-4113, INRIA, 2001. 39, 40 [13] P. Trebuchet. Vers une rsolution stable et rapide des quations algbriques. PhD thesis, Universit de Paris VI, 2002. 40 [14] D. Wang. Elimination Methods. Springer-Verlag,Wien New York, 2001. 33 [15] P. Wenger. Classification of 3r positioning manipulators. Journal of Mechanical Design, 120:327–332, June 1998. 32, 42 [16] Ph. Wenger and J. El Omri. Changing posture for cuspidal robot manipulators. In Proceeding of the 1996 IEEE Int. Conf on Robotics and Automation, pages 3173–3178, 1996. 31, 32
MMP/Geometer – A Software Package for Automated Geometric Reasoning Xiao-Shan Gao and Qiang Lin Key Laboratory of Mathematics Mechanization Institute of System Science, AMSS, Academia Sinica Beijing 100080, China xgao,[email protected]
Abstract. We introduce a software package, MMP/Geometer, developed by us to automate some of the basic geometric activities including geometric theorem proving, geometric theorem discovering, and geometric diagram generation. As a theorem prover, MMP/Geometer implements Wu’s method for Euclidean and differential geometries, the area method and the geometric deductive database method. With these methods, we can not only prove difficult geometric theorems but also discover new theorems and generate short and readable proofs. As a geometric diagram editor, MMP/Geometer is an intelligent dynamic geometric software tool which may be used to input and manipulate geometric diagrams conveniently and interactively by combining the idea of dynamic geometry and methods of automated diagram generation. Keywords: Geometry software, automated reasoning, geometric theorem proving, geometric theorem discovering, geometric diagram generation, intelligent dynamic geometry.
1
Introduction
MMP (Mathematics-Mechanization Platform) is a stand-alone software platform under development [12], which is supported by a Chinese National Key Basic Research Project “Mathematics Mechanization and Platform for Automated Reasoning.” The aim of MMP is to mechanize some of the basic mathematical activities including automated solution of algebraic and differential equations and automated geometric theorem proving and discovering, following Wu’s idea of mathematics mechanization [33, 36]. MMP is based on algorithms for symbolic computation and automated reasoning, and in particular the Wu-Ritt characteristic set (CS) method [36, 30]. MMP also implements application packages in automated geometric reasoning, automated geometric diagram generation, differential equation solving, robotics, mechanism design and CAGD.
This work was supported by a National Key Basic Research Project (NO. G19980306) and by a USA NSF grant CCR-0201253.
F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 44–66, 2004. c Springer-Verlag Berlin Heidelberg 2004
MMP/Geometer – A Software Package for Automated Geometric Reasoning
45
MMP/Geometer is a package of MMP for automated geometric reasoning. The aim of MMP/Geometer is try to automate some of the basic geometric activities including geometric theorem proving, geometric theorem discovering, and geometric diagram generation. The current version is mainly for plane Euclidean geometries and the differential geometry of space curves. The goal of MMP/Geometer is to provide a convenient and powerful tool to learn and use geometry by combining the methods of geometric theorem proving and geometric diagram generation. The introduction of computer into geometry may give new life into the learning and study of the classical field [10]. Geometry is at the heart for many engineering problems from robotics, CAD, and computer vision. We expect that MMP/Geometer may have applications in these fields. Actually, some of the methods implemented in MMP/Geometer are directly targeted at engineering problems [11, 15, 16, 17]. 1.1
Automated Geometric Theorem Proving and Discovering
Study of automated geometric theorem proving (AGTP) may be traced back to the landmark work by Gelernter and his collaborators [18] in the late 1950s. The extensive study of AGTP in the past twenty years is due to the introduction of Wu’s method in late 1970s [33], which is surprisingly efficient for proving difficult geometric theorems. Inspired by this work, many successful methods of AGTP were invented in the past twenty years. For a recent survey of these methods, please consult [7]. AGTP is one of the successful fields of automated reasoning. There are few areas for which one can claim that machine proofs are superior to human proofs. Geometry theorem proving is such an area. Our experiments show that MMP/Geometer is quite efficient in proving geometric theorems. Within its domain, it invites comparison with the best of human geometric provers. Precisely speaking, we have implemented the following methods. Wu’s method might be the most powerful method in terms of proving difficult geometric theorems and applying to more geometries [33, 36]. Wu’s method is a coordinate-based method. It first transfers geometric conditions into polynomial or differential equations in the coordinates of the points involved, then deals with the equations with the characteristic set method. The area method uses high-level geometric lemmas about geometric invariants such as the area and the Pythagorean difference as the basic tool of proving geometric theorems [8]. The method can be used to produce humanreadable proofs for geometric theorems. The deductive database method is based on the theory of deductive database. We may use it to generate the fixpoint for a given geometric configuration under a fixed set of geometric rules or axioms[9]. With this method, we can not only find a large portion of the well-known facts about a given configuration, but also to produce proofs in traditional style. For almost every method of AGTP, there is a prover. We will not give detailed introduction to existing geometric software packages. A survey may be
46
Xiao-Shan Gao and Qiang Lin
found in [21]. Comparing with previous provers, MMP/Geometer has the following distinct features. First, it implements some of the representative methods for AGTP, while most previous provers are for one method. An exception is Geometry Expert (GEX), which also implements the methods mentioned above [13]. The difference is that GEX only implements a simple version of Wu’s method due to the lack of an implementation of Wu-Ritt’s zero decomposition theorem. Also, we implements general methods of automated diagram generation in MMP/Geometer and GEX can handle diagrams that can be drawn with ruler and compass constructions. Another reason for us to develop a new software package is that GEX is developed under Borland C++ which is not available anymore. Second, MMP/Geometer is stand-alone, while most of the previous provers are implemented in Lisp or Maple. Third, MMP/Geometer is capable of producing human-readable proofs and proofs in traditional style. Finally, MMP/Geometer has a powerful graphic interface, which will be introduced in the next subsection. 1.2
Automated Geometric Diagram Generation (AGDG)
It is often said that a picture is more than one thousand words. But in reality, it is still very difficult to generate large scale geometric diagrams like those in Fig. 10 with a computer. With MMP/Geometer, we intend to provide an intelligent tool for generating and manipulating such diagrams. By implementing general AGDG methods [11, 24, 20], MMP/Geometer may be used as a general diagram editor. Also, AGDG methods have direct applications in parametric CAD [20, 17, 15], linkage design [16], etc. For AGTP, the diagram editor may provide a nice graphic user interface (GUI). Also, AGDG methods may enhance the proving scope for AGTP methods with constructive statements as input by finding the construction sequence for problems whose ruler and compass construction procedure is difficult to find, as shown by the example in Fig. 9. Dynamic geometry software systems, noticeably, Gabri [23], Geometer’s Sketchpad [22], Cinderella [28], and Geometry Expert [13] may generate diagrams interactively based on ruler and compass construction. These systems are mainly used to education and simulation of linkages. As compared with models built with real materials, visual models built with dynamic geometry software are more flexible, powerful, and more open for manipulation. It is well known that the drawing scope of ruler and compass construction has limitations. To draw more complicated diagrams, we need the method of automated geometric diagram generation, which has been studied in the CAD community under a different name: geometric constraint solving (GCS) and with a different perspective: engineering diagram drawing. GCS is the central topic in much of the current work of developing intelligent and parametric CAD systems and interactive constraint-based graphic systems [11, 24, 20, 19]. In MMP/Geometer, by combining the idea of dynamic geometry and AGDG we obtain what we called the intelligent dynamic geometry, which can be used to input and manipulate diagrams more conveniently. It can be used to manipulate
MMP/Geometer – A Software Package for Automated Geometric Reasoning
47
G
D
A E O
B
F
C
Fig. 1. Simson’s Theorem geometric diagrams interactively as dynamic geometry software and does not have the limitation of ruler and compass construction. The rest of the paper is organized as follows. Section 2 describes the input formats of a geometric statement. Section 3 reports the implementation of methods of AGTP. Section 4 reports the implementation of the methods of AGDG.
2
Input of a Geometric Statement
The user may input a geometric statement to MMP/Geometer in two ways: either by typing the English description of the statement or by drawing the diagram of the statement on a computer screen with a mouse. After a statement is inputted, it may be described in four forms: the natural language form, the constructive form, the predicate form, and the algebraic form. The purpose of using different input forms is that each input form has its merit. For instance, the natural language input may be the favorable choice for high school students. The constructive form is the input form for several proving methods, like the area method[8]. The predicate form is the most general way of describing a statement. We use Simson’s Theorem to illustrate these forms. Natural Language. MMP/Geometer accepts geometric statements described with a precisely defined pseudo-natural language. Detailed definition of this language may be found in [12]. MMP/Geometer may convert a statement in natural language into all other forms. Using this language, Simson’s Theorem may be described as follows. geom("Example Simson. Let D be a~point on the circumcircle O of triangle ABC. E is the foot from point D to line AB. F is the foot from point D to line BC. G is the foot from point D to line AC. Show that points E, F, and G are collinear."); In the above example, geom is an MMP/Geometer command which accepts a geometric statement in any form and converts it to all other possible forms.
48
Xiao-Shan Gao and Qiang Lin
Constructive Form. In this form, the geometric objects in the statements can be described by a sequence of geometric constructions. A construction is to generate a new geometric object with lines and circles. Detailed description of the constructions used in MMP/Geometer may be found in [2, 5, 12]. A statement in constructive form may be converted to all other forms. The constructive form of Simson’s Theorem is as follows. geom([[[POINT,A,B,C],[CIRCUMCENTER,O,A,B,C],[ON,D,[CIR,O,A]], [FOOT,E,D,A,B],[FOOT,F,D,B,C],[FOOT,G,D,A,C]],[[coll,E,F,G]]] ); Generally speaking, a statement in constructive form is a pair [cs, c], where cs is a construction sequence used to generate the geometric objects in a statement and c is the set of conclusions. Predicate Form. This is a natural way to describe a geometric statement. The hypotheses and conclusions are represented by geometric predicates. The following predicate form for Simson’s Theorem is generated automatically from its constructive form mentioned above with MMP/Geometer. geom([[y5,x5,y4,x4,y3,x3,y2,x2,y1,x1,v2,u1,v1],[], [A,[0,0],B,[0,v1],C,[u2,v2],O,[x1,y1],D,[x2,y2],E,[x3,y3], F,[x4,y4],G,[x5,y5]], [[cong,O,A,O,B],[cong,O,A,O,C],[cong,O,D,O,A], [coll,E,A,B],[perp,E,D,A,B],[coll,F,B,C],[perp,F,D,B,C], [coll,G,A,C],[perp,G,D,A,C]], [[sqdis,A,B],[sqdis,B,C],[sqdis,A,C]],[[COLL,E,F,G]]]); Predicate [sqdis,A,B] means A = B with an algebraic representation as |OA|2 = 0. The three predicates A = B, B = C, A = C are called the non-degenerated conditions (ndgs) for Simson’s theorem. A statement in predicate form can be represented by a 6-tuple: [mv, pv, pset, ps, ds, c] where mv and pv are the main variables and parametric variables, pset is the set of points and their coordinates, ps is a set of predicates representing the hypotheses, ds is a set of predicates representing the nondegenerate conditions, c is the set of conclusions. Algebraic Form. In this form, coordinates are assigned to points in the statement and the hypotheses and conclusions are represented by algebraic equations. It is straight forward to convert a statement in predicate form to algebraic form. The following is the algebraic form of Simson’s theorem in predicate form given above. geom([[y5,x5,y4,x4,y3,x3,y2,x2,y1,x1,v2,u1,v1],[], [2*v1*y1-v1^2,2*v2*y1+2*u2*x1-v2^2-u2^2, y2^2-2*y1*y2+x2^2-2*x1*x2,-v1*x3, -v1*y3+v1*y2,u2*y4-v2*x4+v1*x4-u2*v1, -v2*y4+v1*y4-u2*x4+v2*y2-v1*y2+u2*x2,u2*y5-v2*x5, -v2*y5-u2*x5+v2*y2+u2*x2], [v1^2,v2^2-2*v1*v2+v1^2+u2^2,v2^2+u2^2], [x4*y5-x3*y5-y4*x5+y3*x5+x3*y4-y3*x4]]);
MMP/Geometer – A Software Package for Automated Geometric Reasoning
49
Natrual Language Form
Constructive Form AGDG
Predicate Form Algebraic Form
Fig. 2. The relations between the four representation forms
A statement in algebraic form can be represented by a 5-tuple: [mv, pv, ps, ds, c] where mv and pv are the main variables and parametric variables, ps is a set of equations representing the hypotheses, ds is a set of equations representing the degenerate conditions, c is the set of conclusions. The relations between the four representation forms are illustrated in Fig. 2. An arrow from a form A to a form B means that MMP/Geometer can convert A to B. We use the method in [5] to convert a constructive form to a predicate form. The arrow marked with AGDG means that we will use AGDG methods reported in Section 4 to convert a predicate form to a constructive form. All other conversions are either obvious or can be found in [12]. A statement G = [mv, pv, ps, ds, c] in algebraic form is said to be generically true if there exists a polynomial d in the variables pv such that ∀x ∈ mv, ∀u ∈ pv[(ps = 0 ∧ ds = 0 ∧ d = 0) ⇒ c = 0] If pv = ∅, then G is universally true if ∀c ∈ mv[(ps = 0 ∧ ds = 0) ⇒ c = 0] Since statements in all other forms can be converted into statements in algebraic form, we say a statement is generically true or universally true if its algebraic form is generically true or universally true. There are two ways to input a geometric statement graphically. Constructive. To input a statement constructively, we need to draw the diagram of the statement in a way similar to the ruler and compass construction. More precisely, we need to draw the objects in the statement sequentially with lines and circles. The drawing process can be naturally converted into a constructive description of the statement. For instance, to draw the diagram of Simson’s Theorem, we may just follow its constructive description given above to draw points A, B, C, O, D, E, F, G sequentially with functions provided by the software.
50
Xiao-Shan Gao and Qiang Lin
Declarative. In this form, we will first draw a sketch of the diagram and then add the geometric conditions. The software will adjust the diagram automatically such that these conditions will be satisfied. This process is called automated geometric diagram generation (AGDG). The declarative drawing process can be naturally turned into a predicate description of the statement. One way to draw a diagram in declarative form is to transform it into constructive form automatically. Of course, not all statements in declarative form can be transformed into constructive form. For this kind of problems, we need to develop more complicated methods to draw their diagrams. This is the main task of AGDG, which will be introduced in Section 4. To draw the diagram of Simson’s Theorem in this way, we may first draw four points A, B, C, D on a circle and draw lines DE, DF , and DG such that E, F, G are on line AB, BC, AC respectively. Now we have a sketch of the diagram. Finally, we add the conditions DE⊥AB, DF ⊥BC, DG⊥AC to the sketch and the software will adjust the sketch to satisfy these conditions.
3 3.1
Automated Geometric Theorem Proving and Discovering Wu’s Method
Wu’s method is a coordinate-based method for equational geometric statements, that is, the premise and the conclusion of the statement can be represented by algebraic or differential equations. The method first transfers geometric conditions into polynomial or differential equations, then deals with the polynomial equations with the characteristic set method [33, 36]. Variants of this method may be found in [2, 27, 30, 37]. Wu’s method is based on Wu-Ritt’s zero decomposition theorem for polynomial and differential polynomial equations [33, 36]. It may be used to represent the zero set of a polynomial equation system as the union of zero sets of equations in triangular form, that is, equation systems like f1 (u, x1 ) = 0, f2 (u, x1 , x2 ) = 0, . . . , fp (u, x1 , . . . , xp ) = 0 where the u could be considered as a set of parameters and the x are the variables to be determined. Let P S and DS be two sets of polynomials or differential polynomials, Zero(P S/DS) the set of solutions of P S = 0 over the field of complex numbers, which do not vanish any of the equations in DS. Wu-Ritt’s zero decomposition theorem [33, 30] may be stated as follows: Zero(P S/DS) = ∪i Zero(SAT(ASi )/DS)
(1)
where ASi are polynomial sets in triangular form and SAT(ASi ) are the saturation ideals of ASi . Variants of this algorithm may be found in [1, 2, 25, 26, 30, 37]. In MMP, the zero decomposition is implemented by Dingkang Wang [32]. Four versions of Wu’s method are implemented in MMP/Geometer.
MMP/Geometer – A Software Package for Automated Geometric Reasoning
51
WU-C. This method can be used to decide whether a geometric statement in constructive form is generically true, or it is true except some special cases called non-degenerate conditions (ndgs). The implementation is based on a variant of Wu’s method described in [5]. With this method, we may prove or dis-prove a geometric statement and give sufficient ndgs in geometric form. By sufficient ndgs, we mean (1) if the statement under consideration is valid in geometry textbooks (generically true), then the statement is valid under these conditions; (2) if the statement is not valid under these conditions, then it will not become valid by adding more conditions unless the newly added conditions make the statement trivially valid or change the meaning of the statement. We use Simson’s Theorem as an example. wcprove("Example Simson. Let D be a~point on the circumcircle O of triangle ABC. E is the foot from point D to line AB. F is the foot from point D to line BC. G is the foot from point D to line AC. Show that points E, F, and G are collinear."); MMP/Geometer first converts the statement into constructive form, then proves the constructive statement and gives the following output. 1. The statement is generically true, that is, it is true except some special cases. 2. The sufficient ndgs are: ¬[coll, A, B, C], A = B, B = C, A = C. WU-G. This method decides whether a geometric statement in algebraic form is valid [33, 36]. Let P S and DS be the equation part and inequation part corresponding to the ndgs of a statement. MMP/Geometer will first use WuRitt’s zero decommission theorem to find triangular sets ASi as in (1). Let C = 0 be the conclusion. If prem(C, ASi ) = 0, then C = 0 is valid on Zero(SAT(ASi )). If ASi is irreducible, then this is also a necessary condition over the field of complex numbers. For Simson’s Theorem, we may prove that its following predicate form is valid. wprove([[y5,x5,y4,x4,y3,x3,y2,x2,y1,x1,v2,u1,v1],[], [A,[0,0],B,[0,v1],C,[u2,v2],O,[x1,y1],D,[x2,y2],E,[x3,y3], F,[x4,y4],G,[x5,y5]], [[cong,O,A,O,B],[cong,O,A,O,C],[cong,O,D,O,A],[coll,E,A,B], [perp,E,D,A,B],[coll,F,B,C],[perp,F,D,B,C],[coll,G,A,C], [perp,G,D,A,C]],[[sqdis,A,B],[sqdis,B,C],[sqdis,A,C]], [[COLL,E,F,G]]]); Note that the result obtained here is stronger than that obtained with method WU-C: one ndg condition ¬[coll, A, B, C] is removed from the description. WU-D. An advantage of Wu’s method is that it can be used to prove differential geometric theorems and mechanics [35]. The following is an example.
52
Xiao-Shan Gao and Qiang Lin
Example Kepler-Newton. Prove Newton’s gravitational laws using Kepler’s laws. Kepler’s first and second laws can be described as follows. K1. Each planet describes an ellipse with the sun in one focus. K2. The radius vector drawn from the sun to a planet sweeps out equal areas in equal times. These laws can be expressed as the following differential equations. h1 = r2 − x2 − y 2 = 0 h2 = a2 − x2 − y 2 = 0 k1 = r − p − ex = 0 ∧ p = 0 ∧ e = 0 k2 = x y − y x = 0. Newton’s law can be expressed as n1 = (ar2 ) = 0. Then the problem is to prove (h1 = 0 ∧ h2 = 0 ∧ k1 = 0 ∧ k2 = 0) ⇒ n1 = 0. With MMP/Geometer, it is proved that the above statement is false. When add a ndg condition p = 0 (the ellipse does not becomes a straightline), we may use MMP/Geometer to prove the statement. depend([a,r,y,x],[t]); wdprove([[a,r,y,x,p,e],[],[], [r^2-x^2-y^2,a^2-x[2]^2-y[2]^2, x*y[2]-x[2]*y, r-p-e*x], [p],[diff(a*r^2,t)]]); Command depend([a, r, y, x], [t]) defines a, r, y, x as functions in t. The following command proves that “A space curve C satisfies t = k = 0 is a circle.” curve(); wprove_curve([[],[],[],[t,diff(k,s)],[], [[FIX_PLANE,C],[FIX_SPHERE,C]]]); The curve C, its arc length s, its torsion t and curvature k are defined in command curve(). diff(k, s) is the differentiation of k with s. There are two conclusions: [FIX PLANE,C] meaning that C is on a plane and [FIX SPHERE,C] meaning that C is on a sphere. WU-F. As pointed out by Wu [34], Wu-Ritt’s zero decomposition theorem can be used to discover geometric relations automatically. We use the following example to illustrate this. Example Heron-Qin Formula. Find the formula for the area of a triangle ABC in terms of its three sides. This problem may be solved with MMP/Geometer as follows wderive( [[x,y,k],[a,b,c],[B,[0,0], C,[a,0], A, [x,y]], [[dis, A, C, b], [dis, A, B, c],[area, k, A, B, C]], [], []]);
MMP/Geometer – A Software Package for Automated Geometric Reasoning
53
The above command will find the following relation between the last main variable k and the parameters: a, b, c automatically: 16 ∗ k 2 + a4 − 2 ∗ b2 ∗ a2 − 2 ∗ c2 ∗ a2 + b4 − 2 ∗ c2 ∗ b2 + c4 = 0. In general, we may formulate the problem as follows. Let U = {u1 , · · · , um } be a set of parameters and X = {x1 , · · · , xn } a set of dependent variables. The relation between the ui and the xj is given by a set of algebraic or differential equations and inequations: P1 (U, X) = 0, · · · , Ps (U, X) = 0 D1 (U, X) = 0, · · · , Dr (U, X) = 0. The problem is to find the relation between x1 and U, which can be done with Wu-Ritt zero decomposition under the following order u1 < u2 · · · < um < x1 . 3.2
The Area Method
This method uses high-level geometric invariants such as the area and the Pythagorean difference as the basic tool of proving geometric theorems [8]. Instead of eliminating variables as in Wu’s method, the area method eliminates points from geometric invariants directly. The advantage is that short and human-readable proofs for geometric statements could be produced. This method works for constructive geometric statements. The signed area SABC of triangle ABC is the usual area with a sign depending on the order of the three vertices of the triangle. The following properties of the signed area is clearly true. A1 Let M be the intersection of two non-parallel lines AB and P Q and Q = M . M P AB = SSQAB . Then P QM A2 If A = B, P Q AB iff SP AB = SQAB . Let us consider the following example. aprove("Example Parallelogram. Let ABCD be a parallelogram. O is the intersection of diagonals AC and BD. Show that O is the midpoint of AC."); MMP/Geometer produces the following proof for the parallelogram theorem, which is with clear geometric meaning. The comments on the right hand side is added by the authors. SABD AO OC = SBCD SABC = SABC = 1.
By A1. By A2, SABD = SABC , SBCD = SABC .
To deal with perpendicularity, we need to define the Pythagorean difference. For points A, B, and C, the Pythagorean difference, PABC , is defined to be 2 2 2 PABC = AB + CB − AC . The following Pythagorean theorem is taken as a basic (unproven) property of the Pythagorean difference.
54
Xiao-Shan Gao and Qiang Lin A
D
E
C O
H
A
B
C
F
B
Fig. 3. Parallelogram Theorem and Orthocenter Theorem
P1 AB⊥P Q iff PP AB = PQAB . Let us consider the following example. aprove("Example Orthocenter. ABC is a~triangle. F is the foot from A~to BC. E is the foot from B to AC. H is the intersection of lines AF and BE. Show that CH is perpendicular to AB."); By P1, we need only to show PACH = PBCH . MMP/Geometer produces the following proof for the Orthocenter theorem. PACH PBCH
=
PACB PBCA
=
PACB PACB
= 1.
By P1, we can eliminate point H as follows: PACH = PACB ; PBCH = PBCA . The following is the machine proof for Simson’s Theorem. Point G1 = EF ∩ AG = AC is added by MMP/Geometer automatically. We need only to prove CG AG1 . CG1
Details on this proof may be found in [8] The eliminants G PBAD AG1 G1 SAEF AG = = , BG SBEF −PABD BG
The machine proof (
AG BG
)/(
AG1 BG1
G1 SBEF = SAEF
)
1
F PACD ·SABE −PCAD ·SACE , SBEF = PACA PACA E −PBCD ·SABC EP ·S SACE = , SABE = CBD ABC PBCB PBCB F
·
SAEF =
AG BG
G
PBAD ·SBEF SAEF ·(−PABD )
F
−PBAD ·PACD ·SABE ·PACA (−PCAD ·SACE )·PABD ·PACA
= =
simplif y
=
E
=
PBAD ·PACD ·SABE PCAD ·SACE ·PABD
PBAD ·PACD ·PCBD ·SABC ·PBCB PCAD ·(−PBCD ·SABC )·PABD ·PBCB
simplif y
=
co−cir
=
simplif y
=
PBAD ·PACD ·PCBD −PCAD ·PBCD ·PABD
− 2(B D·A B·cos(AD)) − 2(C D·B C·cos(BD)), PCAD =2(A D·A C·cos(CD)) PCBD =2(B D·B C·cos(CD)) PACD = − 2(C D·A C·cos(AD)) PBAD =2(A D·A B·cos(BD)) PABD =
PBCD =
(2AD·AB·cos(BD))·(−2C D·AC·cos(AD))·(2B D·B C·cos(CD)) −(2AD·AC·cos(CD))·(−2C D·B C·cos(BD))·(−2BD·AB·cos(AD)) 1
MMP/Geometer – A Software Package for Automated Geometric Reasoning
55
C D F
A
E
G
B
Fig. 4. Orthocenter Theorem
3.3
Deductive Database Method
For a given geometric diagram, MMP/Geometer can generate a geometric deductive database (GDD) which contains all the properties of this diagram that can be deduced from a fixed set of geometric axioms, and for each geometric property in the database, MMP/Geometer can generate a proof in traditional style [9]. Let D0 be the premise of a geometric statement and R the set of geometric axioms or rules. We may use the breadth-first forward chaining method to find new properties of the corresponding diagram. Basically speaking, the method works as follows D0
R
⊂
D1
R
⊂
R
... ⊂
Dk
(Fixpoint)
where Di+1 is the union of Di and the set of new properties obtained by applying rules in R to properties in Di . If at certain step Dk = Dk+1 , i.e., R(Dk ) = Dk , then we say that a fixpoint (of reasoning) for D0 and R is reached. The naive form of breadth-first forward chaining is notorious for its inefficiency. But, in the case of geometric reasoning, by introducing new data structure and search techniques, we manage to build a very effective prover based on this idea [9]. The GDD method may take a statement in predicate, constructive, or natural language form as input. Let us consider the following form of the Orthocenter Theorem (Fig. 4). prove_gdd("Example Orthocenter. ABC is a~triangle. D is the foot from B to AC. E is the foot from C to AB. F is the intersection of lines BD and CE. G is the intersection of lines BC and AF."); The initial database is the hypotheses: D, A, C; E, A, B; F, B, D; F, C, E; G, B, C; G, A, F are collinear sets, BD ⊥ AC, CE ⊥ AB. The fixpoint contains 151 geometric properties: 6 collinear point sets,
56
Xiao-Shan Gao and Qiang Lin
3 perpendicular pairs, 6 co-cyclic points sets, 24 equal angle pairs, 7 similar triangles sets, 105 and equal ratio pairs. The forward chaining is a natural way of discovering properties for a given geometric configuration. Any thing obtained in the forward chaining may be looked as a “new” result. Take the simple configuration (Fig. 4) related to the orthocenter theorem as an example. MMP/Geometer has discovered the most often mentioned properties about this configuration: AG ⊥ BC (the orthocenter theorem) and EGA = AGD. The fixpoint also contains seven sets of similar triangles DBA ∼ DCF ∼ EBF ∼ ECA; DCB ∼ DF A ∼ GF B ∼ GCA; EF A ∼ EBC ∼ GBA ∼ GF C; F BC ∼ F ED ∼ GBD ∼ GEC; ACB ∼ AED ∼ GCD ∼ GEB; CED ∼ CAF ∼ GAD ∼ GEF ; F BA ∼ EBD ∼ F GD ∼ EGA. For each geometric property in the database, MMP/Geometer can produce a proof of traditional style. The following is the proof for the Orthocenter Theorem (AG ⊥ BC) by MMP/Geometer. Notice that the proof is in an “analysis style”, i.e., it starts from the conclusion and goes all the way to the hypotheses of the statement. 1. AG ⊥ BC, because AC ⊥ BD(hypothesis), (2)[AC, BD] = [BC, AF ]. 2. [AC, BD] = [BC, AF ], because (3)[AC, BC] = [BD, AF ].(This is rule in MMP/Geometer ). 3. [CA, CB] = [BD, AF ], because (4)[CA, CB] = [DE, AB], (5)[BD, AF ] = [DE, AB]. 4. [CA, CB] = [DE, AB], because (6)co-cyclic[B, D, C, E]. 5. [BD, AF ] = [DE, AB], because (7)co-cyclic[A, D, E, F ]. 6. co-cyclic[B,D,C,E], because DC ⊥ DB(hypothesis), EC ⊥ EB(hypothesis). 7. co-cyclic[A, D, E, F ], because DF ⊥ DA(hypothesis), EF ⊥ EA(hypothesis).
MMP/Geometer – A Software Package for Automated Geometric Reasoning Q
A
D
M
L D
F
I B
C
R
H
E
A0
G
C
A
O
E M
N
M
J K
57
(b)
B
(a)
S
N A A0
(c)
P
Fig. 5. Three Geometric Theorems The first step of the proof can be understood as follows. AG ⊥ BC is true because AC ⊥ BD which is a hypothesis and [AC, BD] = [BC, AF ] which will be proved in the second step. The other steps can be understood similarly. One of the largest databases obtained with MMP/Geometer is for the ninepoint circle theorem (Fig. 5(a)), which contains 6019 geometric relations. In predicate form, the database contains 6646428 predicates. prove_gdd("Example Nine-point-circle. ABC is a triangle. K is the midpoint of BC. L is the midpoint of CA. M is the midpoint of AB. D is the foot from B to AC. E is the foot from C to AB. F is the intersection of lines BD and CE. G is the intersection of lines BC and AF. H is the midpoint of AF. I is the midpoint of BF. J is the midpoint of CF.Show that K, G, J, D are cocircle."); Constructing new points or lines is one of the basic methods for solving geometric problems. One advantage of MMP/Geometer is that it can automatically add auxiliary points to prove a geometric statement if needed [9]. The following example is shown in Fig. 5(b). prove_gdd("Example Trapezoid. Let ABCD be a trapezoid. M is the midpoint of AC. N is the midpoint of BD. E is the intersection of lines MN and BC. Show that E is the midpoint of BC."); The conclusion is not in the first fixpoint. The program then automatically adds an auxiliary point A0 which is the midpoint of AD. With this auxiliary point, MMP/Geometer generates a fixpoint containing the conclusion. The Butterfly theorem in Fig. 5(c) also needs auxiliary points. prove_gdd("Example Butterfly-Theorem. P, Q, R, and S are four points on a circle O. A is the intersection of lines PQ and SR. N is the intersection of line PR and the line passing through A and perpendicular to OA. M is the intersection of line QS and the line passing through A and perpendicular to OA. Show that A is the midpoint of NM.");
58
Xiao-Shan Gao and Qiang Lin Wu’s Method Area Method GDD Method Example Time Example Time Example Time Simson (WU-C) 20 Parallelogram 10 Orthocenter 110 Simson (WU-G) 80 Orthocenter 10 Trapezoid 50 Kepler-Newton 3200 Simson 30 Butterfly 110 Curve 2100 Nine-point 560(s) Herron-Qin 10
Table 1.
Statistics for the examples
For this problem, MMP/Geometer automatically adds an auxiliary point A0 which is the intersection of the line passing through S and parallel to AN and the circle O. With this point, MMP/Geometer generates a fixpoint which contains the conclusion. 3.4
Implementation and Experimental Results
MMP is developed with VC in a Windows environment. Current version may be found in the webpage listed in [12]. Many techniques are introduced to enhance the efficiency of the proving algorithms. One of the main operation in Wu’s method is to test whether the successive pseudo-remainder of a polynomial P with respect to a triangular set T S is zero. We implements three techniques to enhance the efficiency. Simplifying. Let T S be the triangular set and LT S the set of the polynomials in T S which contain less than three terms and are linear in their leading variables. Then the pseudo remainder of a polynomial Q with LT S contains equal or less terms than Q. Therefore, when we take the pseudo remainders of P and the polynomials in T S with respect to LT S to obtain a polynomial P and a new triangular set T S , and then compute the pseudo-remainder of P with respect to T S . Branching. Suppose that we need to compute the pseudo-remainder prem(c, d). If c = cs xsk + .. + c0, d = dt xtj + .. + d0 and j < k, then we can check whether prem(ci , d) = 0, i = 0, ..., s instead of whether prem(c, d) = 0. Generally speaking, each prem(ci , d) has fewer terms than prem(c, d) and is easy to compute. Dividing Extraneous Factors. It is known that extraneous factors appear in the process of doing pseudo remainders. These factors are removed automatically to reduce the size of the polynomials in the proof. Table 1 contains the running times for the examples in this Section 3. The data is collected on a PC compatible with 1.5G CPU. The time is in microseconds. Why do we implement more than one method in MMP/Geometer? First, each method has its advantages and shortcomings. Generally speaking, the proving power of the methods are as follows
MMP/Geometer – A Software Package for Automated Geometric Reasoning
59
Methods No. of Theorems Source WU-C 512 [2] WU-G 450 [3] WU-D 100 [6] WU-F 120 [4] AREA 400 [8] DBASE 170 [9]
Table 2. Theorems proved using Wu’s method, area method and GDD method
WU-C > WU-G > AREA > DBASE. Table 2 gives the number of theorems proved with these methods. When considering to produce elegant and human-understandable proofs, the order is reversed. Second, with these methods, for the same theorem, the prover can produce a variety of proofs with different styles. This might be important in using MMP/Geometer to geometry education, since different methods allow students to explore different and better proofs. Only a selective set of examples shown in Table 2 was tested in MMP/Geometer. We expect that almost all of the theorems mentioned in the above table can be proved with MMP/Geometer since the methods used in MMP/Geometer are improved version for the original methods used to prove them.
4 4.1
Automated Geometric Diagram Generation Dynamic Geometry
By dynamic geometry, we mean computer generated geometric figures which could be changed dynamically. Generally, we may perform the following operations on the figures: dynamic transformation, dynamic measurement, free dragging, and animation. By doing dynamic transformations and free dragging, we can obtain various forms of diagrams easily and see the changing process vividly. Through animation, the user may observe the generation process for figures of functions. Most dynamic geometry software systems [23, 22, 13] use construction sequences of lines and circles to generate diagrams. Since such sequences are easy to compute, dynamic geometry software systems are usually very fast. As an example, let H be the orthocenter of triangle ABC. We fix points A and B and let point C move on a circle c. We want to know the shape of the locus of point H. Let (x0 , y0 ) and r be the center and radius of circle c, A = (0, 0), and B = (d, 0). With Wu’s method of mechanical formula derivation, we may obtain the equation of this locus ((x − x0 )2 + y02 − r2 )y 2 + 2y0 (x − d)xy + (x − d)2 x2 = 0
60
Xiao-Shan Gao and Qiang Lin
with MMP/Geometer as follows. wderive([[y3,x3,y2,x2,y1,x1,y],[x,d,x0,y0,r], [A,[0,0],B,[d,0],O,[x0,y0],C,[x1,y1],H,[x,y]], [[dis,C,O,r],[perp,A,H,B,C],[perp,B,H,A,C]],[],[]]); But from this equation, we still do not know the shape of the curve. With MMP/Geometer, we can draw the diagram of this curve as the locus of point H. By continuously changing the radius of circle c, we may observe the shape changes of the curve (Fig. 6). The diagram in Fig. 7 is to generate the locus of the moon when the moon rotates around the earth on a circle and the earth rotates around the sun on an ellipse. For its description, please consult [12]. In dynamic geometry, the drawing process is based on the constructive description for a diagram, that is, each geometric object is constructed with ruler and compass. In a construction sequence, free and semi-free points could be dragged. The computation can be carried out in real-time because the equations raised from a construction sequence are almost in triangular form: variables are introduced at most two by two. Further, only equations with degree less than or equal to two are involved. MMP/Geometer has all the above functions of dynamic geometry. C C
C
C
H A
H B
A
B
A
B
A
B
H H
Fig. 6. Continuous change for the locus of the orthocenter Earth Moon Sun
Fig. 7. Locus of the moon
MMP/Geometer – A Software Package for Automated Geometric Reasoning
(a)
(b)
61
(c)
Fig. 8. A diagram with 21 given distances
4.2
Intelligent Dynamic Geometry
Most geometric diagrams in geometry textbooks are described declaratively, and the task of converting such a description to constructive form is usually done by human. For some diagrams, it is difficult to find a constructive solution, and for more diagrams there exist no ruler and compass constructions. In MMP/Geometer, by combining the idea of dynamic geometry and AGDG we implement an intelligent dynamic geometry software system, which can be used to input and manipulate diagrams conveniently. There are two major steps to draw a declaratively given diagrams. First, we try to find a ruler and compass construction by mechanizing some of the techniques of ruler and compass construction developed since the time of ancient Greek. If we fail to do so, general AGDG methods are used to draw the diagram. To find a ruler and compass construction for a geometric diagram in predicate form, we first transform the geometric relations into a graph and then solve it in two steps. 1. We repeatedly remove those geometric objects that can be constructed explicitly until nothing can be done. This simple algorithm is linear [11] and solves about eighty percent of the 512 problems reported in [2]. 2. If the above step fails, we use Owen and Hoffmann’s triangle decomposition algorithms [20, 29] to reduce the problem into the solving of triangles. 3. If the above step fails, we use certain geometric transformations to solve the problem[11]. This is a quadratic algorithm and is complete for drawing problems of simple polygons. To see the power of the methods, let us look at the example in Fig. 8, where each line segment represents a given distance between its two end points. We have twenty one distances. In order to solve the problems algebraically, we need to solve an equation system consisting of twenty one quadratic equations. But with the triangle decomposition [20, 29], the problem can be reduced to solving of triangles, as shown in Figures 8(b) and (c). As a consequence, the problem is ruler and compass constructible. As another example, let us draw the quadrilateral in Fig. 9, which cannot be solved with the triangle decomposition method. This diagram cannot be drawn
62
Xiao-Shan Gao and Qiang Lin P4
P4
L4 P1
L4 P 2’ L3
P1
L3 L1
L1 L2
P2
L2 P3
P2
P3
Fig. 9. Lengths of four edges and angle (L2 , L4 ) are given with ruler and compass explicitly. To solve it, MMP/Geometer adds a parallelogram P1 P2 P3 P2 [11]. Since P4 P1 P2 , |P1 P2 |, |P3 P2 | are known, it is easy to find a construction sequence for quadrilateral P3 P4 P1 P2 . Point P2 can be constructed easily. Using methods of AGDG allows us to have more power to manipulation the diagram. If a construction sequence for a diagram has been given, we may only drag the free and semi-free points in the diagram. This drawback may be overcomed as follows. Suppose that we want to drag a point, we may re-generate a new construction sequence in which the point is a free point. This kind of dragging is called intelligent dragging. Let us consider the diagram in Fig. 4. A construction order for the points in this diagram is as follows A, B, C, E, D, G, F where A, B, C are free points. F is the intersection of lines BD and CE, hence a fixed point. In dynamic geometry software, we cannot drag this point. But in MMP/Geometer, when a user wants to drag this point, a new construction sequence F, A, B, E, D, G, C is automatically generated, in which F is a free point and can be dragged. If we cannot find a ruler and compass construction sequence for a problem, MMP/Geometer will try to solve the problem with the following algorithms. 1. Graph analysis methods are used to decompose the problem into c-trees [14]: 2. The c-tree is reduced to a general construction sequence C1 , C2 , · · · , Cm where Ci are sets of geometric objects such that – Ci can be constructed from ∪i−1 k=1 Ck . – and Ci is the smallest set satisfying the above condition. 3. Compute the position of Ci from C1 , · · · , Ci−1 . MMP/Geometer uses two methods to do this. Optimization Method The problem is converted to solving a set of algebraic equations: f1 (X) = 0, · · · , fm (X) = 0
MMP/Geometer – A Software Package for Automated Geometric Reasoning
n=1
n = 2 (Malfatti Problem)
63
n=8
Fig. 10. Packing circles into a triangle
where X is a set of variables. Let σ(X) =
m
fi2 .
i=1
We use the BFGS method to find a position X0 such that σ(X0 ) is a minimal value [17]. If σ(X0 ) = 0 then X0 is a set of solutions for original equation system. Locus Intersection Method (LIMd) The above method based on optimization can find one solution only. If we want to find all the solutions, we may use the LIMd method [15]. The LIMd method is a hybrid method to find all solutions to geometric problems. Let us consider a problem of packing circles into a fixed triangle. The problem is to pack n(n + 1)/2 circles (n rows of circles) tangent to adjacent circles and the adjacent neighboring sides of a given triangle. Fig. 10 is the cases for n = 1, 2, 8. The most difficult case is n = 8, in which we need to solve 24 quartic equations and 84 quadratic equations simultaneously. This equation system cannot be simplified essentially. Table 3 shows the running times for different n of this problem on a PC with CPU 1.5G. It seems that problems of large size can be solved in real time.
# circles (# rows) # quartic equations # quadratic equations 3 (2) 6 3 6 (3) 9 9 10 (4) 12 18 15 (5) 15 30 21 (6) 18 45 28 (7) 21 63 36 (8) 24 84
time 0.18 0.50 1.72 1.93 4.15 10.92 15.45
Table 3. Running statistics for the tangent packing problems
64
4.3
Xiao-Shan Gao and Qiang Lin
Implementation Issues
After an algorithm is selected, we still need to add details in the implementation to enhance the performance of the algorithm. One problem is the ambiguities rising from operations like “intersection of two circles” or “intersection of a circle and a line”. These constructions have several solutions. When the user drags a point randomly, the program will compute the position of all points in the figure automatically. Our goal is to keep a continuous movement of dependent elements. In other words, we try to avoid “jumps”. The problems is solved by comparing the two solutions with the initial positions and then the software will remember the relative position of the relevant elements. During the generation of construction sequences or generalized construction sequences, we need to select a starting elements in order to obtain better construction sequences. We adopt the following strategies: (1) Use the input order by the user as the initial order; (2) always try to construction lines before points; (3) try to use the distance constraints before other constraints. Another major concern is the speed. While we dragging the diagram randomly, we hope to see smooth movements. We adopt the following strategies to keep the software fast: (1) if the dragging element o is not the first element in a construction sequence, then we need only to compute the positions for those elements after o in the construction sequence; (2) when searching construction sequences, try to use the constructions which are easier to compute; (3) optimize the code by using explicit formulas to solve linear and quadratic equations. The result is encouraging: the software may give smooth movements for most problems containing less than one hundred geometric elements.
5
Conclusions
MMP/Geometer is a geometric software. It can be used to prove and discover theorems in Euclidean and differential geometries. It can also be used to produce proofs with geometric meanings and proofs in traditional style. We are currently building a webpage which will include MMP/Geometer and a large set of geometric theorems including those mentioned in Table 2. MMP/Geometer can also be used as a geometric diagram editor. For a given input, MMP/Geometer will draw the diagram first using ruler and compass construction and then using general AGDG methods. It seems that large diagrams such as those in Fig. 10 can be handled satisfactorily. Altogether, we hope that MMP/Geometer may provide a useful tool for people to study, to learn and to use geometry.
Acknowledgements We want to thank Prof. Wen-Ts¨ un Wu for long time encouragements. The first author also wants to thank Prof. Shang-Ching Chou for insightful discussions. Many of the methods implemented in MMP/Geometer are developed under collaboration with Prof. Chou.
MMP/Geometer – A Software Package for Automated Geometric Reasoning
65
References [1] P. Aubry, D. Lazard and M. Moreno Maza, On the Theories of Triangular Sets, J. of Symbolic Computation, 28, 45-124, 1999. 50 [2] S. C. Chou, Mechanical Geometry Theorem Proving, D.Reidel Publishing Company, Dordrecht, Netherlands, 1988. 48, 50, 59, 61 [3] S. C. Chou and X. S. Gao, Ritt-Wu’s Decomposition Algorithm and Geometry Theorem Proving, Proc. CADE’10, M. E. Stickel (Ed.) 207-220, LNCS, No. 449, Springer-Verlag, Berlin, 1990. 59 [4] S. C. Chou and X. S. Gao, Mechanical Formula Derivation in Elementary Geometries, Proc. ISSAC-90, 265-270, ACM Press, New York, 1990. 59 [5] S. C. Chou and X. S. Gao, Proving Constructive Geometry Statements, Proc. CADE11, D. Kapur (eds), 20-34, Lect. Notes on Com Sci., No. 607, SpringerVerlag, 1992. 48, 49, 51 [6] S. C. Chou and X. S. Gao, Automated Reasoning in Differential Geometry and Mechanics: Part II. Mechanical Theorem Proving, J. of Automated Reasoning, 10, 173-189, Kluwer Academic Publishers, 1993. 59 [7] S. C. Chou and X. S. Gao, Automated Reasoning in Geometry, Handbook of Automated Reasoning, (eds. A. Robinson and A. Voronkov), 709-749, Elsevier, Amsterdam, 2001. 45 [8] S. C. Chou, X. S. Gao and J. Z. Zhang, Machine Proofs in Geometry, World Scientific, Singapore, 1994. 45, 47, 53, 54, 59 [9] S. C. Chou, X. S. Gao and J. Z. Zhang, A Deductive Database Approach To Automated Geometry Theorem Proving and Discovering, J. Automated Reasoning, 25, 219-246, 2000. 45, 55, 57, 59 [10] P. J. Davis, The Rise, Fall, and Possible Transfiguration of Triangle Geometry: A Mini-history, The American Mathematical Monthly, 102, 204-214, 1993. 45 [11] X. S. Gao, L. Huang and K, Jiang, A Hybrid Method for Solving Geometric Constraint Problems, in Automated Deduction in Geometry, J. Richter-Gebert and D. Wang (eds), 16-25, Springer-Verlag, Berlin, 2001. 45, 46, 61, 62 [12] X. S. Gao, D. K. Wang, Z. Qiu, H. Yang and D. Lin, MMP: A MathematicsMechanization Platform - a Progress Report, Preprints, MMRC, Academ,ia Sinica, April, 2002. http://www.mmrc.iss.ac.cn/˜ mmsoft/. 44, 47, 48, 49, 58, 60 [13] X. S. Gao, J. Z. Zhang and S. C. Chou, Geometry Expert (in Chinese), Nine Chapter Pub., Taipai, Taiwan, 1998. 46, 59 [14] X. S. Gao and G. Zhang, Geometric Constraint Solving via C-tree Decomposition, in Proc. of ACM SM03, June, 2003, Seattle, ACM Press, New York. 62 [15] X. S. Gao, C. M. Hoffmann and W. Yang, Solving Basic Gometric Constraint Configurations with Locus Intersection, Proc. ACM SM02, 95-104, Saarbruecken Germany, ACM Press, New York, 2002. 45, 46, 63 [16] X.-S. Gao, C. Zhu, S.-C. Chou and J.-X. Ge, Automated Generation of Kempe Linkages for Algebraic Curves and Surfaces, Mechanism and Machine Theory, 36(9), 1019-1033, 2002. 45, 46 [17] J. Ge, S. C. Chou and X. S. Gao, Geometric Constraint Satisfaction Using Optimization Methods, Computer Aided Design, 31(14), 867-879, 2000. 45, 46, 63 [18] H. Gelernter, Realization of a Geometry-theorem Proving Machine, Comput. and Thought, (E. A. Feigenbaum, J. Feldman, eds.), 134-152, Mcgraw Hill, New York, 1963. 45
66
Xiao-Shan Gao and Qiang Lin
[19] A. Heydon and G. Nelson, The Juno-2 Constraint-Based Drawing Editor. SRC Research Report 131a, 1994. 46 [20] C. Hoffmann, Geometric Constraint Solving in R2 and R3 , in Computing in Euclidean Geometry, eds. Z. Du and F. Huang, 266-298, World Scientific, 1995. 46, 61 [21] H. Hong, D. Wang and F. Winkler, Short Description of Existing Provers, Ann. Math. Artif. Intell., 13: 195-202, 1995. 46 [22] N. Jakiw, Geometer’s Sketchpad, User Guide and Reference Manual, Key Curriculum Press, Berkeley, 1994. 46, 59 [23] J. M. Laborde, GABRI Geometry II, Texas Instruments, Dallas, 1994. 46, 59 [24] R. S. Latheam and A. E. Middleditch, Connectivity Analysis: a Tool for Processing Geometric Constraints, Computer Aided Design, 28(11), 917-928, 1994. 46 [25] D. Lazard, A New method for Solving Algebraic Systems of Positive Dimension, Discrete Appl. Math., 33, 147-160, 1991. 50 [26] M. Kalkbrener, A Generalized Euclidean Algorithm for Computing Triangular Representations of Algebraic Varieties, J. Symb. Comput., 15, 143–167, 1993. 50 [27] D. Kapur and H. K. Wan, Refutational Proofs of Geometry Theorems via Characteristic Set Computation, Proc. of ISSAC’90, 277-284, ACM Press, 1990. 50 [28] J. Richter-Gebert and U. H. Kortenkamp, The Interactive Geometry Software Cinderalla, Springer, Berlin Heidelberg, 1999. 46 [29] J. Owen, Algebraic Solution for Geometry from Dimensional Constraints, in ACM Symp., Found of Solid Modeling, 397-407, ACM Press, Austin TX, 1991. 61 [30] D. Wang, Elimination Methods, Springer, Berlin, 2000. 44, 50 [31] D. Wang, Geother: A Geometry Theorem Prover, In: Proc. CADE-13, LNAI 1104, 166-170, Springer, Berlin, 1996. [32] D. K. Wang, Polynomial Equations Solving and Mechanical Geometric Theorem Proving. Ph.D Thesis, Inst. of Sys. Sci., Academia Sinica, 1993. 50 [33] W. T. Wu, Basic Principles of Mechanical Theorem Proving in Geometries, Science Press, Beijing (in Chinese), 1984. English Version, Springer-Verlag, Berlin, 1994. 44, 45, 50, 51 [34] W. T. Wu, A Mechanization Method of Geometry and its Applications I. Distances, Areas, and Volumes. J. Sys. Sci. and Math. Scis., 6, 204–216, 1986. 52 [35] W. T. Wu, A Constructive Theory of Differential Algebraic Geometry, In: LNM 1255, Springer, Berlin Heidelberg, 173–189, 1987. 51 [36] W. T. Wu, Mathematics Mechanization, Science Press/Kluwer, Beijing, 2000. 44, 45, 50, 51 [37] L. Yang, J. Zhang and X. R. Hou, Nonlinear Algebraic Equation System and Automated Theorem Proving, Shanghai Sci. and Tech. Education Publ. House, Shanghai (1996) [in Chinese]. 50
The SymbolicData GEO Records – A Public Repository of Geometry Theorem Proof Schemes Hans-Gert Gr¨ abe Univ. Leipzig, Germany http://www.informatik.uni-leipzig.de/~graebe
Abstract. Formalized proof schemes are the starting point for testing, comparing, and benchmarking of different geometry theorem proving approaches and provers. To automatize such tests it is desirable to collect a common data base of proof schemes, and to develop tools to extract examples, prepare them for input to different provers, and run them “in bulk”. The main drawback so far of special collections, e.g., Chou’s collection [2] with more than 500 examples of proof schemes, was their restricted availability and interoperability. We report about first experience with a generic proof schemes language, the GeoCode language, that was invented to store more than 300 proof schemes in a publicly available repository, and tools to prepare these generic proof schemes for input to different target provers. The work is part of the SymbolicData project [15].
1
Introduction
Proofs in classical textbooks on geometry are usually tricky, involve a big portion of heuristics and are hard to formalize and even to systematize. Nevertheless just these circumstances – the small set of prerequisites necessary to formulate the problems and the erudition and non formal approaches required to solve them – generate the great interest even of leisure mathematicians in geometry problem solving. With this experience in mind it seems to be impossible to find a systematic way to prove geometry theorems. But such a unified approach provides, e.g., the coordinate method: Translate geometric configurations into algebraic relations between coordinates and try to solve the algebraic counterpart of the geometric problem by algebraic methods. It was this framework that inspired the young Gauss for his famous solution to construct a regular 17-gon by ruler and compass. With increasing capabilities of modern computer equipment to perform symbolic algebraic manipulations the attempts to algorithmize and mechanize this part of mathematics made great progress. Many deep results on mechanized geometry theorem proving were discovered by the “Chinese provers” in the school of W.-T. Wu at MMRC and their collaborators all over the world. For a survey on the current state of the art see, e.g., the monographs [2, 3, 4, 21, 22] or the conference proceedings on “Automated Deduction in Geometry” [17, 5, 14] and this volume. F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 67–86, 2004. c Springer-Verlag Berlin Heidelberg 2004
68
Hans-Gert Gr¨ abe
The proofs are not “automated” but “mechanized” in the following sense: A partly informal human readable geometric statement requires a translation into proof schemes or coordinatizations written in a strong computer readable syntax. These (yet purely geometric) proof schemes are the starting point for automated application of different proving approaches. Although straightforward in most cases, some theorems require a quite tricky coordinatization to get an algebraic translation that can be handled by current provers and computers. To test, compare and benchmark different provers and software it is desirable to have such proof schemes collected in a common publicly available repository in digital form and a common format that easily translates to the special input formats of different provers. This requires to agree upon a generic proof scheme language standard that can be managed with appropriate tools by all interested parties. Below we describe a first approach to such a standard, the GeoCode. It is used to store proof schemes as GEO records in a repository that is publicly available as part of the SymbolicData project [15]. At the moment the SymbolicData GEO collection contains more than 250 proof schemes, mainly from [2]. Special Perl based tools support the syntactical translation of GeoCode into the special input format of provers that implemented this common interface. At the moment – as a first reference application – this interface is implemented in the different versions of the author’s GeoProver packages [8], that provide tools to run proof scheme translations based on the coordinate method on one of the major CAS (Maple, Mathematica, MuPAD, Reduce). Figure 1 shows the relation between the SymbolicData PROBLEMS and GEO records, the GeoCode syntax definition, the GeoProver (lower row), and different stages of the process of mechanized theorem proving (upper row). This paper starts with some background on geometry theorem proving (section 2). Then we describe the design of the GEO records, the syntax of the GeoCode standard and the GeoProver packages as an implementation of that standard (section 3). In section 4 we discuss by means of examples how to compile new (generic) proof schemes, to translate them into GeoProver notion, to run this code on different CAS and to experiment with the resulting algebraic problems. For real usability of the GeoCode concept one has to estimate the efforts required to implement this standard for other provers. There is not yet practical experience but the semantic similarity of “foreign” special geometric proof schemes suggests that such an interface should easily be implemented. The problem is discussed to some extend in section 5.
2
The Coordinate Method
The main approach to mechanized geometry theorem proving considered so far uses the coordinate method: It translates geometric statements into their algebraic counterparts, i.e., statements about systems of polynomial or rational functions, and tries to solve these algebraic problems by algebraic methods.
The SymbolicData GEO Records
Informal geometric statements
formal geometric ✲ statements Proof Schemes
Proof Writer
algebraic ✲ translation
Translator
Solution Writer
✲
69
algebraic proof
❄ Diagram Drawings
PROBLEMS Records
1
*
✲
GEO Records
Perl based SD Tools
✲
GeoProver for different CAS
✻ GeoCode Syntax
Fig. 1. Formal and informal elements in mechanized geometry theorem proving and their counterparts in the SymbolicData concept A particularly simple proof technique applies to geometric configurations of constructive type. To prove, e.g., the median intersection theorem, take three generic points A, B, C, construct the midpoints A1 , B1 , C1 of the segments BC, AC and AB and check for the lines AA1 , BB1 and CC1 to satisfy the concurrency condition. Here is this proof scheme in GeoCode syntax: $A:=Point[a1,a2]; $B:=Point[b1,b2]; $C:=Point[c1,c2]; $A1:=midpoint[$B,$C]; $B1:=midpoint[$A,$C]; $C1:=midpoint[$A,$B]; is_concurrent[pp_line[$A,$A1], pp_line[$B,$B1], pp_line[$C,$C1]]; or even shorter $A:=Point[a1,a2]; $B:=Point[b1,b2]; $C:=Point[c1,c2]; is_concurrent[median[$A,$B,$C], median[$B,$C,$A], median[$C,$A,$B]];
70
Hans-Gert Gr¨ abe
This proof scheme has pure geometric nature and can serve also for input to provers not based on the coordinate method or, to some extend, even for diagram drawing tools. With SymbolicData Perl tools the proof scheme translates, e.g., to the GeoProver MuPAD syntax A:=Point(a1,a2); B:=Point(b1,b2); C:=Point(c1,c2); A1:=midpoint(B,C); B1:=midpoint(A,C); C1:=midpoint(A,B); is_concurrent(pp_line(A,A1), pp_line(B,B1), pp_line(C,C1)); where now (the GeoProver -implementation of) midpoint(X, Y ) computes the coordinates of the midpoint of the segment XY and pp line(X, Y ) those of the line through X and Y . is concurrent(a, b, c) translates to a polynomial condition in the coordinates of a, b, c (in fact, a determinantal expression) that vanishes iff these lines pass through a common point. The return values of all these functions are (tuples of) rational expressions in the coordinates of the formal input parameters. To prove this theorem (and other theorems of this kind) means to compose a nested rational expression and to check if it simplifies to zero. In general, we say that a geometric configuration is of constructive type, if its generic configuration can be constructed step by step in such a way, that the coordinates of each successive geometric object can be expressed as rational functions in the coordinates of already constructed objects and algebraically independent variables, and the conclusion can be expressed as vanishing of a rational function in these coordinates. Note that due to Euclidean symmetry even for generic configurations some of the coordinates may be chosen in a special way. Geometry theorems with non-linear geometric conditions that cannot be solved rationally in the given indeterminates require other proof techniques. Consider, e.g., the angular bisector intersection theorem: The condition on bisector(P,A,B,C) for a point P = Point(x1 , x2 ) to be on either the inner or the outer bisector1 of ABC translates into a polynomial of (total) degree 4 in the generic coordinates of A, B, C and quadratic in the “dependent” coordinates of P . To prove the angular bisector intersection theorem we collect the conditions on P to be on each of the bisector pairs through A and B, solve the corresponding polynomial system for the coordinates of the intersection point(s) P and show that each solution belongs also to (one of) the bisectors through C. In more detail: Due to Euclidean symmetry we can choose special coordinates for A and B to simplify calculations. A:=Point(0,0); B:=Point(1,0); C:=Point(u1,u2); P:=Point(x1,x2); polys:={on_bisector(P,A,B,C), on_bisector(P,C,A,B)}; con:=on_bisector(P,B,C,A); 1
There is no way to distinguish between the inner and outer bisectors in unordered or dynamic geometry.
The SymbolicData GEO Records
71
polys is a system of two polynomial equations of degree 2 in (x1 , x2 ) with coefficients in Q(u1 , u2 ). It has 4 (generic) solutions that correspond to the 4 (generic) intersection points of the bisector pairs through A and B. They can be computed, e.g., with Maple: sol:=solve(polys,{x1,x2}); u2 − 2 %1 + 2 u1 %1 , x2 = %1, x1 = 1/2 u2 − %1 %1 = RootOf 4 u2 Z 4 + −8 u1 2 − 8 u2 2 +8 u1 Z 3 + −4 u1 u2 + 4 u1 2 u2 − 4 u2 + 4 u2 3 Z 2 + 4 u2 2 Z − u2 3 . The solution involves algebraic RootOf -expressions that require a powerful algebraic engine to cope with. For Maple, simplify(subs(sol,con)) returns 0 and thus proves the theorem generically. We can also reformulate the geometry theorem as a vanishing problem of the polynomial conclusion on the zero set of the system of polynomials that describe the given geometric configuration and solve it with a Gr¨ obner basis and normal form calculation (Maple) with(Groebner): TO:=plex(x1,x2): gb:=gbasis(polys,TO): normalf(con,gb,TO); In general, this kind of algebraization of geometry theorems yields a polynomial ring S = k[v] with variables v = (v1 , . . . , vn ), a polynomial system F ⊂ S that describes algebraic dependency relations in the given geometric configuration, a subdivision v = x ∪ u of the variables into dependent and independent ones, and the conclusion polynomial g(x, u) ∈ S. To prove the corresponding geometry theorem g(x, u) must vanish on all “geometrically relevant” components of the set of common zeroes of F . We get proof schemes of equational type. If we compute in the ring S0 = k(u)[x] as we did in the above example, exactly those components of the zero set of F are visible where the variable set u remains independent. Hence if the normal form of g wrt. a Gr¨ obner basis G of F computed in S0 vanishes, as in the example above, the geometry theorem is generically true, i.e., holds if some “special” configurations for the independent parameters are avoided that correspond to degenerate geometric situations. More subtle examples can be analyzed with the Gr¨ obner factorizer or more advanced techniques. There are also other algebraic techniques to analyze such polynomial systems, e.g., based on pseudo division and triangular sets. See [12] or the monographs [4, 20] for a survey.
3
GeoCode and GEO Records
Formalized proof schemes are the starting point for testing, comparing, and benchmarking different geometry theorem proving approaches and provers. To
72
Hans-Gert Gr¨ abe
automatize such tests it requires a data base of proof schemes, and tools to extract examples, prepare them for input to provers under consideration, and run them “in bulk”. To compile such a data base a “proof writer” has to fix (realistic) proof schemes for given informal statements of geometry theorems. Several people collected such data, e.g., S.-C. Chou who discussed in [2] more than 500 examples of geometric statements and appropriate algebraic translations. It is desirable not do that work twice but compile proof schemes in such a way that they can be easily prepared for input to different provers. The main drawback so far of special collections is the restricted interoperability of proof schemes. To fix a proof scheme for automated processing by different provers requires a generic language that can be mapped to all target systems. Below we report on our experience with the GeoCode language that was developed to store generic proof schemes in the SymbolicData GEO record collection. During our work on that collection we stored (and partly modified and adapted) about 200 of them. We collected also solutions of geometry problems from other sources, e.g., the IMO contests, see [11]. Much of this work was done by my “proof writers”, the students Malte Witte and Ben Friedrich, who compiled first electronic versions for many of these examples. 3.1
The SymbolicData Project
The SymbolicData project was set up to create and manage a publicly available repository of digital test and benchmark data from different areas of symbolic computation and to develop tools and concepts to manage such data both in the repository and at a local site. In a first stage we concentrated on the development of practical concepts for a convenient data exchange format, the collection of existing benchmark data from two main areas, polynomial system solving and geometry theorem proving, and the development of appropriate tools to process this data. A tight interplay between conceptual work, data collection, and tools (re)engineering allowed continuously to evaluate the usefulness of each of the components. For easy reuse we concentrated on free software tools and concepts. The data is stored – one record per file – as tag/value pairs in a XML like ASCII format that can be edited with your favorite text editor. The tools are completely written in Perl using modular technology. The data format definitions are part of the data base itself and stored in a similar way. It can be specified and extended by the user in an easy manner and very broad range to add new material and/or to modify existing one. I refer to [1, 9, 10] and the SymbolicData documentation for more details. The project is organized as a free software project with a CVS repository equally open to people joining the SymbolicData project group. The SymbolicData project is part of the benchmark activities of the German “Fachgruppe Computeralgebra” who also sponsored the web site [15] as a host for presentation and download of the tools and data developed and collected so far. We kindly ´ acknowledge support also from UMS MEDICIS of CNR/Ecole Polytechnique
The SymbolicData GEO Records
73
(France) who provides us with the needed hard- and software to run this web site. Tools and data are available for local installation (without any registration) under the terms of the GNU Public License as tar-files from our Web site. 3.2
The Structure of the SymbolicData Proof Scheme Records
Each SymbolicData record has some common attributes (Type, Key, CRef, . . . ) that serve for identification or store relational information. The other attributes store different parts of the proof scheme in GeoCode syntax and will be described now. See [10] for a detailed description of the overall GEO record structure. The SymbolicData GEO proof scheme records are divided (roughly) into two types according to their prooftype attribute: constructive or equational. The generic variables are provided as values of two attributes: parameters vars
a list u of independent parameters a list x of dependent variables (equational proofs only)
For equational proofs the variable lists x and u are chosen in such a way that u is a maximal independent set of variables. The basic attributes (with GeoCode values) are: Points coordinates conclusion
the free points of the proof scheme assignments that compose step by step the generic geometric configuration of the proof scheme the conclusion of the proof scheme
This already completes the data required for a constructive proof scheme. For equational proof schemes the following additional attributes are defined: polynomials
constraints solution
a list of GeoCode predicates that correspond to polynomial or rational conditions describing algebraic dependency relations in the given geometric configuration a list of GeoCode predicates that correspond to polynomial non degeneracy conditions a way to solve the algebraic problem (given in extended GeoCode syntax)
The proof idea can be sketched within the ProofIdea attribute as plain text if not yet evident from the code. A CRef link to a PROBLEMS record with a LATEX formulation (kept in a separate place since one problem can be solved by several different proof schemes) and an optional Comment section are also available. 3.3
The GeoCode Syntax
The design of the generic GeoCode language is mainly inspired by our goal to fix proof schemes in a common format that easily translates to the special
74
Hans-Gert Gr¨ abe
input formats of different provers. It strictly distinguishes between identifiers (names for points, lines, circles) and symbols (names for the generic variables) to avoid the name space overlap that is typical for symbolic computations. We use Perl like syntax (i.e., \$[a-zA-z][a-zA-z0-9]* in Perl regexp notation) for identifiers and small letter / digit combinations (i.e., [a-z][a-z0-9]* in Perl regexp notation – we don’t allow capital letters to avoid name clashes both in Reduce and Mathematica) for symbol names. At the moment we assume proof schemes to be composed by a sequence of assignments with nested function calls as right hand sides that refer to previously defined geometric objects and scalars as arguments. This may change in the future in favor of a more XML-compliant syntax since several provers (and diagram drawing tools) don’t support nested function calls. Most CAS use parentheses both to group arithmetic expressions and argument lists in function calls. Since this cannot be distinguished within a regular language we use the Mathematica convention (i.e., brackets) for function call notation2 . The naming conventions support the identification of syntactical units via regular expression matching and their modification for the needs of different target systems (with special naming conventions, to avoid clashes with protected names as D, O, E etc.). Perl tools support such syntactical translations. The names and signatures of all the GeoCode functions are stored in the SymbolicData GeoCode table and can be extracted, extended and modified in the same way as other SymbolicData records. Two such GeoCode records are reproduced in figures 2 and 3. The first one corresponds to an ’inline’ function that requires a special implementation, the second one to a ’macro’ with a generic definition in GeoCode syntax as value of the code attribute that can be used to create an implementation automatically. For a complete description of all functions see the SymbolicData GeoCode documentation. Equational GEO records usually contain also a solution tag with a description how the algebraic task can be solved. This description is fixed in an extended GeoCode syntax. Interface packages for Maple, MuPAD, Mathematica, and Reduce to map these generic commands to the special CAS command syntax are part of the SymbolicData distribution. For details see [10]. 3.4
The GeoProver Packages
To run proof schemes written in GeoCode syntax with a geometry theorem prover requires an implementation of the GeoCode syntax for the target prover. We propose an approach in two steps: First, use Perl tools to translate the generic proof scheme into a syntactic form that is more appropriate for the target system (change square bracket, fix variable and function names, etc.). This is well supported by the SymbolicData actions concept and sample implementations 2
Note that most of the arithmetic expressions were replaced by new geometric predicates eq dist and eq angle in the GEO records during preparation of version 1.3 (finished after the ADG-02 conference) to emphasize the geometric nature of the proof schemes.
The SymbolicData GEO Records
75
################################################################ # Record ’GeoCode/pp_line’ GeoCode/pp_line GeoCode pp_line pp_line[$A::Point,$B::Point]::Line line through A~and B <description> The line through <math>A and <math>B. ... # End of record ’GeoCode/pp_line’ ################################################################
Fig. 2. The GeoCode “inline” record pp line ################################################################ # Record ’GeoCode/altitude’ GeoCode/altitude GeoCode altitude altitude[$A::Point,$B::Point,$C::Point]::Line altitude from A~onto g(BC) ortho_line[$A,pp_line[$B,$C]]
<description> The altitude from <math>A onto <math>g(BC). ... # End of record ’GeoCode/altitude’ ################################################################
Fig. 3. The GeoCode “macro” record altitude
for such translators are contained in the bin/GEO directory of the SymbolicData distribution. Second, write an interface package in the language of the target prover that maps the GeoCode functions to the prover specific functions (and proving approach). The author’s GeoProver packages implement such interfaces for proofs using the coordinate method and Maple, MuPAD, Mathematica, or Reduce. Below we give some examples of the interplay between GeoCode syntax, GEO proof scheme records, and their algebraic counterparts computed with the GeoProver package for one of the target CAS. For a formal description of
76
Hans-Gert Gr¨ abe
all functions we refer to the documentation [8]. For some target systems the GeoProver package provides also an undocumented plot extension that allows to draw diagrams from geometric configurations. A first prototype of the GeoProver grew out from a course of lectures for students of computer science on this topic held by the author at the Univ. of Leipzig in fall 1996. It was updated and completed to version 1.1 of a Reduce package after a similar lecture in spring 1998. Later on in cooperation with Malte Witte, at those times one of my students, the package was translated to the other target systems. Since version 1.2 there is a separate description of the GeoCode language that was fixed in SymbolicData format and added as GeoCode table to the SymbolicData project later on. Now the complete GeoProver source code is generated from a platform-specific ’inline’ code part for the basic functions and generic GeoCode code values for advanced functions using special SymbolicData tools. This facilitates a concise code management of the GeoProver implementations for different CAS if the GeoCode standard changes during development.
4
Some Examples
To demonstrate the efforts required to compile new GeoCode proof schemes, to translate them with SymbolicData tools to GeoProver applications and to run them on different target CAS we consider some examples. 4.1
The “cathedral example”, [12, 5.3]
C
E
F
O H A
M
D
N Q
B
Fig. 4: The cathedral example
P, Q are centers of the arcs CB, AC, respectively; arcs DE, DF are drawn with R, S as centers, respectively, and |AQ| as the radius. Further, |AQ| = |BP | = 56 |AB|. The goal is to find the radius r of the circle tangent to arcs EA, ED, HM (with center A) and KM (with center D) as a function of |AB|.
We take the problem formulation and notational conventions from [12] with s = |AB| = 1. In that paper line AB is taken as x-axis with origin at M (written as $M in GeoCode syntax) and the following coordinates are assigned to points (using the GeoCode point constructor): $O:=Point[0,y3]; $A:=Point[-3/12,0]; $Q:=Point[7/12,0]; $M:=Point[0,0]; Kapur’s original proof scheme contains 6 algebraic conditions that arise from the tangency conditions of two circle pairs. A circle tangency condition yields 3 polynomials: If T1 = (x1 , y1 ) is the point of tangency of the circles around A and O
The SymbolicData GEO Records
77
these conditions are ’T1 on the circle around A’, ’T1 on the circle around O’, and ’T1 , A, O are collinear’. Here is that statement in the formal GeoCode syntax: [x1,y1,x2,y2,y3,r] $O:=Point[0,y3]; $A:=Point[-1/4,0]; $Q:=Point[7/12,0]; $M:=Point[0,0]; $T1:=Point[x1,y1]; $T2:=Point[x2,y2]; $c1:=pc_circle[$A,$M]; $c2:=pc_circle[$Q,$A]; <polynomials> $polys:=List[ on_circle[$T1,$c1], on_circle[$T2,$c2], is_collinear[$A,$T1,$O], is_collinear[$Q,$T2,$O], r^2-sqrdist[$O,$T1], r^2-sqrdist[$O,$T2]]; pc circle is the center-point circle constructor. Note that on circle[$T1,$c1] and sqrdist[$T1,$A]-sqrdist[$M,$A] yield the same algebraic translation. Hence a similar proof scheme may be composed without references to circle objects3 . To solve the algebraic problem eliminate all variables but r from $polys and solve the remaining equation for r. This can be stored as the value of the solution attribute of the GEO record in extended GeoCode syntax in the following way: <solution> $result:=geo_solve[ geo_eliminate[$polys,$vars,List[x1,y1,x2,y2,y3]],r]; Less variables are required if T1 and T2 are taken as ’circle sliders’ that algebraically translate to rational parameterizations of such points: [x1,x2,y3,r] $O:=Point[0,y3]; $A:=Point[-1/4,0]; $Q:=Point[7/12,0]; $M:=Point[0,0]; $T1:=circle_slider[$A,$M,x1]; $T2:=circle_slider[$Q,$A,x2]; 3
With GeoCode version 1.3 better use the (geometric) predicate eq dist instead of the (algebraic) sqrdist difference. The former can be interpreted also, e.g., by a diagram drawing tool.
78
Hans-Gert Gr¨ abe
<polynomials> $polys:=List[ is_collinear[$A,$T1,$O], r^2-sqrdist[$O,$T1], is_collinear[$Q,$T2,$O], r^2-sqrdist[$O,$T2]]; Note that in this case the algebraic translations of the geometric conditions yields in fact rational functions since the coordinates of T1 and T2 are not polynomial but rational. A special algebraic approach is required for such proof schemes4 . A brute force call to solve($polys,$vars) with MuPAD produces 24 solutions with 12 different values of r. A third approach uses the explicit circle tangency condition, that corresponds to a polynomial condition on the circle parameters. It requires only 3 variables and translates to a polynomial system. Take center O and a circumfere point X on the y-axis with generic y-coordinates $O:=Point[0,x1]; $X:=Point[0,x2]; $A:=Point[-1/4,0]; $Q:=Point[7/12,0]; $M:=Point[0,0]; add variables for the arcs (circles) that should be tangent $c1:=pc_circle[$A,$M]; $c2:=pc_circle[$Q,$A]; $c3:=pc_circle[$O,$X]; and fix the tangency conditions and another one for the radius r = x1 − x2 of the circle c3 $polys:=List[ is_cc_tangent[$c1,$c3], is_cc_tangent[$c2,$c3], r-(x1-x2)]; The problem is of equational type and poses a deduction task. There are no independent variables and an algebraic solution can be obtained if x1 , x2 are eliminated from the polynomials and the remaining equation is solved for r. The corresponding GEO record is given in figure 5. To translate and run that code with the GeoProver MuPAD version first call the SymbolicData MuPADCode action on the record Cathedral 1.sd symbolicdata MuPADCode Cathedral_1.sd It maps the proof scheme to MuPAD syntax, resolves name clashes and yields (GeoProver package loading omitted) //==> Example Cathedral_1 clear_ndg(): delete ’x1’,’x2’,’r’; _vars:=geoList(x1,x2,r); // coordinates _O:=Point(0,x1); _X:=Point(0,x2); 4
Rational expressions can be avoided using homogeneous point coordinates.
The SymbolicData GEO Records
79
###################################################################### GEO Cathedral_1 <prooftype> equational, deduction [x1,x2,r] $O:=Point[0,x1]; $X:=Point[0,x2]; $A:=Point[-1/4,0]; $Q:=Point[7/12,0]; $M:=Point[0,0]; $c1:=pc_circle[$A,$M]; $c2:=pc_circle[$Q,$A]; $c3:=pc_circle[$O,$X]; <polynomials> $polys:=List[is_cc_tangent[$c1,$c3],is_cc_tangent[$c2,$c3],r-(x1-x2)]; <solution> $result:=geo_solve[geo_eliminate[$polys,$vars,List[x1,x2]],r]; ######################################################################
Fig. 5. A proof scheme for the cathedral example [12, 5.3] as GEO record
_A:=Point(-3/12,0); _Q:=Point(7/12,0); _M:=Point(0,0); _c1:=pc_circle(_A,_M); _c2:=pc_circle(_Q,_A); _c3:=pc_circle(_O,_X); // polynomials _polys:=geoList(is_cc_tangent(_c1,_c3), is_cc_tangent(_c2,_c3), r-(x1-x2)); // solution _result:=geo_solve(geo_eliminate(_polys,_vars,geoList(x1,x2)),r); quit; Now we can run that script with MuPAD to get the solutions 17 17 17 17 r=− , r=− , r= , r= , 56 104 56 104 17 corresponds to the position of X on the ’top’ similar to [12]. Note that r = − 104 of O since r = x1 − x2 . Kapur missed the solutions r = ± 17 56 . They correspond to imaginary coordinates of O and hence are virtual.
A similar computation yields the length of the radius of the circle in the top region of figure 4: With origin at D, the center O1 and a circumfere point X of that circle on the y-axis we get the proof scheme
[x1,x2,r]
80
Hans-Gert Gr¨ abe
$D:=Point[0,0]; $O1:=Point[0,x1]; $X:=Point[0,x2]; $S:=Point[5/6,0]; $P:=Point[-1/3,0]; $B:=Point[1/2,0]; $c1:=pc_circle[$S,$D]; $c2:=pc_circle[$P,$B]; $c3:=pc_circle[$O1,$X]; <polynomials> $polys:=List[is_cc_tangent[$c1,$c3], is_cc_tangent[$c2,$c3], r-(x1-x2)]; Running the corresponding computation with MuPAD yields the result 7 7 , r= . r=− 40 40 4.2
The Generalized Steiner Theorem, [19, Ex. 7] Take three points A2 , B2 , C2 respectively on the three perpendicular bisectors of BC, AC, AB of any triangle ABC such that d(A2 , BC) = t · |BC|, d(B2 , AC) = t · |AC|, d(C2 , AB) = t · |AB|, where d(P, QR) denotes the distance of the point P from the line QR and t is an arbitrary non-negative number. Then the three lines AA2 , BB2 , CC2 are concurrent.
C B2
A2
A B C2
Fig. 6: The Generalized Steiner Theorem
Note that the statement of a problem may be included in a SymbolicData record as value of a new attribute, say Text, since each such record admits “undefined” attributes that are handled by the SymbolicData tools in the same way as “defined” ones. In the SymbolicData data base problem statements are stored in a special table PROBLEMS and cross referenced in GEO records since several proof schemes may refer to the same problem. In the same way bibliographical information can be related to GEO records.
D.Wang solved that problem in [19] with oriented areas using a Clifford algebra approach that avoids the introduction of virtual solutions. A straightforward coordinatization with independent variables u1 , u2 , t and dependent variables x1 , x2 , x3 goes as follows:
The SymbolicData GEO Records
81
[x1,x2,x3] <parameters> [u1, u2, t] $A:=Point[0,0]; $B:=Point[0,1]; $C:=Point[u1,u2]; $A1:=midpoint[$B,$C]; $B1:=midpoint[$A,$C]; $C1:=midpoint[$A,$B]; $A2:=line_slider[p_bisector[$B,$C],x1]; $B2:=line_slider[p_bisector[$A,$C],x2]; $C2:=line_slider[p_bisector[$A,$B],x3]; <polynomials> $polys:=List[sqrdist[$A1,$A2]-t^2*sqrdist[$B,$C], sqrdist[$B1,$B2]-t^2*sqrdist[$A,$C], sqrdist[$C1,$C2]-t^2*sqrdist[$A,$B]]; $con:=is_concurrent[ pp_line[$A,$A2], pp_line[$B,$B2], pp_line[$C,$C2]]; It yields a polynomial system with 8 solutions in (x1 , x2 , x3 ) in the rational function field k(u1 , u2 , t) that correspond to the different combinations of orientations of the triangles ABC2 , BCA2 , CAB2 . I checked this with Maple 8, Mathematica 4.1, MuPAD 2.5, and Reduce 3.7 and the solution <solution> $sol:=geo_solve[$polys,$vars]; $result:=geo_simplify[geo_eval[$con,$sol]]; geo solve, geo simplify and geo eval are interfaces to the different syntax of the solve, simplify and subs commands of the target CAS. All four CAS found that for exactly two of the 8 solutions the theorem is valid (i.e., the $result simplifies to zero). Note that with t2 replaced by t only Mathematica and Reduce found the same answer. Maple and MuPAD created expressions with several root symbols that could not be completely simplified in the following computation. Maple detected even reducible RootOf’s with the evala in its answer.
82
Hans-Gert Gr¨ abe
M34 A3
A4
M23
M14 A2
A1
M12
Fig. 7. The Miquel Circle on four con-cyclic points 4.3
Miquel’s Axiom, [13, Ex. 5] and [4, Ex. 7.6] If four circles are arranged in a cyclic sequence, each two successive circles intersect at a pair of points, and a circle passes through one point in each pair, then the other four intersection points are also concyclic.
Both [13] and [4] quote the problem as hard for the coordinate approach and propose a more geometric solution within their geometric framework. The problem has even a constructive solution: Take four points A1 , . . . , A4 on a circle around the origin O, centers M12 , . . . , M41 for circles passing through (A1 , A2 ), . . . , (A4 , A1 ) and compute for each consecutive pair of such circles the second intersection point (it has rational coordinates in the parameters u1 , u2 , u3 , v1 , . . . , v4 ). Here is the GeoCode formulation: <prooftype> constructive <parameters> [u1, u2, u3, v1, v2, v3, v4] $O:=Point[0,0]; $A1:=Point[1,0]; $A2:=circle_slider[$O,$A1,u1]; $A3:=circle_slider[$O,$A1,u2]; $A4:=circle_slider[$O,$A1,u3]; $M12:=line_slider[p_bisector[$A1,$A2],v1]; $M23:=line_slider[p_bisector[$A2,$A3],v2]; $M34:=line_slider[p_bisector[$A3,$A4],v3]; $M41:=line_slider[p_bisector[$A4,$A1],v4]; $c12:=pc_circle[$M12,$A1]; $c23:=pc_circle[$M23,$A2]; $c34:=pc_circle[$M34,$A3]; $c41:=pc_circle[$M41,$A4]; $B1:=other_cc_point[$A1,$c12,$c41];
The SymbolicData GEO Records
83
$B2:=other_cc_point[$A2,$c12,$c23]; $B3:=other_cc_point[$A3,$c23,$c34]; $B4:=other_cc_point[$A4,$c34,$c41]; $result:=is_concyclic[$B1, $B2, $B3, $B4]; The simplification of the resulting rational expression in seven parameters indeed turned out to be very hard and only Maple 8 (about 4 sec.) and Mathematica 4.1 (about 250 sec.) mastered the task5 . The situation completely changes if v1 , . . . , v4 are assigned random integers (not too big, < 100). Several runs with different settings always yield 0 also with MuPAD or Reduce. An even harder challenge is the Miquel-5 example [4, Ex. 7.6] that starts with five points forming a pentagon. There is a straightforward constructive proof scheme but only Maple 8 (about 40 sec.) could simplify the resulting rational expression in reasonable time.
5
Implementing the GeoCode Standard
For real usability of the GeoCode concept one has to estimate the efforts required to implement this standard for a given prover. Even though there is not yet practical experience with already existing geometry theorem provers the semantic similarity of “foreign” special geometric proof schemes suggests that such an interface could easily be implemented. We suggest to divide that implementation in two parts as described above: The first part provides (e.g., Perl based) tools to translate GEO proof schemes into a prover specific form that fixes requirements of naming and syntax conventions. In a second part these translated proof schemes are passed to a special interface that maps the GeoCode to the prover’s functionality. In general, for the second part one has to implement the GeoCode functionality in the target prover language. This requires extensibility of that language and access to the source code or interaction with the system developers if such an interface cannot be added as a supplementary package. Let’s consider the proof scheme language described in [3] as target and estimate the efforts required to construct such a supplementary interface package to the GeoCode language on top of it. First, note that the GeoCode syntax provides not only points but also line and circle objects as geometric primitives. It is a special design decision of [3] (and other geometry theorem provers, e.g., D. Wang’s GEOTHER [16]) not to introduce the latter objects as basic but to take only point objects as primitives. The interface package implements lines and circles as pairs of points6 with 5 6
On a 800 MHz Pentium PC with 256 MB RAM under Linux. To support such an approach and also to make the GeoCode language more “geometric” we removed direct constructors for lines and circles from their homogeneous
84
Hans-Gert Gr¨ abe
selection operators l.1 and l.2 for the defining points of the line l and c.1 (center) and c.2 (peripheral point) for the circle c7 . Now GeoCode functions can be implemented as easy as, e.g., eq dist[A,B,C,D] is collinear[A,B,C] is orthogonal[a,b] is parallel[a,b] ortho line[P,a] par line[P,a] pp line[A,B]
== == == == == == ==
(CONG A B C D) (COLL A B C) (PERP a.1 a.2 b.1 b.2) (PARA a.1 a.2 b.1 b.2) (TLINE P a.1 a.2) (PLINE P a.1 a.2) (LINE A B)
A more serious problem arises with geometry theorem provers that do not support nested function calls. This is typical for systems that contain a diagram drawing tool, since all intermediate construction steps leave their trace in a picture. Usually such systems represent and address geometric objects through explicit identifiers. Unfortunately, this partly applies also to the language in [3]: New points must be given a name as, e.g., in the constructor (INTER M a b) for the intersection point M of the lines a and b. There are two solutions: First, extend the target language to support anonymous points and write, e.g., circle slider[M,A,u] intersection point[a,b] line slider[a,u] other cl point[P,c,l]
== == == ==
{(ON Y (CIR M A)); RETURN Y;} {(INTER M a b); RETURN M;} {(ON Y a); RETURN Y;} {(INTER M l (CIR c.1 c.2)); RETURN M;}
or, second, denest nested function calls using an appropriate Perl script. It is a matter of further discussion if for wide applicability of generic proof schemes they should already be denested. There is a tight interplay between geometry theorem proving and diagram drawing. Both require formal descriptions of geometric configurations and use algebraic methods to compute representations of geometric objects. Drawing facilities are part of integrated geometry theorem provers as, e.g., D. Wang’s GEOTHER prover [16, 18] or the Geometry Expert, [6]. Hence it is desirable to fix proof schemes in such a way that they can be used also as input for diagram drawing tools. We started first experiments to generate GEONEX T drawings (see [7] for more information about that DGS) from constructive GEO proof schemes with an appropriate (SymbolicData and Perl based) interface. Experiments with different kinds of tools that support implementations entailed changes of the GeoCode standard in the past and will entail new requirements and changes also in the future. So far the power of the Perl string manipulation facilities and the SymbolicData actions concept were well suited to support such changes, to scan the GEO records for obsolete proof scheme commands and to fix them accordingly.
7
coordinates, i.e., the constructors Line[a1 , a2 , a3 ] and Circle[a0 , a1 , a2 , a3 ], from the GeoCode standard since version 1.2. This is coherent with the definition of the constructors l =(LINE l.1 l.2) and c =(CIR c.0 c.1) in [3].
The SymbolicData GEO Records
85
References [1] O. Bachmann and H.-G. Gr¨ abe. The SymbolicData Project: Towards an electronic repository of tools and data for benchmarks of computer algebra software. Reports on Computer Algebra 27, Jan 2000. Centre for Computer Algebra, University of Kaiserslautern. See http://www.mathematik.uni-kl.de/~zca. 72 [2] S.-C. Chou. Mechanical Geometry Theorem Proving. Reidel, Dortrecht, 1988. 67, 68, 72 [3] S.-C. Chou, X.-S. Gao, and J.-Z. Zhang. Machine proofs in geometry, volume 6 of Series on Applied Mathematics. World Scientific Singapore, 1994. 67, 83, 84 [4] X.-S. Gao and D. Wang, editors. Mathematics Mechanization and Applications. Academic Press, 2000. 67, 71, 82, 83 [5] X.-S. Gao, D. Wang, and L. Yang, editors. Automated Deduction in Geometry, Beijing 1998, volume 1669 of Lect. Notes Comp. Sci. Springer, Berlin, 1999. 67, 85 [6] X.-S. et al. Gao. Geometry Expert – a software for dynamic diagram drawing and automated geometry theorem proving and discovering, 2002. See http://www.mmrc.iss.ac.cn/~xgao/gex.html. 84 ur Math[7] GEONEX T – a dynamical geometry software, 1998 – 2003. Lehrstuhl f¨ ematik und ihre Didaktik, Univ. Bayreuth. See http://www.geonext.de. 84 [8] H.-G. Gr¨ abe. GeoProver - a small package for mechanized plane geometry, 1998 – 2003. With versions for Reduce, Maple, MuPAD and Mathematica. See http://www.informatik.uni-leipzig.de/~compalg/software. 68, 76 [9] H.-G. Gr¨ abe. The SymbolicData benchmark problems collection of polynomial systems. In Proceedings of the Workshop on Under- and Overdetermined Systems of Algebraic or Differential Equations, Karlsruhe 2002, pages 57 – 75, 2002. Publ. by IAS Karlsruhe. See also http://www.informatik.uni-leipzig.de/~graebe/publications. 72 [10] H.-G. Gr¨ abe. The SymbolicData geometry collection and the GeoProver packages. In Proceedings of the 8th Rhine Workshop on Computer Algebra (RWCA-02), Mannheim 2002, pages 173 – 194, 2002. Publ. by Univ. Mannheim. See also http://www.informatik.uni-leipzig.de/~graebe/publications. 72, 73, 74 [11] The International Mathematical Olympiads, since 1959. See, e.g., http://www.kalva.demon.co.uk/imo.html. 72 [12] D. Kapur. Automated geometric reasoning: Dixon resultants, Gr¨ obner bases, and characteristic sets. In Wang [17], pages 1 – 36. 71, 76, 79 [13] C.-Z. Li and J.-Z. Zhang. Readable machine solving in geometry and ICAI software MSG. In Gao et al. [5], pages 67 – 85. 82 [14] J. Richter-Gebert and D. Wang, editors. Automated Deduction in Geometry – ADG 2000 revised papers, volume 2061 of Lect. Notes Comp. Sci. Springer, Berlin, 2001. 67 [15] The SymbolicData Project, 2000–2002. See http://www.symbolicdata.org or the mirror at http://symbolicdata.uni-leipzig.de. 67, 68, 72 [16] D. Wang. GEOTHER – geometry theorem prover, 1990 – 2003. See http://calfor.lip6.fr/~wang/GEOTHER. 83, 84 [17] D. Wang, editor. Automated Deduction in Geometry, Toulouse 1996, volume 1360 of Lect. Notes Comp. Sci. Springer, Berlin, 1996. 67, 85, 86 [18] D. Wang. GEOTHER: A geometry theorem prover. In M. A. McRobbie and J. K. Slaney, editors, Automated deduction – CADE-13, volume 1104 of LNCS, pages 166 – 170, 1996. 84
86
Hans-Gert Gr¨ abe
[19] D. Wang. Clifford algebraic calculus for geometric reasoning with applications to computer vision. In Wang [17], pages 115 – 140. 80 [20] D. Wang. Elimination Methods. Texts and Monographs in Symbolic Computation. Springer, Wien, 2001. 71 [21] W.-T. Wu. Mechanical Theorem Proving in Geometries. Texts and Monographs in Symbolic Computation. Springer, Wien, 1994. 67 [22] W.-T. Wu. Mathematics Mechanization, volume 489 of Mathematics and its Applications. Science Press, Beijing, and Kluwer Acad. Publ., Dordrecht, 2000. 67
A New Structural Rigidity for Geometric Constraint Systems Christophe Jermann1 , Bertrand Neveu2 , and Gilles Trombettoni2 1
2
AI Lab, EPFL, 1015 Lausanne, Switzerland [email protected] COPRIN Team, INRIA-I3S-CERMICS, 2004 route des lucioles, BP 93, 06902 Sophia.Antipolis, France {Bertrand.Neveu, Gilles.Trombettoni}@sophia.inria.fr
Abstract. The structural rigidity property, a generalisation of Laman’s theorem which characterises generically rigid bar frameworks in 2D, is generally considered a good heuristic to detect rigidities in geometric constraint satisfaction problems (GCSPs). In fact, the gap between rigidity and structural rigidity is significant and essentially resides in the fact that structural rigidity does not take geometric properties into account. In this article, we propose a thorough analysis of this gap. This results in a new characterisation of rigidity, the extended structural rigidity, based on a new geometric concept: the degree of rigidity (DOR). We present an algorithm for computing the DOR of a GCSP, and we prove some properties linked to this geometric concept. We also show that the extended structural rigidity is strictly superior to the structural rigidity and can thus be used advantageously in the algorithms designed to tackle the major issues related to rigidity.
1
Introduction
Geometric constraint satisfaction problems arise naturally in several areas, such as architecture, design of mechanisms and molecular biology. The rigidity concept plays an important for in many of these areas, for instance when one needs to decide whether a geometric constraint satisfaction problem (GCSP) is rigid or not, to detect over-rigid subparts which represent explanations for the absence of solutions, or to decompose a GCSP into several subGCSPs for the purpose of efficient solving. Several solving methods [Kra92, BFH+ 95, LM96, DMS97, HLS00, JTNR00] for GCSPs have to handle rigidity related problems. In particular, recursive rigidification techniques decompose a GCSP into a sequence of rigid subGCSPs to be solved separately and then assembled. The techniques used so far for rigidity detection can be classified in two categories: pattern-based approaches [FH93, BFH+ 95, Kra92] depend on a repertoire of rigid bodies of known shape which cannot cover all practical instances. Flowbased approaches [HLS97, LM96] use flow (or maximum matching) machinery to
F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 87–106, 2004. c Springer-Verlag Berlin Heidelberg 2004
88
Christophe Jermann et al.
identify subGCSPs verifying a structural property: the structural rigidity. This property is based on a degree of freedom count. The latter approaches are more general eventhough structural rigidity is only an approximation of rigidity. Heuristics have been proposed to enhance structural rigidity capabilities, none of which succeeded to fully cover the gap between structural rigidity and rigidity. In this paper, we present a thorough analysis of this gap (Section 2). This analysis takes into account the different definitions and characterisations of rigidity that have been proposed in different communities: theory of mechanisms, structural topology and CAD. It allows us to identify precisely the causes of failure of the structural rigidity. In section 3, we define a new geometric concept: the degree of rigidity (DOR) of a GCSP. We establish some interesting properties and propose an algorithm to compute the DOR of a GCSP. This new concept allows us to define a new characterisation of rigidity: the extended structural rigidity (Section 4). We show that this new characterisation is strictly superior to the structural rigidity, even the heuristically enhanced one, but remains an approximation of rigidity. We show that this new characterisation, while remaining an approximation of rigidity, is strictly superior to the structural rigidity, even the heuristically enhanced one. Finally, we briefly explain in section 5 how this new characterisation can be introduced in the algorithms designed by Hoffmann et al. [HLS97] to tackle with more reliability the major issues related to rigidity: deciding whether a GCSP is rigid or not, and identifying rigid and over-rigid sub-GCSPs.
2
Rigidity and Structural Rigidity
This section provides the necessary background definitions. We recall definitions of rigidity from the theory of mechanisms, the structural topology and the CAD communities. Then, we introduce the structural rigidity, a famous characterisation of rigidity based on an analysis of the degrees of freedom in a GCSP. We clarify the type of rigidity characterised by structural rigidity, and explain its limits. 2.1
Geometric Constraint Satisfaction Problems
Let us first define a GCSP (two examples are provided in figure 1). Definition 1 Geometric Constraint Satisfaction Problems (GCSP) A GCSP S is defined by a pair (O, C) (we note S = (O, C)) where: – O is a set of geometric objects, – C is a set of geometric constraints binding objects in O. S = (O , C ) is a subGCSP of S = (O, C) (noted S ⊂ S) iff O ⊂ O and C = {c ∈ C|c binds only objects in O } (i.e. S is induced by O ).
A New Structural Rigidity for Geometric Constraint Systems
89
b)
a)
F
E D
A
B
C
A
B
C
Fig. 1. a) A GCSP in 2D composed of 3 parallel lines lying at prescribed distance. b) A GCSP in 3D composed of one line (A) and 5 points (B, C, D, E and F); the constraints are 4 point-line incidences (B, C, D and E on A) and 5 point-point distances (CD, CF, DE, DF and EF)
Restrictions: We assume that geometric objects are indeformable (e.g., no circle with variable radius). Also geometric constraints must involve only positions and orientations of the objects and they must be independent from the global reference system (i.e., constraints only fix objects relatively one to another). These limitations make the structural characterisations of rigidity easier and are mandatory for geometric solving methods based on rigidity. Solution of a GCSP: According to these restrictions, a solution to a GCSP S = (O, C) is composed of one position and one orientation for each object in O that satisfy all the constraints in C. For the solving purpose, a GCSP is translated into a system of equations: each object is represented by a set of unknowns (over the reals) which determine its position and orientation; each constraint becomes one or several equations on the unknowns of the objects it constrains. 2.2
Rigidity
The concept of rigidity has been studied in several scientific fields: theory of mechanisms, structural topology and CAD are the three main scientific communities which have studied this concept. Theory of Mechanisms Theory of mechanisms [Ang82] is interested in the study of movements in mechanisms. Mechanisms are a specific subclass of GCSPs, composed of mechanical pieces linked by mechanical articulations. The mechanical pieces can be of various types, while the articulations belong to a reduced set of well-defined types of mechanical joints. The degree of mobility of a mechanism represents the number of independent movements it admits: if it is 0, the mechanism is isostatic (or rigid); if it is less than 0, the mechanism is hyperstatic (or over-rigid); otherwise, the mechanism is under-rigid. The degree of mobility can be computed in two ways:
90
Christophe Jermann et al.
1. A specific analysis (static, geometric, dynamic or cinematic) of a given configuration of the mechanism. A configuration of a mechanism is composed of one position, one orientation and one set of dimensions for each mechanical piece in the mechanism. 2. The computation of the Gruebler formula [Gr17]. The first approach provides only a local information about the rigidity of the mechanism since the computed degree of mobility depends on the configuration of the mechanism to be analysed. The second approach is more general, but can be mistaken in case the mechanism contains redundant articulations or singularities. Structural Topology Structural topology [Whi87, Gra02] is interested in the study of bar frameworks, a subclass of GCSPs composed of points linked by distance constraints. The rigidity of a bar framework is related to the kind of movements it admits; we distinguish two kind of movements: displacements, which corresponds to rigid-body movements (translations and rotations), and deformations (or flexes), which do not preserve the relative positions of the points in the bar framework. Structural topology also proposes two approaches to study the rigidity of a bar framework: 1. A specific study of one configuration in the bar framework; a configuration of a bar framework is composed of one position for each point in the bar framework and the corresponding set of distance values for its bars. 2. A generic study that defines the rigidity of all the generic configurations of the bar framework; a configuration of a bar framework is generic if there is no algebraic dependency between the coordinates of the points. The specific study is based on algebraic computations, rendered possible by the fact that bar frameworks embed only points and distances, i.e. objects and constraints of well-known form and properties. The generic rigidity is related to algebraic independence and based on a count of the degrees of freedom in the bar framework. Its main characterisation was proposed by Laman: Theorem 1 [Lam70] A bar framework in 2D is generically rigid if it has exactly 3 DOFs and all its sub-systems (see Definition 1) have at least 3 DOFs. Unfortunately, no similar characterisation was found for 3D bar frameworks: all the trials to extend known 2D characterisations have failed. Moreover, generic rigidity corresponds to rigidity only for non-redundant and non-singular barframeworks. Thus, structural topology proposes the same choice as the theory of mechanisms: either a specific study of a given configuration, or a general but sometimes erroneous evaluation of the rigidity of all the configurations of a GCSP.
A New Structural Rigidity for Geometric Constraint Systems
91
Computer-Aided Design CAD is a more recent community and is interested in almost every kind of GCSPs. To our knowledge, no general framework for the study of the rigidity of any GCSP was ever proposed. We propose here the extension of the framework defined in structural topology. Rigidity is related to the kind of movements admitted by a GCSP. As already said, we distinguish two kinds of movements: the displacements and the deformations. Below is a formal definition of movements borrowed from the structural topology community: Definition 2 Movements of a GCSP A movement M of a GCSP is a set of continuous and differentiable functions mi : [0, 1] → R, one function for each parameter of each object in the GCSP. An evaluation for a given t ∈ [0, 1] is a configuration M (t) of the GCSP that must satisfy all its constraints. A movement M is a displacement if for any t ∈ [0, 1], there exists a rotation R and a translation T such that M (t) = T (R(M (0))). Otherwise, M is a deformation. Then, we propose a formal and simple definition for the rigidity of a solution of a GCSP: Definition 3 Rigidity of the solution of a GCSP A solution C of a GCSP S is rigid iff every movement M such that M (0) = C is a displacement. Remark: We talk about solution of a GCSP instead of configuration. Indeed, a configuration, in the sense given in the theory of mechanisms and structural topology, generally comprises values for the parameters of the constraints. In the GCSPs we consider, the parameters of the constraints are fixed and only the parameters of the objects are unknown. A set of values for these parameters was called a solution of a GCSP in the beginning of section 2. Like in theory of mechanisms and structural topology, this definition allows for a specific study of a given solution of a GCSP. However, another form of rigidity is of greater interest for the CAD community: the a priori rigidity of all the solutions of a GCSP. Indeed, this information is used by a lot of geometric decomposition methods which aim at aggregating rigid subparts of a GCSP to produce the solutions of the complete GCSP [Kra92, HLS00, JTNR00]. In the rest of this paper, we will use the following terminology: – A GCSP is over-rigid if all its solutions are over-rigid; – it is rigid if all its solutions are rigid; – it is under-rigid if all its solutions are over-rigid. In the example of figure 1-b, the subGCSP CDF is rigid since a triangle is indeformable and can be displaced anywhere in the Euclidean 3D space. The subGCSP AF is under-rigid: the point F moves independently from the line A
92
Christophe Jermann et al.
D
D
E
E
C B A
C A
B
Fig. 2. Example of a GCSP with rigid and non-rigid solutions
since they are not constrained. The subGCSP ACDEF is over-rigid since, in the generic case, it has no solution; a possible explanation is that three spheres with prescribed radii and centres (C, D and E) aligned onto a single line (A) generically (i.e. if the radii are algebraically independent) do not have a common intersection (F ). This definition of rigidity is similar to the generic rigidity in structural topology, or the Gruebler formula in the theory of mechanisms. This is the type of rigidity at which are aimed all the structural characterisations used in CAD. Whenever there is a risk of confusion, we will explicitly call global rigidity the rigidity of all the solutions of a GCSP. 2.3
Limits of the Global Rigidity
The global rigidity does not allow to classify every GCSP. Indeed, there exists GCSPs which have solutions with different rigidity. We say that these GCSPs are non-globally characterisable. Consider the GCSP in Figure 2. It is composed of one line E and 4 points A, B, C and D. The constraints between these objects are: Incidence(A, E), Incidence(B, E), Incidence(C, E), Distance(A, B), Distance(A, D), Equidistance(A, B, B, C), Equidistance(A, D, D, C). According to the constraints of the GCSP, points A and C can either be coincident (Figure 2-a), or non-coincident (Figure 2-b). In case points A and C are coincident, point D can rotate independently of the other objects, introducing an under-rigidity in some solutions of the GCSP. In case A and C are noncoincident, point D is determined uniquely, i.e. some solutions of the GCSP are rigid. This example illustrates the limits of any a priori characterisation of rigidity: they cannot characterise non-globally characterisable GCSPs. To avoid this case, a common assumption is that GCSPs must be generic, i.e. contain no singular placements of their objects. This assumption is not reasonable: constraints like incidence and parallelism would be forbidden (because
A New Structural Rigidity for Geometric Constraint Systems
93
points are not generically incident to lines, lines are not generically parallel, ...), but these constraints are mandatory for designing many GCPSs in CAD. We propose less restrictive restrictions: Hypothesis 1 Every GCSP is globally characterisable, i.e. all its solutions have the same rigidity. Hypothesis 2 The valued constraints (distance, angle, ratio of distances, ...) are generic, i.e. only non-valued constraints (incidence, parallelism, equidistance, ...) introduce singularities in GCSPs. The first hypothesis is quite restrictive: it eliminates non-globally characterisable GCSPs like the one in Figure 2. On the contrary, the second assumption is not restrictive at all: singular valued constraints can always be formulated as non-valued constraints. For instance, a distance equal to zero can be replaced by an incidence constraint, an angle equal to zero by a parallelism one, etc.. Hence, this assumption only requires that given geometric properties, like incidences and parallelism, are stated using a specific constraint and not a singular valued constraint. We assume that these hypotheses hold in the following sections and discuss the impact of removing them in section 6. 2.4
Characterisation of Global Rigidity
The characterisation principle is based on the following intuition: – a GCSP which has less movements than displacements is over-rigid; moreover, a GCSP with an over-rigid subGCSP cannot be displaced also, and is then over-rigid itself; – a non-over-rigid GCSP which has as many movements as displacements do not admit any deformation, and is then rigid; – a non-over-rigid GCSP which has more movements than displacements admit deformations and is then under-rigid. We note M (S) (resp. D(S)) the number of movements (resp. displacements) of a GCSP S, i.e. the number of movements (resp. displacements) admitted by every solution of the GCSP. The principle of global rigidity characterisation can be formulated as follows: – S is over-rigid iff ∃S ⊆ S such that M (S ) < D(S ); – S is rigid iff M (S) = D(S) and S is not over-rigid; – S is under-rigid iff M (S) > D(S) and S is not over-rigid. In the following section, we present the most famous a priori characterisation of rigidity: the structural rigidity.
94
Christophe Jermann et al.
2.5
Structural Rigidity
The structural rigidity is probably the most well-known and used characterisation of rigidity. It consists in computing approximations of the numbers of movements and displacements. Approximation of the Number of Movements To approximate the number of movements admitted by a GCSP, structural rigidity relies on a count of the degrees of freedom (DOF) in the GCSP. Intuitively, one DOF represents one independent movement in a GCSP. More formally: Definition 4 Degree of freedom (DOF) - Object o: DOF(o) is the number of independent parameters that must be set to determine the position and orientation of o. - Constraint c: DOF(c) is the number of parameters the constraint allows to determine1 . - GCSP S: DOF(S) = o∈O DOF(o) − c∈C DOF(c). For instance, 2D lines have 2 DOFs, 3D points have 3 DOFs and 3D lines have 4 DOFs. A 2D line-line parallelism or distance removes 1 DOF, a 3D pointline incidence removes 2 DOFs and a point-point distance removes 1 DOF in any dimension. Hence, subGCSPs CDF , AF and ACDEF in Figure 1-b have respectively 6, 7 and 5 DOFs. Approximation of the Number of Displacements Structural rigidity proposes to approximate the number of movements admitted by a GCSP by the number of independent displacements allowed in a geometric d-space: Property 1 A geometric space in dimension d allows exactly d(d+1) indepen2 dent displacements: d independent translations and d(d−1) independent rotations. 2 Definition of Structural Rigidity (s rigidity) Following the standard characterisation scheme for rigidity proposed in section 2.4, structural rigidity can be defined as follows: Definition 5 Structural Rigidity (s rigidity) ; - A GCSP S = (O, C) is over-s rigid iff ∃S ⊆ S, DOF(S ) ¡ d(d+1) 2 d(d+1) - it is s rigid iff DOF(S) = and S is not over-s rigid; 2 - it is under-s rigid iff DOF(S) ¿ d(d+1) and S is not over-s rigid. 2 1
In practice, we count the number of independent equations in the subsystem of equations representing the constraint. This approximation, which comes from the traditional assumption that one equation fixes one unknown over the reals, is not always correct: x2 + y 2 = 0 is a single equation fixing two unknowns at a time. However, under Hypothesis 2, this singular case cannot occur.
A New Structural Rigidity for Geometric Constraint Systems
95
Obviously, structural rigidity is equivalent to Laman’s theorem (Theorem 1) for 2D bar frameworks. In the general case, s rigidity is considered a good approximation of rigidity [Hen92, LM96, HLS97]. We show in the following section that it is not a so reliable characterisation. Causes of Failure The count of degrees of freedom is a first possible cause of failure of the characterisation by s rigidity. Indeed, as for Laman’s theorem or Gruebler’s formula, this count can be mistaken by the presence of redundancies or singularities2 . For example, the subGCSP ACDEF in Figure 1-b is generically over-rigid as we explained previously. However, assume that the distance between E and F is set in such a way that this GCSP has a solution (for instance the one displayed in the picture). Then, this subGCSP would be rigid, but would contain at the same time a singularity (one distance value is set such that the GCSP has a solution, i.e. this distance depends on the other objects/constraints of the GCSP) and a redundancy (one constraint can be removed, e.g. Distance(E, F )). And in this case, this subGCSP would have only 5 (= 4+3+3+3+3−2−2−2−1−1−1−1−1) = 6 in dimension d = 3. Thus, it would be DOFs instead of the required d(d+1) 2 detected over-s rigid because of the redundancy and singularity it contains. Detecting redundancies and singularities is a difficult problem: it is generally equivalent to deciding whether or not there are algebraic dependencies in an equation system, and how many unknowns can be fixed by each subset of equations. The second source of error comes from the fact that s rigidity considers that every subGCSP should admit all the displacements allowed in a geometric space. This assumption is valid only if the subGCSP fills every dimension of the geometric space. For instance, the segment CD in Figure 1-b is a rigid subGCSP in 3D: the points cannot be moved separately, but can be rotated and translated altogether. However, this subGCSP has only 5 (= 3 + 3 − 1) DOFs, which is less than the = 6 in dimension d = 3. Hence, it is detected over-s rigid. This prescribed d(d+1) 2 is because the rotation around the axis defined by the segment has no effect on it, which removes one independent rotation from its possible displacements. This counter-example illustrates a very strong limit of structural rigidity since, according to Definition 5, this implies that any GCSP containing a distance constraint between two points in 3D will be considered over-s rigid. Heuristically Enhanced Structural Rigidity To try to overcome these problems, a common heuristic [Sit00] recommends to consider only non-trivial subGCSPs, i.e. subGCSPs composed of at least d + 1 objects in dimension d. This heuristic, while interesting for GCSPs composed of points only, does not fix the problem3 . 2 3
Under Hypothesis 2, only redundancies can mistake the DOF count. In fact, this heuristic even causes new problems. For instance, the subGCSP ABCD in Figure 1-b is non-trivial and is clearly under-rigid: point B can move independently
96
Christophe Jermann et al.
For instance, the subGCSP ACDE in Figure 1-b. is non-trivial (it is composed of 4 objects in 3D) and is rigid (the three points can only be translated altogether along the line, and the line can be displaced anywhere). However, this subGCSP has only 5 (= 4 + 3 + 3 + 3 − 2 − 2 − 2 − 1 − 1) DOFs, and is then overs rigid. A similar wrong behaviour occurs with the GCSP ABC of Figure 1-a: it is also non-trivial (3 objects in 2D) and rigid (3 parallel lines lying at prescribed distance in the plane), but has only 2 (= 2 + 2 + 2 − 1 − 1 − 1 − 1) DOFs and is then over-s rigid. This is because the number of displacements does not depend on the number of objects but on their geometric properties. Another way to treat all these special cases is to add ad-hoc rules to characterise them correctly [Sit00]. However, these rules cannot handle every exception that can occur in practice, and renders the characterisation process not very general. Conclusion on the Structural Rigidity The structural rigidity suffers from the lack of reliability of the two approximations it uses and none of the heuristics proposed so far permit to overcome these problems. In the following section, we introduce the degree of rigidity concept which represents an exact evaluation of the number of displacements allowed for a given GCSP, and requires to take into account the geometric properties of the GCSP. It is the basis for our new characterisation of rigidity presented in Section 4.
3
Degree of Rigidity
Intuitively, the degree of rigidity represents the number of DOFs a GCSP must have to be rigid. According to the standard characterisation scheme proposed in the previous section, this means that the degree of rigidity is an evaluation of the number of displacements allowed in a GCSP. To define the degree of rigidity formally, we need to introduce the concept of rigidification of a set of objects: Definition 6 Rigidification A rigidification of a set of objects O is a non-redundant set of constraints RO such that the resulting GCSP SR = (O, RO ) is rigid. We also need to define the concept of geometric consistency (g consistency). Intuitively, two set of constraints are g consistent if they do not imply contradictory geometric properties. By geometric property is understood any geometric relation between objects which can have an impact on its number of displacements. More formally: of points C and D along line A, which introduces a deformation in the subGCSP. However, this subGCSP has 6 DOFs, which makes it s rigid if we do not check the trivial subGCSPs it contains.
A New Structural Rigidity for Geometric Constraint Systems
97
Definition 7 G consistency Let C1 and C2 be two set of constraints on the same set of objects O. C1 and C2 are g consistent iff Ig (C1 ∪ C2) is consistent, where Ig is an operator which produces all the geometric properties induced by a set of constraints. It is now possible to propose a formal definition of the degree of rigidity: Definition 8 Degree of Rigidity (DOR) Let O be a subset of objects in a GCSP S = (O, C) and RO be a rigidification of O g consistent with C. Then, DOR(O , RO , S) = DOF((O , RO )). Thanks to Hypothesis 1, the DOR is unique and does not depend on the chosen rigidification as long as it is g consistent with the constraints of the GCSP. Indeed, if different rigidifications were yielding to different DOR values, this would mean that the subGCSP S induced by O would have a varying number of displacements, i.e. would be non-globally characterisable which does not satisfy Hypothesis 1. To define the degree of rigidity of a subset O of objects in a GCSP S, we need to take into account all the objects and constraints in S because geometric properties can come from objects/constraints outside O . For example, consider the subset of objects O = {A, C} in the GCSP of Figure 1-a; the parallelism of these lines has an impact on their number of displacements in 2D, and is thus a geometric property of interest for us. However, the parallelism is not directly stated as a constraint between A and C, but comes from the fact that both are parallel to B; this is why we need to consider the complete GCSP to be able to infer all the geometric properties on a subset of objects only. Why the DOR Is an Exact Evaluation of the Number of Displacements The degree of rigidity is exactly equal to the number of displacements of SR . Indeed, the DOF count is not mistaken because the rigidifications contain no redundancies nor singularities4 . More important, if the DOR did not reflect the right number of displacements of the subGCSP S induced by O , it would mean that RO introduces a contradictory geometric property in the system, i.e. is not g consistent with the constraints of the GCSP embedding O . We refer the reader to [Jer02] for a more formal proof of these claims. 3.1
Computation of the DOR
The process for computing the DOR of a subset of objects O in a GCSP S = (O, C) could be described as follows: 1. Compute the set R of all the possible rigidifications of O 2. Extract a rigidification RO ∈ R which is g consistent with C 3. DOR(O , RO , S) = DOF((O, RO )). 4
Other than the ones induced by the non-valued constraints in the rigidifications, see Hypothesis 2.
98
Christophe Jermann et al.
Computing all the rigidifications of a set of objects is not easy. Fortunately, the DOR computation process can be simplified thanks to the following proposition. Proposition 1 If O and O are two subsets of objects in a GCSP S such that O ⊂ O , then DOR(O , RO , S)≤DOR(O, RO , S). Basically, this means that the DOR increases with the number of objects. Indeed, keeping in mind that the DOR represents the number of displacements allowed in a subGCSP, and that we restricted the constraints to be only relative to the objects, it is clear that adding objects to a subGCSP cannot remove displacements. ✷ Then, we define the concept of DOR-minimal subset of objects: Definition 9 DOR-minimal subset of objects A subset O of objects in a GCSP S is DOR-minimal if it contains no proper subset of objects with the same DOR. It results from Proposition 1 that: Proposition 2 DOR(O , RO , S) = maxO ∈DM(O ,S) DOR(O , RO , S), where DM(O , S) is the set of DOR-minimal subsets of objects in O . Indeed, since the DOR only increases when objects are added, the DOR of any subset of objects is necessarily equal to the greatest of its DOR-minimal ones. ✷ Thus, computing the DOR of any set of objects in a GCSP amounts to computing the DOR of its DOR-minimal subsets. This is an important improvement because of the following proposition: Proposition 3 In dimension d, a DOR-minimal subset of objects contains at + 1 geometric objects. most d(d−1) 2 Indeed, a single geometric object in dimension d allows at least d displacements. Moreover, in a DOR-minimal GCSP, each object must add at least 1 to the DOR, otherwise the object is unnecessary, and the subGCSP is not DORminimal. All these remarks imply that a subGCSP with n objects has a DOR greater or equal to d + n − 1 (d for the first object, n − 1 for the remaining ones). since a geometric d-space Finally, the DOR of a subGCSP is at most d(d+1) 2 allows at most this number of independent displacements (see Proposition 1). , i.e. n ≤ d(d−1) + 1.✷ Thus, for a subGCSP with n objects, d + n − 1 ≤ d(d+1) 2 2 In fact, we have even proved by enumeration that for GCSPs in 2D (resp. 3D) composed only of points, lines (and planes in 3D) linked by distance, angle, parallelism and incidence constraints, this maximum number of objects is reduced to 2 (resp. 3). For GCSPs of these types, which can be used to model many real-world applications, this means that one only has to consider pairs (resp. triplets in 3D) of objects to compute the DOR of any set of objects.
A New Structural Rigidity for Geometric Constraint Systems
99
DOR-minimal and rigidification computation In a given class S of GCSPs with a fixed set O of types of objects and a fixed set C of types of constraints, we propose to use the following process for determining the set of DOR-minimal subsets (and their possible rigidifications) that can appear in any GCSP in S: 1. Compute the set DORminn of all the subsets of n objects of types in O 2. For each O ∈ DORminn , determine the set RO of all the possible rigidifications of O based on constraints of types in C 3. For each pair R ∈ RO : – if ∃O O with DOR(O , R , S)=DOR(O, R, S), then the pair (O, R) is not a potential DOR-minimal; – otherwise, (O, R) is added to the list of potential DOR-minimal. This process terminates because of the size limit given in Proposition 3, and because the types of objects and constraints are fixed. With this process, one can precompute once for all a table of all the possible pairs (set of objects, rigidification) which can be DOR-minimal in any GCSP of the considered class of GCSPs We have done this precomputation for the classes of GCSPs discussed above, and it resulted in a set of 3 (11 in 3D) subsets of objects, associated to at most 3 rigidifications each. Checking the G consistency To check the g consistency, one need an inference operator able to produce all the geometric properties induced by a set of constraints which influence the number of displacements of a given set of objects in a GCSP. It is known (see [Jer02] for more details) that the number of displacements only depends on the singularity or non-singularity of the relative positions of the objects. For instance, two parallel lines in 2D allow only 2 displacements, while two non-parallel lines allow 3. Because of Hypothesis 2, every geometric property can be stated by a non-valued constraint (which represent a singular relative placement) or its negation (which represent a non-singular relative placement). Thus, one need to be able to infer new constraints from a given set of constraints. This amounts to geometric theorem proving: Ig (see Definition 7) is nothing but an automated geometric deduction process. For this purpose, one could use formal approaches [Wu86, Cho88, Wan02] or rule-based inference methods. We will not detail this step in this paper. Avoiding formal theorem proving The use of several heuristics can avoid the need for theorem proving in practice. For instance, the candidate pairs (DORminimal subset, rigidification) can be sorted in decreasing order of their DOR, since the DOR of a set of objects is the maximum of the DORs of its DORminimal subsets (see Proposition 2). Also, the pairs for which the rigidification can be proved g consistent trivially can be used first; this is the case in particular if a rigidification specifies geometric properties which are explicitly stated as constraints in the GCSP.
100
3.2
Christophe Jermann et al.
Example of DOR Computation
We illustrate the computation of the DOR on the GCSP depicted in Figure 1-a. First, we compute the DOR-minimal subsets of objects in this GCSP. As stated above, they are reduced to pairs of objects since we are in the class ({points, lines}, {distances, angles, incidences, parallelisms}) in 2D: {A, B}, {B, C} and {A, C} are the three DOR-minimal subsets of objects in this GCSP. We start by computing the DOR of {A, B}. The possible rigidifications of {A, B} in the considered class of GCSPs are: 1. Angle(A, B)=α (α = 0) 2. Parallelism(A, B), Distance(A, B)=d (d = 0) 3. Incidence(A, B) (which means coincidence of the lines). The DOR associated to these rigidifications are respectively: 1. DOF(({A, B},{Angle(A, B)}))=2 + 2 − 1=3 2. DOF(({A, B},{Parallelism(A, B), Distance(A, B}))=2 + 2 − 1 − 1=2 3. DOF(({A, B},{Incidence(A, B)}))=2 + 2 − 2=2 Now we have to determine which rigidifications are g consistent with the constraints of the GCSP. It is clear that it cannot be the first one, since the GCSP explicitly contains a parallelism constraint between A and B. Now, depending on the value of the distance (null or not null) in the GCSP ABC, it could be the second or the third one5 . In fact, we do not even care about the value of the distance because the rigidifications 2 and 3 result in the same DOR: this illustrates how we can skip theorem proving in practical cases. The same process is repeated for {B, C} and {A, C} and results in DOR=2 for both also. According to Proposition 2, the DOR of the GCSP is then 2. This explains why, while rigid, this GCSP does not have the 3 DOFs required by the structural rigidity in 2D.
4
Extended Structural Rigidity
Given the concept of degree of rigidity, we propose the following characterisation of the rigidity of all the solutions of a GCSP: Definition 10 Extended Structural Rigidity (es rigidity) - A GCSP S = (O, C) is over-es rigid iff ∃S = (O , C ) ⊆ S, DOF(S ) ¡ DOR(O , RO , S); - it is es rigid iff DOF(S) = DOR(O, RO , S) and S is not over-es rigid; - it is under-es rigid iff DOF(S) ¿ DOR(O, RO , S) and S is not over-es rigid. 5
Note that according to the Hypothesis 2, we can ensure that the distance cannot be null.
A New Structural Rigidity for Geometric Constraint Systems
CD CDF BCD ACDE ABCD ACDEF ABCDE ABCDEF
101
Rigidity DOF S1 S2 DOR S3 exact 5 over trivial 5 exact exact 6 over trivial 6 exact under 7 over trivial 5 under exact 5 over over 5 exact under 6 over exact 5 under over 5 over over 6 over under 6 over over 5 under over 6 over over 6 over
Table 1. Comparison table for rigidity and structural characterisations of rigidity on subGCSPs of the example presented in figure 1-b This definition is very similar to the definition of structural rigidity (see Definition 5). In fact, the only difference is that we use the DOR instead of the . constant d(d+1) 2 Table 1 presents the answers given by the structural rigidity (S1), the heuristically enhanced structural rigidity (S2), i.e. where only non-trivial subGCSPs are considered, and the extended structural rigidity (S3) over some subGCSPs of Figure 1-b. Each line in this table presents one subGCSP. This table illustrates the superiority of the es rigidity over the s rigidity, even with the commonly used heuristic; we also see that non-trivial subGCSPs having = 6 in dimension d = 3) can mislead the heuristically enhanced DOR ¡ 6 ( d(d+1) 2 s rigidity; the es rigidity characterises correctly all subGCSPs in this example (as well as every subGCSP in Figure 1). Here is a formal proof by disjunction that the es rigidity is strictly superior (in the sense it characterises correctly strictly more GCSPs) to the s rigidity, even heuristically enhanced: – If the count of DOFs is false, then both es rigidity and s rigidity fail. – If the count of DOFs is correct, then: • if the number of displacements (=DOR) is equal to d(d+1) for every 2 subGCSP then both s rigidity and es rigidity characterise correctly the GCSP. for at • if the number of displacements (=DOR) is not equal to d(d+1) 2 least one subGCSP, then s rigidity (even with the discussed heuristic) fails while es rigidity characterises correctly the GCSP. ✷ Thus, every method based on previous definitions of structural rigidity should consider using our new characterisation of rigidity: it will certainly turn out into a significant gain in reliability and generality. 4.1
Limits of the Es rigidity
Es rigidity uses an exact evaluation of the number of displacements but still relies on a DOF count to approximate the number of movements in a GCSP.
102
Christophe Jermann et al.
a)
b)
4+ 1 S
dAB pAB
31 1 11 dBC 11 p BC
A
2
2
2 B 22 2 C 2
3
T
S
R dAB
1 1 pAB 11 11 dBC 11 p BC
A 2 2 B 22 2 C 2
T
Fig. 3. The objects-constraint network corresponding to the GCPS in Figure 1a. a) Application of Hoffmann et al.’s function Distribute. b) Application of our new function Distribute
We have explained in section 2.5 that the DOF count can be false in case of redundancies, and in case of singularities if Hypothesis 2 does not hold. Thus it remains an heuristic even if Hypothesis 1 holds.
5
Tackling the Main Issues Related to Rigidity with Es rigidity
In this section, we briefly explain how s rigidity can be replaced by es rigidity in the algorithms designed by Hoffmann et al. [HLS97] to tackle the major issues related to the rigidity concept, i.e. deciding if a GCSP is rigid, identifying rigid and over-rigid subGCSPs and minimising their size. The structural rigidity identification algorithms proposed by Hoffmann et al. use flow machinery in a bipartite network derived from the GCSP: the objectsconstraints network (see Figure 3 of an example). Definition 11 Objects-Constraints Network To a GCSP S = (O, C) corresponds one objects-constraints network G = (V, E, w) such that: - s ∈ V is the source and t ∈ V is the sink - Each object o ∈ O becomes an object-node vo ∈ V - Each constraint c ∈ C becomes a constraint-node vc ∈ V - For each object o ∈ O there is an arc vo → t in E, with capacity w(vo → t)=DOF(o) - For each constraint c ∈ C, there is an arc s → vc in E, with capacity w(s → vc )=DOF(c) - For each object o ∈ O constrained by c ∈ C there is an arc vc → vo of capacity w(vc → vo ) = ∞ in E. A flow distribution in this network represents a distribution of the constraints DOFs onto the objects DOFs. Hence, a maximum flow represents an optimal distribution of the DOFs in the GCSP.
A New Structural Rigidity for Geometric Constraint Systems
103
Hoffmann et al.’s algorithms Hoffmann et al.’s algorithms are all based on the same flow-distribution function called Distribute which: 1. overloads the capacity of one arc from the source to a constraint c, by 1. 2. distributes a maximum flow in the overloaded network.
d(d+1) + 2
This process is illustrated in Figure 3-a, where the first constraint is over+ 1 = 4) and a maximum flow distribution is depicted. loaded by 4 (in 2D, d(d+1) 2 If the overloaded arc is not saturated (i.e. the distributed flow is less than the capacity of the arc), Hoffmann et al. proved that there exists a subGCSP S having less than d(d+1) + 1 DOFs, i.e. a well- or over-s rigid subGCSP. This 2 subGCSP is induced by the set of objects traversed during the last search for an augmenting path in the maximum flow computation [HLS97]. Then, Hoffmann et al. propose an algorithm for finding well- or over-s rigid subGCSPs in a GCSP, which simply applies the Distribute function to each constraint in an incrementally constructed objects-constraints network [HLS97]. Other algorithms for identifying only over-s rigid subGCSPs and for minimising well- or over-s rigid subGCSPs are proposed in [HLS97]. Modifications of Hoffmann et al.’s algorithms We propose to modify the Distribute function to derive a new family of similar algorithms based on es rigidity to tackle the major issues related to rigidity in a more reliable way. To achieve this improvement, we propose two modifications: 1. the overload is not applied on an existing constraint but is distributed through a dedicated node R added to the objects-constraints network; this node, which can be seen as a virtual constraint, can be linked to any subset of objects in the network. + 1 is replaced by DOR(O , S)+1 where O is the subset 2. the overload d(d+1) 2 of objects to which the virtual constraint R is attached. Hence, if a maximum flow distribution cannot saturate the arc s → R, this means that there exists a subGCSP with less DOFs than the DOR of its objects, i.e. a well- or over-es rigid GCSP. This new process is illustrated in Figure 3-b, where the virtual constraint R appears and is associated to a capacity of 3 since it is linked to A and B, two parallel lines having DOR=2. Note that both the value of the overload, and the way it is distributed have changed on this example. Thanks to the properties of the DOR concept we have proven in section 3, it is not needed to apply the new Distribute function to any subset of objects but only to the DOR-minimal subsets. Thus, we can derive new polynomial algorithms similar to Hoffmann et al.’s ones for detecting well- or over-es rigid subGCSP, for detecting over-es rigid ones only, and for minimising them. More details, as well as correctness and completeness proofs and a discussion on the complexity of these algorithms, can be found in [JNT03].
104
6
Christophe Jermann et al.
The Multiple Rigidity Case
In case Hypothesis 1 does not hold, we have to take into account the fact that GCSPs can be non-globally characterisable. In this case, the DOR computation process we have presented is still valid: the only change is that the rigidifications which are g consistent with the constraints of the GCSP can yield to a set of DORs instead of a single DOR value. However, the geometric decomposition of non-globally characterisable GCSPs would result in as many decompositions as there are possible cases of rigidity for their subGCSPs, i.e. a potentially exponential number of decompositions. Thus, even if we cannot guarantee Hypothesis 1, it is advisable to continue using an a priori global rigidity of all the solutions of the GCSPs, knowing well that it is only a heuristic. Even if we do not take into account the multiple DORs in non-globally characterisable GCSPs, the es rigidity remains better than the s rigidity.
7
Conclusion
We have provided a thorough analysis of the gap between structural rigidity and rigidity: it lies in the approximation of both the number of movements and the number of displacements of the considered GCSP. The causes of failure mainly reside in the fact that the structural rigidity does not take into account the geometric properties of the GCSPs. We have introduced the degree of rigidity concept for the exact computation of the number of displacements allowed in a given GCSP. We have explicited an algorithm for computing the DOR, which involves geometric theorem proving in the general case. We have shown that this can be avoided in practical cases. We have then explained why any a priori characterisation of the rigidity of all the solutions of a GCSP cannot be complete and correct. This is related to the fact that some GCSPs have at the same time rigid and non-rigid solutions. This has an impact on the DOR computation, since this results in multiple DOR values for a given set of objects. However, under the assumption that all the solutions of a GCSP have the same rigidity state, we have proposed a new a priori characterisation of rigidity: the extended structural rigidity. It uses the DOR as an evaluation of the number of displacements allowed for a GCSP. We have shown that this characterisation, while still being an approximation of rigidity, is strictly superior to the classical or heuristically enhanced structural rigidity. We have shown (see [JNT03] for more details) that algorithms based on the structural rigidity can be modified to deal with the extended structural rigidity. This allows us to address the major issues related to rigidity in a more reliable and general way. Hence, all geometric methods based on the structural rigidity characterisation can now be upgraded to use the extended structural rigidity. We expect this will result in much more reliable algorithms in practice, in particular for the decomposition of GCSPs.
A New Structural Rigidity for Geometric Constraint Systems
105
References [Ang82] [BFH+ 95] [Cho88] [DMS97]
[FH93]
[Gr17] [Gra02]
[Hen92] [HLS97]
[HLS00]
[Jer02]
[JNT03]
[JTNR00]
[Kra92] [Lam70] [LM96]
[Sit00] [Wan02]
[Whi87]
J. Angeles. Spatial Kinematic Chains. Springer-Verlag, Berlin, 1982. 89 W. Bouma, I. Fudos, C. M. Hoffmann, J. Cai, and R. Paige. Geometric constraint solver. Computer Aided Design, 27(6):487–501, 1995. 87 S. C. Chou. Mechanical Theorem Proving. Reidel Publishing Co., 1988. 99 J.-F. Dufourd, P. Mathis, and P. Schreck. Formal resolution of geometrical constraint systems by assembling. In C. Hoffmann and W. Bronswort, editors, Proc. Fourth Symposium on Solid Modeling and Applications, pages 271–284, 1997. 87 I. Fudos and C. M. Hoffmann. Correctness proof of a geometric constraint solver. Technical Report TR-CSD-93-076, Purdue University, West Lafayette, Indiana, 1993. 87 Grbler. Getriebelehre. Springer, Berlin, 1917. 90 J. Graver. Counting on Frameworks: Mathematics to Aid the Design of Rigid Structures. Number 25 in Dolciani Mathematical Expositions. Mathematical Association of America, 2002. 90 B. Hendrickson. Conditions for unique realizations. SIAM j Computing, 21(1):65–84, 1992. 95 C. M. Hoffmann, A. Lomonosov, and M. Sitharam. Finding solvable subsets of constraint graphs. In Principles and Practice of Constraint Programming CP’97, pages 463–477, 1997. 87, 88, 95, 102, 103 C. M. Hoffmann, A. Lomonosov, and M. Sitharam. Decomposition plans for geometric constraint systems. In Proc. J. Symbolic Computation 2000, 2000. 87, 91 C. Jermann. Rsolution de contraintes gomtriques par rigidification rcursive et propagation d’intervalles. Thse de doctorat en informatique, Universit de Nice Sophia-Antipolis, 2002. 97, 99 C. Jermann, B. Neveu, and G. Trombettoni. Algorithms for identifying rigid subsystems in geometric constraint systems. In 18th International Joint Conference in Artificial Intelligence, IJCAI-03, 2003. 103, 104 C. Jermann, G. Trombettoni, B. Neveu, and M. Rueher. A constraint programming approach for solving rigid geometric systems. In Principles and Practice of Constraint Programming, CP 2000, volume 1894 of LNCS, pages 233–248, 2000. 87, 91 G. Kramer. Solving Geometric Constraint Systems. MIT Press, 1992. 87, 91 G. Laman. On graphs and rigidity of plane skeletal structures. J. Eng. Math., 4:331–340, 1970. 90 R. S. Latham and A. E. Middleditch. Connectivity analysis: A tool for processing geometric constraints. Computer Aided Design, 28(11):917– 928, 1996. 87, 95 M. Sitharam. Personal communication on the minimal dense algorithm. University of Florida at Gainesville, 2000. 95, 96 D. Wang. Geother 1.1: Handling and proving geometric theorems automatically. In Proceedings of the 4t h International Workshop on Automated Deduction in Geometry, 2002. 99 W. Whiteley. Applications of the geometry of rigid structures. In Henry Crapo, editor, Computer Aided Geometric Reasoning, pages 219–254. INRIA, 1987. 90
106 [Wu86]
Christophe Jermann et al. W. Wu. Basic principles of mechanical theorem proving in elementary geometries. J. Automated Reasoning, 2:221–254, 1986. 99
Algebraic Representation, Elimination and Expansion in Automated Geometric Theorem Proving Hongbo Li Mathematics Mechanization Key Lab Academy of Mathematics and System Sciences Chinese Academy of Sciences Beijing 100080, China [email protected] Abstract. Cayley algebra and bracket algebra are important approaches to invariant computing in projective and affine geometries, but there are some difficulties in doing algebraic computation. In this paper we show how the principle “breefs” – bracket-oriented representation, elimination and expansion for factored and shortest results, can significantly simplify algebraic computations. We present several typical examples on automated theorem proving in conics and make detailed discussions on the procedure of applying the principle to automated geometric theorem proving. Keywords. Cayley algebra, bracket algebra, automated theorem proving, projective geometry, affine geometry, conics.
1
Introduction
Cayley algebra and bracket algebra are important approaches to invariant computations in projective geometry [1], [3], [7], [15], [16], [17], [18], [20], [21], [23], and have been used in automated theorem proving in projective geometry for over a decade [6], [9], [13], [14]. Recently, in a series of papers [10], [11], [12], the authors further applied the two algebras in theorem proving in projective and affine geometries, and developed some new techniques to overcome the following difficulties in the application. 1. Multiple algebraic representations. The simplest example is the constraint that six planar points 1, 2, 3, 4, 5, 6 are on the same conic. They must satisfy the following equality: conic(123456) = [135][245][126][346] − [125][345][136][246] = 0. (1.1) Changing the order of the sequence, we get all together 15 different equalities: conic(123456) = 0, conic(123546) = 0, conic(123645) = 0, conic(124356) = 0, conic(124536) = 0, conic(124635) = 0, conic(125346) = 0, conic(125436) = 0, conic(125634) = 0, conic(126345) = 0, conic(126435) = 0, conic(126534) = 0, conic(134256) = 0, conic(135246) = 0, conic(136245) = 0. F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 106–123, 2004. c Springer-Verlag Berlin Heidelberg 2004
(1.2)
Algebraic Representation, Elimination and Expansion
107
If the constraint occurs in the hypotheses, then which of the 15 equalities should be used? If it occurs in the conclusion, then which equality can lead to a simpler proof? If there are more than 6 points on the conic, the number of equalities increases very fast. 2. Multiple elimination strategies. If there are multiple representations for the same constraint, there will be multiple elimination strategies. Even if all representations are unique, and the elimination follows strictly the order of construction, there can still be multiple elimination strategies. For example, in bracket [ABC], all three points are intersections of lines, and all the lines have been constructed before the three points. Then the three points are constructed at the same time, and can be eliminated either one by one, or all at the same time, or in an intermediate fashion. 3. Multiple expansion results. In the projective plane, let A = 12∩34, B = 1 2 ∩ 3 4 , C = 1 2 ∩ 3 4 . Eliminating A, B, C from bracket [ABC], we get (1.3) [(12 ∧ 34)(1 2 ∧ 3 4 )(1 2 ∧ 3 4 )]. Expanding a Cayley expression into a bracket polynomial is called Cayley expansion. Here (1.3) has 16,847 different expansions into bracket polynomials. Then which one should we choose? 4. Multiple equivalent expressions. The bracket algebra is the quotient of the polynomial ring of brackets, by the ideal generated by GrassmannPl¨ ucker syzygies. Because of this, a bracket polynomial has multiple different forms. It is natural to consider finding the “simpler” forms – factored or shortest ones. This is a procedure of simplification. How to compute a bracket representation having the minimal number of tableaux is an open problem [17]. 5. From brackets to vector expressions – Cayley factorization. The multilinear case is solved in [21]. The general case is an open problem. Despite the difficulties, it is quite worthwhile and rewarding to consider using invariant algebras in automated geometric theorem proving, because amazing simplifications can be achieved. In [10], a complete classification of factored expansions and binomial expansions of all Cayley expressions resulted from eliminating points in a bracket in 2D or 3D projective geometry is carried out. This solves the third problem for 2D and 3D cases. In [11], various representations of conics and related geometric entities are established, together with their transformation properties. In this paper, the work is further extended to include more geometric constructions. This solves the third problem for the case of projective and affine conics. The idea of batch elimination comes from Cayley expansion. In [10], the points constructed at the same time with the same fashion can be eliminated at the same time, and several techniques are developed to reduce a bracket polynomial to a factored or shortest form. In [11], the techniques are further developed
108
Hongbo Li
to include points satisfying multiple nonlinear constraints. In [12], the scope is enlarged to the affine case. The choice of the best representation from multiple ones follows the principle “breefs” – bracket-oriented representation, elimination and expansion for factored and shortest results. In this paper, this principle is explained in great details in the procedure of automated theorem proving in projective and affine conic geometries. The main content of this paper is some further exploration of conic geometry from both projective and affine aspects, and the illustration of the “breefs” principle by detailed case studies. The proofs in the examples are obtained automatically without any human interaction. The focus is concentrated on how the principle is carried out to simplify algebraic computations. Once the techniques are made clear, the computer program implementations become straightforward realizations by codes.
2
Cayley and Bracket Algebras for Projective and Affine Geometries
We present a brief introduction of Cayley algebra and bracket algebra and their connections with projective geometry and affine geometry. Thorough expositions can be found in [7], [1], [17], [20], etc. Let V n be an n-dimensional vector space over a field F whose characteristic is not 2. Then V n generates a Grassmann algebra Λ(V n ) in which the outer product is denoted by juxtaposition of elements. The Grassmann space is graded, whose grades range from 0 to n. An element of grade r is called an r-vector. Let xr denote the r-graded part of x ∈ Λ(V n ). Let In be a fixed nonzero nvector in Λ(V n ). The following bilinear form BIn (x, y) = x ∨ yn /In , ∀x, y ∈ Λ(V n )
(2.4)
is nonsingular, and induces a linear invertible mapping i: Λ(V n ) −→ Λ(V n ∗ ), where V n ∗ is the dual vector space of V n . Then ∧ = i−1 ◦ ∨ ◦ i defines the meet product in Λ(V n ). The Grassmann space Λ(V n ) equipped with the outer product and the meet product is called the Cayley algebra over V n . Cayley algebra provides projectively invariant algebraic interpretations of synthetic geometric statements. In this algebra, a projective point is represented by a nonzero vector, which is unique up to scale. It is always denoted by a boldfaced integer or character. A line passing through points 1, 2 is represented by 12. Three points 1, 2, 3 are collinear if and only if their outer product 123 equals zero. In the projective plane, the intersection of two lines 12, 1 2 is 12 ∧ 1 2 . For three lines 12, 1 2 , 1 2 , their meet product 12 ∧ 1 2 ∧ 1 2 equals zero if and only if the three lines are concurrent. An affine space An is composed of the projective points outside a projective hyperplane in an nD projective space. In Cayley algebra, a projective hyperplane
Algebraic Representation, Elimination and Expansion
109
in the projective space V n+1 is represented by a nonzero n-vector In . Projective points in this hyperplane are called points at infinity of An , and the hyperplane is called the hyperplane at infinity. So a vector X represents a point in An if and only if XIn = 0. The point at infinity of line 12 is In ∧ 12. Two coplanar lines 12, 34 are parallel if they meet at infinity, i.e., if (12 ∧ 34)In = 0. Now we introduce bracket algebra, a suitable coordinate-free algebraic setting to deal with projective configurations. For any n-vector Jn ∈ Λ(V n ), its bracket is defined by (2.5) [Jn ] = Jn /In = BIn (Jn , 1) = BIn (1, Jn ). The following is the Cramer’s rule: for any n + 1 vectors A1 , . . . , An , B in V n, n ˇ i · · · An ]Ai . (−1)i+1 [BA1 · · · A (2.6) [A1 · · · An ]B = i=1
ˇ i denotes the absence of Ai in the series A1 to An . The following is the Here A expansion formula of the meet product: for vectors A1 , . . . , Ar and B1 , . . . , Bs , where r + s ≥ n, (A1 · · · Ar ) ∧ (B1 · · · Bs ) = sign(σ)[Aσ(1) · · · Aσ(n−s) B1 · · · Bs ]Aσ(n−s+1) · · · Aσ(r) =
σ
(2.7)
sign(τ )[A1 · · · Ar Bτ (r+s+1−n) · · · Bτ (s) ]Bτ (1) · · · Bτ (r+s−n) .
τ
Here σ is a permutation of 1, . . . , r such that σ(1) < · · · < σ(n − s) and σ(n − s + 1) < · · · < σ(r), and τ is a permutation of 1, . . . , s such that τ (1) < · · · < τ (r + s − n) and τ (r + s + 1 − n) < · · · < τ (s). Let A1 , . . . , Am be symbols, and let [Ai1 · · · Ain ] be indeterminates over F for each n-tuple 1 ≤ i1 , . . . , in ≤ m, such that they are algebraically independent over F and each n-tuple is anticommutative with respect to its elements. The (n − 1)D bracket algebra generated by the A’s over F is the quotient of the polynomial ring F [ {[Ai1 · · · Ain ] | 1 ≤ i1 , . . . , in ≤ m} ] by the ideal In,m generated by elements of the following three types: B1. [Ai1 · · · Ain ] if any ij = ik , j = k. B2. [Ai1 · · · Ain ] − sign(σ)[Aiσ(1) · · · Aiσ(n) ] for any permutation σ of 1, . . . , n. GP. (Grassmann-Pl¨ ucker polynomials) n+1
ˇ j . . . Aj ]. (−1)k+1 [Ai1 · · · Ain−1 Ajk ][Aj1 · · · A n+1 k
(2.8)
k=1
Let In denote the hyperplane at infinity of An in V n+1 . Define a linear mapping ∂ from Λ(V n+1 ) to Λ(In ), called the boundary operator, as follows: ∂(A) = In ∧ A, ∀A ∈ Λ(V n+1 ).
(2.9)
110
Hongbo Li
When A is a vector, we usually use the notation ∂(A) = [A], although the bracket here is no longer in the same sense as before. In application, people usually set [A] = 1 for all points in An . Then the representation becomes inhomogeneous. Bracket algebra can be extended to the affine case as follows. Let A1 , . . ., Am be symbols, and let [Ai1 · · · Ain ] be indeterminates over F for each n-tuple 1 ≤ i1 , . . . , in ≤ m, such that they are algebraically independent over F and each n-tuple is anticommutative with respect to its elements. The (n−1)D affine bracket algebra generated by the A’s over F is the quotient of the polynomial ring F [ {[Ai1 · · · Ain ], [Aj ] | 1 ≤ i1 , . . . , in ≤ m, 1 ≤ j ≤ m} ] by the ideal Jn,m generated by elements of four types: B1, B2, GP, and AGP. (Affine Grassmann-Pl¨ ucker polynomials) n+1
ˇ j . . . Ajn+1 ]. (−1)k+1 [Ajk ][Aj1 · · · A k
(2.10)
k=1
3
Some Algebraic Representations of Conics
Algebraic representations of geometric entities or constraints are needed in algebraic computations of geometric problems. There are often multiple representations for the same geometric entity or constraint, and different representations can occur within the same expression. It is an important task to study various representations and the transformation properties among them. 3.1
Point Conics
There are three kinds of projective conics: (1) a line and itself, (2) two different lines, (3) a conic having no lines, called nondegenerate conic. Only the latter two are considered in this paper. The numbers field can be allowed to be any field of characteristic not 2. Let 1, 2, 3, 4, 5 be five points in the projective plane. Assume that they are distinct from each other and that no four of them are collinear. This set of inequality conditions is denoted by ∃12345. A classical conclusion is that such five points determine a unique conic, denoted by conic(12345), such that any point X in the plane is on the conic if and only if conic(12345X) = 0.
(3.11)
Such a conic is called a point conic. For any six points 1, 2, 3, 4, 5, X in the plane, the expression conic(12345X) is antisymmetric with respect to them. Two distinct points A, B are said to be conjugate with respect to a conic, if either they are conjugate with respect to the points C, D in which AB meets the conic, or line AB is part of the conic. A point is conjugate to itself with respect to a conic if it is on the conic. If A is not a double point of a conic, i.e., not the intersection of the two lines of a conic, then the conjugates of A with respect to the conic form a line, called
Algebraic Representation, Elimination and Expansion
111
the polar of A. In particular, if A is on the conic, its polar is the tangent at A. Dually, the points on a line l which is not part of a conic, have a unique common conjugate with respect to the conic, called the pole of l. When l is tangent to the conic, its pole is the point of tangency. By [11], the pole of line 12 with respect to conic(12345) can be represented as follows: pole12,345 = [145][234][235]1 + [134][135][245]2 − [124][125][345]3. (3.12) The representation is symmetric with respect to 1, 2, antisymmetric with respect to 3, 4, 5, and follows the point-conic transformation rules with respect to 3, 4, 5. Point-conic transformation rules. Let C(S) be a Cayley or bracket expression of points S = 1, . . . , i on a conic, and assume that C(S) is either symmetric or antisymmetric with respect to S. The point-conic transformation rules of C(S) with respect to S are that for any conic points 1 , 2 , 3 , [1k1 k2 ][1k3 k4 ] C(1, 2, . . . , i) = , C(1 , 2, . . . , i) [1 k1 k2 ][1 k3 k4 ]
(3.13)
where k1 , . . . , k4 are any four elements in S different from 1, 1 ; and [12k3 ][1k1 k2 ][2k1 k2 ] C(1, 2, 3, . . . , i) = , C(1 , 2 , 3, . . . , i) [1 2 k3 ][1 k1 k2 ][2 k1 k2 ]
(3.14)
where k1 , k2 , k3 are any three elements in S different from 1, 2, 1 , 2 ; and [123][1k1 k2 ][2k1 k2 ][3k1 k2 ] C(1, 2, 3, 4, . . . , i) = , C(1 , 2 , 3 , 4, . . . , i) [1 2 3 ][1 k1 k2 ][2 k1 k2 ][3 k1 k2 ]
(3.15)
where k1 , k2 are any two elements in S different from 1, 2, 3, 1 , 2 , 3 . The ratios in the formulas are called transformation coefficients. In the three cases, the nondegeneracy requirements are respectively ∃1k1 k2 k3 k4 , ∃1 k1 k2 k3 k4 ; ∃12k1 k2 k3 , ∃1 2 k1 k2 k3 ; ∃123k1 k2 , ∃1 2 3 k1 k2 .
(3.16)
Let X be the second intersection of line AB with conic(A1234). In [11], the following representation of X is derived: XAB,1234 = [134][24A][3AB] 12 ∧ AB − [124][34A][2AB] 13 ∧ AB. (3.17) The representation is antisymmetric with respect to 1, 2, 3, 4 and satisfies the point-conic transformation rules with respect to the four points. 3.2
Point-tangent Conics
A conic can also be constructed by four points and one tangent through one of the points. In [11], it is proved that given five points 1, 2, 3, 4, 5 in the projective
112
Hongbo Li
plane, such that (1) 1, 2, 3, 4 are distinct and non-collinear, (2) 4, 5 are distinct, (3) either points 1, 2, 3 are not on line 45, and point 4 is not on any of the lines 12, 13, 23, or only one of the points 1, 2, 3 is on line 45, then there exists a unique conic passing through points 1, 2, 3, 4 and tangent to line 45. A conic constructed in this manner is called a point-tangent conic, and denoted by conic(1234, 45). A point X is on the conic if and only if conic(X1234, 45) = [134][245][14X][23X] − [234][145][13X][24X] = 0. (3.18) The expression conic(X1234, 45) is antisymmetric with respect to 1, 2, 3, X. For point-tangent conics, the transformation rules and the representations of various geometric entities can be similarly developed. As an example, we establish the representations of the second intersection of a line and a conic. Let X = conic(A234, 45) ∩ AB. Then conic(AX234, 45) = [34X][245][4AX][23A] − [234][45X][3AX][24A] = 0. (3.19) Substituting X = λA + µB into it, we get λ [234][24B][3AB][45A] − [23B][245][34A][4AB] = . µ [23A][245][34A][4AB] − [234][24A][3AB][45A] So X = XAB,2435 = [234][3AB][45A]24 ∧ AB − [245][34A][4AB]23 ∧ AB. (3.20) Similarly, from conic(AX234, 45) = conic(A32X4, 45) = 0, we get XAB,4352 = [234][24A][3AB]45 ∧ AB − [23A][245][4AB]34 ∧ AB, (3.21) and XAB,4235 = [24A][345][3AB]24 ∧ AB − [245][2AB][34A]34 ∧ AB. (3.22) In the above indexing, 4 always precedes but does not immediately precede 5. There are all together 6 such indices. The relations are
XAB,4235 = − XAB,4325 = −XAB,2435 = XAB,3425 = −XAB,4253 = XAB,4352 , (3.23) i.e., XAB,4235 is antisymmetric with respect to 4, 2, 3, 5.
Algebraic Representation, Elimination and Expansion
3.3
113
Tangent-point Conics
The third construction of a conic is by two tangents and a point. In [11], it is proved that given five points 1, 2, 3, 4, 5 in the projective plane, such that (1) 1, 2, 3 are not collinear, (2) 24, 35 are lines and are distinct, (3) either 1 is on one of the lines 24, 35, or 1, 3 are not on line 24 and 1, 2 are not on line 35, then there exists a unique conic passing through 1, 2, 3 and tangent to lines 24, 35. A conic constructed in this manner is called a tangent-point conic, denoted by conic(123, 24, 35). A point X is on the conic if and only if conic(X123, 24, 35) = 0, where conic(X123, 24, 35) = [123]2 [24X][35X] − [124][135][23X]2 = [12X][13X][234][235] − [12X][23X][135][234] − [13X][23X][124][235]. (3.24) The expression conic(X123, 24, 35) is symmetric with respect to 24 and 35. Again we compute the second intersection of a line and a conic. Let X = AB ∩ conic(A23, 24, 35). Using the second expression of conic(XA23, 24, 35) in (3.24), we get XAB,24,35 = [234][2AB][35A]AB ∧ 23 + [235][23A][3AB]AB ∧ 24. (3.25) The expression is symmetric with respect to 24 and 35. 3.4
Affine Conics
In affine geometry, there are three kinds of nondegenerate conics: (1) ellipse, if the line at infinity does not meet the conic; (2) hyperbola, if the line at infinity meets the conic at two distinct points at infinity; (3) parabola, if the line at infinity is tangent to the conic. The pole of the line at infinity with respect to a conic is called the center of the conic. The center of an ellipse or hyperbola is a point, while the center of a parabola is a point at infinity. An affine line passing through the center is called a diameter of the conic. Two diameters are conjugate to each other if their points at infinity are conjugate to each other. For a hyperbola, the two tangents at its points at infinity are called the asymptotes. Similar to the projective case, various representations and their transformation properties can be established. As an example, let us find the representations of a parabola by its center 0 and three points 1, 2, 3. Let 4 be a point at infinity different from 0. Then the parabola is just conic(1230, 04). Let 1, 2, 3 be points in A2 , and let 0 be a point at infinity, such that no three of 1, 2, 3, 0 are collinear. Then there exists a unique parabola passing through 1, 2, 3 with 0 as the center. Any point X is on the parabola if and only if parabola(X123, 0) = [2][130][10X][23X] − [1][230][20X][13X] = 0.
(3.26)
The expression parabola(X123, 0) is antisymmetric with respect to 1, 2, 3, X.
114
Hongbo Li
l
2
l
0
2 3
6
1
1
7 4
5
Fig. 1. Example 1
4
Case Study 1
Example 1. ˜et there be a hyperbola whose two asymptotes are l1 , l2 and whose center is 0. Let 1, 2, 3 be any three points on the hyperbola. Let 6 = 12 ∩ l1 , and let 7 be the intersection of the parallel line of l1 through 3 and the parallel line of l2 through 1. Then 23 and 67 are parallel. Hypotheses: Free points: 1, 2, 3. Free points at infinity: 4, 5. Pole: 0 = pole45 (12345). Intersections: 6 = 12 ∩ 04, 7 = 34 ∩ 15. Conclusion: [23 ∧ 67] = 0. Proof: [23 ∧ 67] [2(12∧04)(34∧15)] = [125][134][240] [3(12∧04)(34∧15)] = [124][135][340]
=
[3][267] − [2][367]
6,7
[3][125][134][240] −[2][124][135][340]
=
[3][125][134][24045,231 ] −[2][124][135][34045,312 ]
=
045,231 = [125][134][235]4 +[124][135][234]5−[123][145][345]2 045,312 = [124][135][235]4
[124] [125] [134] [135] =
[234] ([3][245] − [2][345])
+[125][134][234]5−[123][145][245]3 contract
=
0.
Algebraic Representation, Elimination and Expansion
115
Additional nondegeneracy condition: none. Explanation and discussion: (1) 23 ∧ 67 has two different expansions. In the above proof, the expansion separating 2, 3 is used. (2) The second step is eliminating 6, 7 at the same time. The reason for this batch elimination is that 6, 7 are both at the end of the sequence of constructions: 0 ≺ 6; 1, 2, 3, 4, 5 ≺ 7; and both are intersections of lines. (3) Both [267] and [367] are of the type [1(1 2 ∧ 3 4 )(1 2 ∧ 3 4 )] in which one of the i s or i s equals 1. This is the recursion pattern [10] and always has monomial expansion. (4) The third step is choosing representations for 0 before its elimination. This is carried out within each bracket containing 0. By (3.12), 0 is a linear combination of 4, 5 and another conic point X, so it has two essential points 4, 5, which occur in every representation of 0. In [240], because of the occurrence of conic point 2, it is chosen as X. In [340], 3 is chosen as X. The result is that both brackets have monomial expansions after the elimination of 0. (5) The last step is a contraction. It is based on the following GrassmannPl¨ ucker syzygy [3][245] − [2][345] = [4][235] − [5][234], (4.27) and the bracket computation rules [4] = [5] = 0. The purpose is to reduce the number of terms of a polynomial within bracket algebra. (6) In every step, if there is any common bracket factor, it is automatically removed. In the above proof, all such factors are outlined. (7) Additional nondegeneracy conditions: These are some inequality requirements which are needed not by the geometric constructions, but by the algebraic proof. In this example, there is no additional nondegeneracy condition. An alternative proof is to expand 23 ∧ 67 by separating 6, 7: [23 ∧ 67] [237]=−[135][234], [7]=[1][345],
[236]=−[123][024] [6]=[0][124]
= [6][237] − [7][236] 6,7
=
=
−[0][124][135][234] − [1][123][024][345] −[045,123 ][124][135][234] − [1][123][045,231 24][345]
045,231 = [125][134][235]4 +[124][135][234]5−[123][145][345]2 045,123 = [125][135][234]4 +[124][134][235]5−[123][245][345]1
= 0.
116
Hongbo Li
6
3
7
2 1 8
4 5
Fig. 2. Example 2.
Further discussion: (8) The second proof is simpler. By experience, if there are only two ends, then the expansion which separates them often performs better. In the above, all brackets containing 6, 7 have monomial expansions. (9) There are two brackets containing 0: [0] and [024]. The latter bracket demands the representation of 0 by 4, 5, 2. The former bracket does not demand anything, because the conic has only two points at infinity 4, 5, and they are both essential points of 0. However, choosing the representation by 4, 5, 1 can avoid doing contraction later on. (10) The projective version of the theorem is to change 4, 5 to two free points in the projective plane, and change the conclusion to the concurrency of lines 23, 45, 67. The proof is the same. (11) In programming, there is no need to choose between the two expansions of 23 ∧ 67. An implementation of the choice of optimal representations of 0 can be found in the “conic points selection” algorithm in [11].
5
Case Study 2
Example 2. Let there be a parabola passing through points 2, 3, 4. Let 7 be the intersection of the tangents at 3, 4, and let 8 be the intersection of 23 with the diameter through 4. Then 78 is parallel to the tangent at 2. Hypotheses: Free points: 3, 4, 5. Free points at infinity: 1, 6. Tangent point: 2 is the second tangent point from 6 to conic(3451, 16). Pole: 7 = pole34 (3451, 16). Intersection: 8 = 14 ∩ 23.
Algebraic Representation, Elimination and Expansion
117
Conclusion: [678] = 0. Proof. 8
= 67 ∧ 14 ∧ 23
[678]
= [146][237] − [147][236] = [14612,435][23734,215] −[14734,125][23612,345] 612,435 = −[135][234][245]1 −[134][145][235]2+[123][125][345]4 612,345 = [145][234][235]1 +[134][135][245]2−[124][125][345]3 6,7
= 0.
734,215 = −[124][135][245]3 −[123][145][235]4+[125][134][345]2 734,125 = [124][145][235]3 +[123][135][245]4−[125][234][345]1
Additional nondegeneracy condition: ∃12345. Explanation and discussion: (1) The sequence of constructions is 1, 6, 3, 4, 5 ≺
2 ≺ 8; 7.
Because 7 has multiple representations, only 8 is eliminated in the first step. (2) 6 is pole12 (12345), so the order of elimination is 1, 2, 3, 4, 5 ≺ 6, 7. The second step expands 67 ∧ 14 ∧ 23 by separating 6, 7. (3) The third step is choosing representations for 6, 7. In each bracket, the representation is uniquely determined. (4) The fourth step is a batch elimination of 6, 7. (5) In this proof, the order of elimination does not follow the order of construction. We can certainly represent 2, 7 by 6 etc. Then the proof becomes slightly more complicated. In doing elimination, we can either follow the original construction order, or reset the order in favor of the conclusion. In programming, when the input constructions are given, the conics, tangents, poles, etc., are collected before any computation occurs. A conic is composed of all the points and tangents of it. In this example, the parabola has four points, one point at infinity, three tangents and one tangent at infinity. There are two poles: 6 and 7. The change of elimination order can then be made automatic by these information and the conclusion. (6) In the proof, the property that 1, 6 are points at infinity is nowhere used. So the projective version of the theorem is also proved.
118
Hongbo Li
(7) The requirement ∃12345 is not needed by the constructions in the hypotheses, but needed by the representations of 6 and 7 by the five conic points in the proof. It is an additional nondegeneracy condition.
6
Case Study 3
Example 3. [Brianchon’s Theorem] Let there be six points on a conic: 1, 2, 3, 4, 5, 6. Draw six tangents of the conic at the six points. The neighboring tangents meet at points 7, 8, 9, 0, A, B respectively. Then 9B, 8A, 70 are concurrent. Hypotheses: Free conic points: 1, 2, 3, 4, 5, 6. Poles: 7 = pole12 (123456), 8 = pole23 (123456), 9 = pole34 (123456), 0 = pole45 (123456), A = pole56 (123456), B = pole61 (123456). Conclusion: 9B ∧ 8A ∧ 70 = 0. Proof. 9B ∧ 8A ∧ 70 expand
=
[780][9AB] − [70A][89B]
=
[721,345 823,145 045,213][934,651 A65,134 B61,534] −[712,546 054,612 A56,412][832,461 934,261 B61,324] ×
7,8,9,0,A,B
=
721,345 823,145 934,651 045,213 A65,134 B61,534 712,546 832,461 934,261 054,612 A56,412, B61,324
16 ([124][125][134]2[136][145]2 [146][235][245][346] ×[356]/[126]4[234]2 [456]2 ) ×{[126]4[135]4 [234]3 [245][346][456]3 −[123]3 [125][136][156]3[246]4 [345]4 }
conic
=
[123]3 [156]3 [246]3 [345]3 {[126][135][245][346] −[125][136][246][345]}
conic
=
0.
Algebraic Representation, Elimination and Expansion
119
B
1
6 7
A 5
2
0 8
4
3 9
Fig. 3. Example 3 Additional nondegeneracy conditions: ∃12345, ∃12346, ∃12456, ∃13456, ∃126, ∃234, ∃456. Here ∃126 denotes that 1, 2, 6 are not collinear. Explanation and discussion: (1) 9B ∧ 8A ∧ 70 has three different expansions. Any expansion leads leads essentially to the same proof. (2) The second step is choosing representations for all the points in the brackets before the batch elimination. In [780], the three points have essential points 11 , 22 , 31 , 41 , 51 , where the exponents denote the numbers of occurrences in the bracket. So any of the three points should use the five conic points in the representation, and for 0, since 2 occurs twice in [780], it should be used definitely, i.e., 0 = 045,213. For 7 and 8, the representation cannot be uniquely determined. In the above proof, the following are used: 7 = 721,345, 8 = 823,145. Same techniques apply to the other three brackets. (3) It is a big burden to compute all the 4 brackets in the third line of the proof. The following are two formulas established in [11], where all the points are on the same conic. [pole12,34 5 pole13,24 5 pole45,1 23 ] = −4 [1 24][125][134][135][14 5 ][14 5 ][234 ][234 ][235 ][235 ], [pole12,34 5 pole13,245 pole45,12 3 ] = −4 [124][125][134][13 5][14 5 ][145 ][2 3 4][234 ][235 ][235 ]. (6.28)
120
Hongbo Li
By the above formulas, we have [721,345 823,145 045,213] = −4 [124][125][134]2[135]2 [234][235][245]2 [934,651 A65,134 B61,534] = −4 [135]2[136][145]2 [146][346]2 [356][456] [712,546 054,612 A56,412] = −4 [125]2[145][146]2 [156][245][246]2[256] [832,461 934,261 B61,324] = −4 [123][124]2[134][136]2[236][246]2 [346] (4) In the third line, all the six points have changed their representations, so the second term is multiplied by the transformation coefficients k=
721,345 823,145 934,651 045,213 A65,134 B61,534 712,546 832,461 934,261 054,612 A56,412, B61,324
[3A1 ][3A2 ] [5B1 ][5B2 ] [5C1 ][5C2 ] [3D1 ][3D2 ] [3E1 ][3E2 ] [5F1 ][5F2 ] , [6A1 ][6A2 ] [6B1 ][6B2 ] [2C1 ][2C2 ] [6D1 ][6D2 ] [2E1 ][2E2 ] [2F1 ][2F2 ] (6.29) where A1 , A2 is a partition of 1, 2, 4, 5 into two parts, so is D1 , D2 ; and C1 , C2 is a partition of 1, 3, 4, 6 into two parts, so is F1 , F2 ; and B1 , B2 is a partition of 1, 2, 3, 4 into two parts; and E1 , E2 is a partition of 1, 4, 5, 6 into two parts. In the above proof, the partitions are automatically chosen according to the representations of the poles. For example, =
721,345 [123][453] , =− 712,546 [126][456]
(6.30)
because the partition 12, 45 is already provided by the representations. Although this automatic partition is used in our implementation, the representation it provides is not necessarily the best. See items (7), (8) below. (5) The fourth step is a conic transformation [11]. Let p be a bracket polynomial which is neither contractible nor factorable in the polynomial ring of brackets. For any six conic points A, B, C, D, X, Y in p, if the transformation [XAB][XCD][YAC][YBD] = [XAC][XBD][YAB][YCD]
(6.31)
either reduces the number of terms of p, or makes it factorable in the polynomial ring of brackets, or makes it contractible, the transformation is called a conic transformation. In this example, the transformation is carried out to p = [126]4 [135]4 [234]3 [245][346][456]3 − [123]3 [125][136][156]3[246]4 [345]4 (6.32) as follows: Let T be the first term. Its square-free factors are p = [126][135][234][245][346][456]. The conic points with their degrees in p are 12 , 23 , 33 , 44 , 53 , 63 .
Algebraic Representation, Elimination and Expansion
121
Since 1 has the lowest degree, we select in p those brackets containing 1. They are b(1) = [126][135]. The remainder of b(1) in p is ¯b(1) = [234][245][346] [456]. 4 is the only conic point not in b(1). Both [234][456] and [245][346] are in ¯b(1). If we choose [234][456], then the transformation ([126][135][234][456])3 = ([123][156][246][345])3 changes T to [123]3 [126][135][156]3[245][246]3 [346][345]3 , which has common factors [123]3 [156]3 [246]3 [345]3 with the second term of p. After removing the factors, we get p = [126][135][245][346] − [125][136][246][345].
(6.33)
Another conic transformation changes p to 0. If we choose the other pair of brackets [245][346], then the order between the above two transformations is reversed. (6) The additional nondegeneracy conditions include all the point-conic nondegeneracy conditions required by the transformation rules, and the denominator obtained after the transformation rules are applied. (7) In (6.29), there is a lot of freedom in choosing the partitions – we do not need to follow the partitions provided by the representations. The following is the unique choice of partitions for the result to be a bracket polynomial instead of a rational bracket polynomial. [3A1 ][3A2 ] [3D1 ][3D2 ] [5C1 ][5C2 ] [5F1 ][5F2 ] [5B1 ][5B2 ] [3E1 ][3E2 ] [6A1 ][6A2 ] [6D1 ][6D2 ] [2C1 ][2C2 ] [2F1 ][2F2 ] [6B1 ][6B2 ] [2E1 ][2E2 ] [315][324] [314][325] [513][546] [514][536] [513][524] [315][346] . [615][624] [614][625] [213][246] [214][236] [613][624] [215][246] (6.34) How is this unique choice obtained? After eliminating 7, 8, 9, 0, A, B, we get
=
[124][125][134][136][145][146][245][346] {[134][135]4[145][234][235][245][346][356][456] −[123][124][125][136][146][156][236][246]4[256] k}.
(6.35)
Denote the bracket coefficient of k in (6.35) by c, denote the first term by c . There are two approaches to find the best representation of k. The first approach is to consider the brackets in c occurring in a unique manner in the
122
Hongbo Li
denominator of k. There are 4 such brackets: [153] [546] ∗ [123] [246] [135] [346] ∗ [125] −→ [125] [246] [135] [245] ∗ [136] −→ [136] [246]
[123] −→
[156] −→
[153] [156]
∗
[243] [246]
of type
5 2
of type
3 2
of type
5 6
of type
3 6
(6.36)
Then the other 4 ratios in k can be uniquely determined. The second approach is to consider the ratio k = c /c and prove that it is a representation of k. Start with the bracket with the highest degree in the denominator (or numerator) of k . Distribute it among the brackets in the numerator (or denominator) of k to make ratios of types 3/6, 5/2, 5/6, 3/2. Then proceed to the brackets of lower degree in the denominator (or numerator). In this example, starting with [246]4 (or [135]4 ), we get the same pairing as in (6.36). (8) By reducing the number of changes in the representations, we can reduce the number of additional nondegeneracy conditions. For example, according to (6.28), we only need to change two representations instead of six: [9BC] = [721,345 823,145 045,261][934,612 A65,134 B61,534] −[712,534 054,612 A56,412][832,461 934,261 B61,345]
823,145 A65,134 832,461 A56,412
= 16 [124][125][134]2[135]2 [136][145]2 [146][235][245][246]2 [346][356]{[123][156][245][346] − [125][136][234][456]} conic
= 0.
Additional nondegeneracy conditions: ∃12345, ∃12346, ∃12456, ∃13456. The techniques suggested by items (7), (8) are not yet implemented.
References [1] M. Barnabei, A. Brini, G.-C. Rota. On the Exterior Calculus of Invariant Theory. J. Algebra, 1985, 96: 120–160. 106, 108 [2] R. Bix. Conics and Cubics. Springer, 1998. [3] J. Bokowski and B. Sturmfels. Computational Synthetic Geometry. LNM 1355, Springer, Berlin, Heidelberg. 1989. 106 [4] S. C. Chou. Mechanical Geometry Theorem Proving. D. Reidel, Dordrecht, 1988.
Algebraic Representation, Elimination and Expansion
123
[5] S. C. Chou, X. S. Gao and J. Z. Zhang. Machine Proofs in Geometry—Automated Production of Readable Proofs for Geometric Theorems. World Scientific, Singapore, 1994. [6] H. Crapo and J. Richter-Gebert. Automatic Proving of Geometric Theorems, in: Invariant Methods in Discrete and Computational Geometry, N. White (ed.), Kluwer Academic Publishers, 1994, 107–139. 106 [7] P. Doubilet, G. C. Rota and J. Stein. On the Foundations of Combinatorial Theory IX: Combinatorial Methods in Invariant Theory, Stud. Appl. Math., 1974, 57, 185– 216. 106, 108 [8] X. S. Gao and D. Wang. Mathematics Mechanization and Applications. Academic Press, London, 2000. [9] H. Li and Y. Wu. Automated Theorem Proving with Bracket Algebra in Projective Geometry. In Computer Mathematics, X. S. Gao and D. Wang (eds.), World Scientific, Singapore, 2000, pp. 120–129. 106 [10] H. Li and Y. Wu. Automated Short Proof Generation for Projective Geometric Theorems with Cayley and Bracket Algebras, I. Incidence Geometry. J. of Symbolic Computation, to appear. 106, 107, 115 [11] H. Li and Y. Wu. Automated Short Proof Generation for Projective Geometric Theorems with Cayley and Bracket Algebras, II. Conic Geometry. J. of Symbolic Computation, to appear. 106, 107, 111, 113, 116, 119, 120 [12] H. Li and Y. Wu. Automated Theorem Proving in Affine Geometry with Cayley and Bracket Algebras, preprint. 106, 108 [13] B. Mourrain. New Aspects of Geometrical Calculus with Invariants. Advances in Mathematics, to appear. Also in MEGA 91, 1991. 106 [14] J. Richter-Gebert. Mechanical Theorem Proving in Projective Geometry. Annals of Math. and Artificial Intelligence, 1995, 13, 159–171. 106 [15] J. Richter-Gebert. Realization Spaces of Polytopes. LNM 1643, Springer, Berlin, Heidelberg. 1996. 106 [16] B. Sturmfels. Computational Algebraic Geometry of Projective Configurations. J. Symbolic Computation, 1991, 11, 595–618. 106 [17] B. Sturmfels. Algorithms in Invariant Theory. Springer, New York, 1993. 106, 107, 108 [18] B. Sturmfels and W. Whiteley. On the Synthetic Factorization of Homogeneous Invariants. J. Symbolic Computation, 1991, 11, 439–454. 106 [19] D. Wang. Elimination Methods. Springer, Wien, New York, 2001. [20] N. White. The Bracket Ring of Combinatorial Geometry I. Trans. Amer. Math. Soc., 1975, 202, 79–103. 106, 108 [21] N. White. Multilinear Cayley Factorization. J. Symb. Comput., 1991, 11, 421–438. 106, 107 [22] T. McMillan and N. White. The Dotted Straightening Algorithm. J. Symb. Comput., 1991, 11: 471–482. [23] W. Whiteley. Invariant Computations for Analytic Projective Geometry. J. Symb. Comput., 1991, 11: 549–578. 106 [24] W. T. Wu. Mathematics Mechanization. Science Press/Kluwer Academic, Beijing 2000.
The Nonsolvability by Radicals of Generic 3-connected Planar Graphs John C. Owen1 and Steve C. Power2 1
D-Cubed Ltd., Park House, Cambridge CB3 0DU, UK [email protected] 2 Department of Mathematics and Statistics, Lancaster University, Lancaster LA1 4YF, UK [email protected]
Abstract. We give a theorem which is of significance with respect to the existence of fast algebraic methods for the solution of planar CAD diagrams. By an algebraic method we mean a solution scheme for a family of generically dimensioned graphs which rests on the usual operations of arithmetic together with arbitrary root extraction. The result establishes the non-existence of any such algebraic method whenever the family includes an induced planar graph which is 3-connected.
1
Introduction
A fundamental problem in Computer Aided Design (CAD) is the formulation of effective approximation schemes or algebraic algorithms which solve for the location of points on a plane, given a set of relative separations (dimensions) between them. For CAD applications, an important class of configurations concerns those for which the dimensions are just sufficient to ensure that the points are located rigidly with respect to one another. Moreover these configurations are known to be determined in terms of graph structure in that their underlying (undimensioned) graphs must be maximally independent in the sense of Definition 1. A number of algebraic and numerical methods have been proposed for solving these configurations (Owen [9], Bouma et al [2], Light and Gossard [8]) and these have been successfully implemented in CAD programs. The algebraic methods, which are particularly fast and stable, assemble the solution for complete configurations from the solutions of rigid subcomponents and the assembly process involves only rigid body transformations and the solution of quadratic equations. The simplest subcomponent is a triangle of points and this is solvable by quadratic equations. All the other rigid subcomponents in this process are represented by graphs which are 3-connected (in the usual sense of vertex 3-connected [12]) and so the problem of solving any general configuration is reduced to the problem of solving just those subconfigurations which are represented by 3-connected graphs. We have previously suggested that with generic dimension values a subcomponent which is represented by a 3-connected graph cannot be solved by F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 124–131, 2004. c Springer-Verlag Berlin Heidelberg 2004
The Nonsolvability by Radicals of Generic 3-connected Planar Graphs
125
Fig. 1. The Doublet
quadratic equations (Owen [9]). This would mean that for generic dimensions the existing algebraic methods in fact solve all configurations which can be solved by quadratic equations and these are precisely the ”reducible-to-triangles” configurations. These configurations are also known as ”ruler and compass constructible” and Gao and Chou [5] have given a procedure for determining in principle if any given configuration is ruler and compass constructible. However their analysis is based on the detail of derived elimination equations and they do not address the problem of solvability for general classes of graphs as we do here. We propose to strengthen the suggestion above to the following conjecture: Conjecture. A generic configuration of dimensioned points on the plane whose graph is 3-connected is not solvable by radicals. If the conjecture is true this would mean that a generic configuration either has all its solutions in quadratic extensions or that all of its solutions are nonradical. In particular the current algorithms for the quadratically solvable graphs already solve all generic configurations which can be solved by radicals. We have proved the conjecture for the class of graphs which have a planar embedding. For this class we establish a reduction scheme in which we can prove that the solution to any rigid 3-connected graph with a planar embedding leads to the solution of the single smallest rigid 3-connected planar graph shown in Figure 1. We call this graph the doublet. We then use the Maple mathematical software package to show that there are certain integral dimension values for which the doublet has non-radical roots. The proof scheme is both lengthy and eclectic, drawing on new and known results from graph theory, algebraic geometry and Galois theory. In this article we will give an outline of the main ideas and state some of the relevant theorems, the proofs of which will appear elsewhere.
2
Generic Rigid Graphs
In this section we give some results which apply to all generic rigid graphs. We begin with some definitions which give precise meanings to the terms generic and rigid. There is a close connection between our formalism and that
126
John C. Owen and Steve C. Power
of the theory of rigid frameworks (see Whiteley [13] and Asimow and Roth [1]) and in particular the notion of an independent graph is taken from this context. Definition 1. Let G be a graph with vertex set V (G) and nonempty edge set E(G). Then G is independent if 2|V (G)|−|E(G)| ≥ 3 and if this inequality holds for every vertex induced subgraph of G. The graph G is maximally independent if G is independent and 2|V (G)| − |E(G)| = 3. Definition 2. Let G be a maximally independent graph with a selected base edge b. A (real) normalised dimension set for G is a set of non-negative (real) numbers {de : e ∈ E(G)} for which there is a map φ : V (G) → IR2 such that db = 1 and de = ||φ(v) − φ(w)||22 for each edge e = (vw) of G. A dimension set is generic if {de : e ∈ E(G), e = b} consists of algebraically independent transcendentals. We write fe for the polynomial ||φ(v) − φ(w)||22 − de and refer to the set of equations {f } = {fe = 0} as the constraint equations for the given dimension set. We are interested in the realisations φ : V (G) → IR2 , normalised so that the vertices of b map to (0, 0) and (1, 0), and in determining the algebraic properties of the real coordinates (xi , yi ) of the points φ(vi ) in terms of the given dimensions. However to gain the appropriate perspective on the proper notion of rigidity it is convenient to embrace the complex number field at the outset, as we do in the next definition. Note in particular the distinction between ”real rigid” and ”complex rigid” (which we prefer to call zero dimensional) in the instructive example discussed after Theorem 4. We introduce complex coordinates (xi , yi ), 1 ≤ i ≤ n, for the vertices which do not lie on the base edge, where n = |V (G)| − 2, and the constraint equations are viewed as complex polynomial equations in these variables. The common zeros of these polynomials determine the complex affine variety V ({f }). Each zero can be thought of as corresponding to a complex realisation φ : V (G) → C2 of the dimensioned graph. We also refer to points of V ({f }) as roots, particularly when they are known to be isolated. Definition 3. Let G be a maximally independent graph. A normalised dimension set {de } for G is said to be zero dimensional if the complex affine variety V ({f }) of the corresponding constraint equations is a finite, non-empty set. As a useful shorthand, we describe a dimensioned graph as a generic graph if its dimension set is generic and we say that a dimensioned graph is zero dimensional if the corresponding variety is zero dimensional. The next theorem shows that generic graphs have dimension zero when the graph is maximally independent. In contrast, we can clearly choose non-generic nonzero dimensions for the (maximally independent) doublet which realise it as a flexible (and therefore non-zero dimensional) parallelogram. Theorem 1. Every generically dimensioned maximally independent graph has a complex affine variety with dimension zero.
The Nonsolvability by Radicals of Generic 3-connected Planar Graphs
127
Proof sketch : Let G be a maximally independent graph. Laman [7] proves that G has a normalised real dimension set which is infinitesimally rigid. It follows immediately that every generic set of position coordinates is infinitesimally rigid (Whiteley [13]) and from this it can be shown that the generically dimensioned graph has dimension zero [1]. Definition 4. A point (x1 , y1 , x2 , y2 , . . . , xn , yn ) of the zero dimensional variety V ({f }) is non-radical if at least one of its coordinates fails to lie in a radical extension field of the field Q({de }). We can now state the following significant theorem which applies to any graph. Theorem 2. Let {f } be a set of constraint equations for the generic dimension set {de } = {d1 , ..., dr } (where r = |E(G)| − 1) and let Vb ⊆ C2n+r be the variety determined by the constraint equations as polynomial functions belonging to Q[d1 , ..., dr , x1 , ..., xn , y1 , ..., yn ]. Then Vb is irreducible. Proof: The theorem follows since the big variety Vb is defined parametrically by the variables xi , yi . (See [6].) The following theorem shows that the zeros of the variety V ({f }) bear an analogy with the roots of an irreducible univariate polynomial over Q. Theorem 3. Let V ({f }) be the complex affine variety of the constraint equations of a maximally independent graph. If V ({f }) has a non-radical root then all its roots are non-radical. Proof sketch: Since V ({f }) has dimension zero it can be shown that each of the coordinates of a point in the variety is the root of a single polynomial, say g = gi (xi ). This polynomial can be taken to be a generator of the elimination ideal for the variable. Since the big variety Vb is irreducible it can be shown that the polynomial gi is irreducible over the ring Q[{de }, xi ] and therefore over the field Q({de })[xi ]. ¿From elementary Galois theory (see Stewart [11]) we conclude that if one root of the irreducible polynomial gi is non-radical over Q({de }) then all roots are non-radical. The theorem follows because if V ({f }) has a nonradical root at least one of these polynomials for the coordinates xi , yi has a non-radical root.
3
Specialisation
In order to develop a reduction scheme for an (infinite) class of 3-connected graphs we effectively reduce the size of a graph by selecting certain special values for some of the dimensions. This is known as a specialisation [6]. In the next
128
John C. Owen and Steve C. Power
Fig. 2. Specialisation of a quadratically solvable graph onto a doublet section we describe such a scheme for planar graphs based on the existence of edge contractions in the graph which preserve maximal independence and 3connectedness. Let us refer to such contractions as admissable edge contractions. Such a contraction, of an edge f say, suggests a specialisation {de } → {de }, for the dimensions of the uncontracted graph, in which df = 0 together with some resulting equalities of dimensions. The following theorem allows us to make deductions about the generic graph from the properties of a specialised version of the graph. In conjuction with Theorem 6 it provides the inductive step for the proof of the main theorem. Theorem 4. Let V ({fe }) be the variety for the generic constraint equations {fe } for a maximally independent graph. Let V ({fe }) be the variety for the constraint equations arising from a specialisation {de } → {de } associated with an admissable edge contraction. If V ({fe }) has dimension zero and is non-radical over Q({d }) then V ({fe }) is non radical over Q({d}). The proof of this theorem [10] is lengthy involving algebraic geometry and Galois theory. The theorem allows us to conclude that a generic configuration is non-radical if a certain specialised configuration is non-radical. The vital point here is that the specialised configuration must have dimension zero over the complex numbers. It is perfectly possible for a configuration which is generically quadratically solvable to have non-radical solutions for certain specialisations if we relax the requirement of dimension zero. This is illustrated in Figure 2 which indicates a realisation of a ruler and compass constructible graph onto the doublet which (as we see below) may give a non-radical root. Although this root is isolated when the coordinates are constrained to be real, the complex variety V ({fe }) does not have dimension zero. Figuratively speaking, ”real rigidity” is considerably weaker than ”complex rigidity”. Proving that the specialised configuration has dimension zero is an essential constraint in the application of Theorem 4. In fact the Galois theory component of the proof of Theorem 4 can be isolated as in the Galois group specialisation theorem that we state below. (In [10] we use a more general form.) The theorem asserts that on specialising the coefficients of a polynomial the Galois group of the new polynomial, now with respect to
The Nonsolvability by Radicals of Generic 3-connected Planar Graphs
129
a specialised coefficient field, is simply a subgroup of the original Galois group. In particular since subgroups of soluble groups are soluble it follows that if the specialised polynomial is a non-radical polynomial then the original polynomial is also non-radical. We could not find a reference for this seemingly classical theorem of Galois theory. Theorem 5. Let d = {d1 , . . . , dn } be algebraically independent variables with the rational field extension Q(d) and let d = {d1 , . . . , dn } be an n-tuple of rationals, viewed as a specialisation of d. Let p ∈ Q[d][t] be a polynomial with Galois group Gal(p) over the field Q(d)[t] and let p be the specialised polynomial with Galois group Gal(p ) over Q. Then Gal(p ) is a subgroup of Gal(p).
4
On the Proof For Planar Graphs
We now focus on planar graphs by which we mean graphs which have a planar embedding in the usual graph theory sense (Diestel [3]). These determine an infinite subset of all 3-connected rigid graphs The next theorem uses the idea of edge contraction in a graph [3], [12] and is used in tandem with the specialisation theorems above. However in order to preserve zero dimensionality it is essential that the graphs arising in the reduction sequence are once again maximally independent. If an edge e of a graph G joins vertices x and y then contracting the edge e gives a new graph G\e, with |V (G\e)| = |V (G)| − 1. This is done by deleting the edge e, combining vertices x and y and merging any duplicated edges. If e lies in exactly one 3-cycle of G then |E(G\e)| = |E(G)| − 2. In this case G\e is maximally independent whenever G is maximally independent provided only that G\e is independent. It turns out that by restricting to planar graphs we can be sure that such a 3-cycle exists. Moreover we are able to obtain the following key theorem (the proof of which is lengthy). Theorem 6. Every 3-connected, maximally independent, planar graph G with |V (G)| > 6 has either (i) an edge on exactly one 3-cycle which can be contracted to give a 3-connected, maximally independent, planar graph with |V (G)| − 1 vertices, or (ii) a vertex induced subgraph which is maximally independent with three vertices of attachment and at least one internal vertex. This theorem allows us to generate a sequence of 3-connected maximally independent, planar graphs which terminates in the doublet graph shown in Figure 1. In case (i) the next graph in the sequence is obtained by contracting the edge. In case (ii) of the theorem the vertex induced subgraph is replaced by a 3-cycle to generate a smaller maximally independent graph in the sequence. In order to connect this sequence with the solvability by radicals of the corresponding algebraic variety we note that contracting an edge in a 3-cycle corresponds to setting the dimension value on the contracted edge to zero and specifying that the dimension values on the other two edges in the 3-cycle are equal. Thus we have the following unduction step:
130
John C. Owen and Steve C. Power
generic G\e non-radical ⇒ specialised G non-radical ⇒ generic G non-radical The first implication results from elementary variety comparison (whilst the graph theory is deep). The second implication is guaranteed by Theorem 4. The non-solvability by radicals of generic, 3-connected planar graphs now follows from the existence of a non-radical root for any specialised instance of the doublet graph which has dimension zero. This final step is resolved in the following theorem. Theorem 7. There exists an integral dimensioned doublet graph which is not solvable by radicals. A family of dimensions giving such a non-soluble doublet has (unsquared) lengths on the triangles of 10, 13, 13 and 8, 5, 5 and connecting edges of length 15, 1 and 16. (The edges of length 13, 5 and 1 are the interior edges in the planar embedding of the doublet shown in Figure 1.) Our first proof of the existence of this nonradical doublet used resultants to generate a univariate polynomial in an elimination ideal for a single variable. Despite the smallness of the graph, this polynomial has degree 28 and large integer coeficients (typically 13 digits long). Whilst we were unable to determine the Galois group of such polynomials in general, for the special values given the degree 28 polynomial factors into two degree 8 polynomials and two degree 6 polynomials. Maple determines the Galois group for each of these polynomials as a non-soluble group.
References [1] Asimow L. and Roth B., The Rigidity of Graphs, Trans. Amer. Math. Soc., 245 279-289 (1978) 126, 127 [2] Bouma W., Fudos I., Hoffmann C., Cai J., Paige R. A geometric constraint solver, Computer Aided Design 27 487-501 (1995) 124 [3] Diestel R., Graph Theory Springer-Verlag (1997) 129 [4] Cox D. Little J. O’Shea D., Ideals, Varieties and Algorithms, Springer-Verlag (1992) [5] Gao, X.-S., Chou, S.-C., Solving geometric constraint systems I & II., J. CAD (to appear) 125 [6] Hodge W. V. D., Pedoe D., Methods of Algebraic Geometry Volume 2, Cambridge University Press (1952) 127 [7] Laman G. On graphs and the rigidity of plane skeletal structures, J. Engineering Mathematics, 4 331-340 (1970) 127 [8] Light R. and Gossard D., Modification of geometric models through variational constraints, Computer Aided Design 14 209 (1982) 124 [9] Owen J. C. Algebraic solution for geometry from dimensional constraints, in ACM Symposium on Foundations in Solid Modeling, pages 397-407, Austin, Texas (1991) 124, 125 [10] Owen J. C. and Power, S. C., Generic 3-connected planar constraint systems are not soluble by radicals. 128
The Nonsolvability by Radicals of Generic 3-connected Planar Graphs
131
[11] Stewart I., Galois Theory, Chapman and Hall (1973) 127 [12] Tutte W. T., Graph Theory, Addison-Wesley (1984) 124, 129 [13] Whiteley W. in Matroid Applications ed. N. White, Encyclodedia of Mathematics and its applications 40 1-51 (1992) 126, 127
Function-Based Shape Modeling: Mathematical Framework and Specialized Language Alexander Pasko1 and Valery Adzhiev2 Hosei University, Tokyo, Japan [email protected] 2 Bournemouth University, Poole, UK [email protected] 1
Abstract. In this survey, we describe the following different aspects of modeling multidimensional point sets (shapes) using real-valued functions of several variables: algebraic system as a formal framework; representation of shapes, operations, and relations using real-valued functions, internal representation of the modeling system; specialized language for function-based modeling, and model extension to point sets with attributes (hypervolumes).
1
Introduction
Description of a point set (shape) by a single real-valued function of point coordinates is a traditional problem of analytical geometry. Note that the direct problem of analytical geometry concerns the analysis of the shape for the given analytical expression. The most well studied shapes are algebraic surfaces given as zero sets of quadratic polynomials. The inverse problem of analytical geometry is to find an analytical description for the given shape. This problem statement can be extended to algorithmic definitions of functions and to multidimensional point sets. Thus, the subject of this paper is computer-aided modelling of multidimensional shapes using real-valued functions of several variables. The idea of using a single real-valued function of three variables in computer-aided geometric modelling to define an arbitrary complex solid by a single continuous function of point coordinates and the object surface as a zero set of such a function (socalled implicit surface) has been exploited in solid modelling and in computer graphics (see Related works). There existed several research results on applying implicit surfaces to solve such important problems of computer-aided geometric design and animation as blending, offsetting, collision detection, and metamorphosis. However, by early 1990-s these models were not seriously considered in the area of solid modelling concentrated on such models as the boundary representation (BRep) based on parametric surface patches and Constructive Solid Geometry (CSG) based on settheoretic operations [1]. The other separate area with similar models and algorithms was volume graphics using discrete scalar fields (voxel objects). A unifying representation was necessary to overcome the separation between relative models, to fully F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 132-160, 2004. Springer-Verlag Berlin Heidelberg 2004
Function-Based Shape Modeling
133
exploit the potential of the shape representation by a single function, and to extend it to time-dependent and other multidimensional shapes. In this survey, we describe the mathematical framework of the unifying function representation (FRep), give examples of some non-traditional primitives and operations, and describe the modelling system design including the internal representation and the specialized high-level modelling language.
2
Related Works
The idea of using a single real-valued function of three variables in computer-aided geometric modelling to define an arbitrary constructive solid as f ( x, y , z ) ≥ 0 and its surface as a zero set f ( x, y , z ) = 0 (so-called implicit surface) was expressed independently by Rvachev [2, 3, 4] and Ricci [5]. Both authors have introduced analytical expressions for set-theoretic operations. Ricci proposed using C1 discontinuous min/max operations for exact descriptions and also approximate descriptions for getting smooth blending properties of the resulting surfaces. The work by Rvachev provided much more general approach called the theory of R-functions and introduced Ck continuous functions for the exact description of set-theoretic operations. We provide more details in the corresponding section. The approach to modelling complex objects using a single real-valued function was exploited in computer graphics for describing skeleton-based implicit surfaces such as blobby models [6] and other models presented in the book [7]. The advantages of this approach are simple point membership classification, natural blending of shapes, conceptually simple algorithms for such problems as collision detection or metamorphosis. These advantages have motivated several research groups in solid modelling and computer graphics to do systematic research and to develop special software systems supporting this modelling paradigm. In the solid modeling area, Constructive Solid Geometry (CSG) systems are traditionally based on solid primitives bounded by implicit surfaces. For example, the SVLIS modeling system [8] is based on CSG and allows for applying different algebraic operations to the defining functions of primitives. The only serious restriction is that such operations are not allowed on the level of set-theoretic solids, which means the single function representation is supported only on the level of primitives and their algebraic compositions. Applications of the theory of R-functions in different areas of solid modeling and mechanical design are considered by Shapiro [9, 10]. For example, the interactive system SAGE [11] is oriented towards solving numerical simulation problems on the base of the models built using R-functions and without finite-element mesh generation. The FRep model presented in this survey also has R-functions as the basic mathematical technique, which was used to generalize existing models and operations and to develop original ones. Following the introduction of FRep, in computer graphics, a BlobTree model was introduced in [12] to unify skeleton-based implicit models with CSG and global deformations. The models supported by SVLIS and BlobTree systems are subsets of FRep with the mentioned above restrictions allowing for more efficient performing on some application operations such
134
Alexander Pasko and Valery Adzhiev
as polygonization or ray-casting. The HyperFun language [13] presented in this paper fully supports FRep and thus allows for the construction of more broader spectrum of functionally defined shapes.
3
Algebraic System
The geometric concepts of the function representation (FRep) [14, 15] can be presented as an algebraic system
(M , Φ,W ) where M is a set of geometric objects, Φ is a set of geometric operations, and W is a set of relations for the set of objects. Here, we characterize the elements of the algebraic system, and the next section provides details on the representation of them using real-valued functions. We consider geometric objects as closed subsets of n-dimensional Euclidean space E n with the definition
f (x1 , x 2 ,..., x n ) ≥ 0 where f is a real continuous function defined on E n . We call f a defining function. The inequality is called a function representation (or F-rep) of a geometric object. The function can be defined analytically, or with a function evaluation algorithm, or with tabulated values and an appropriate interpolation procedure. The major requirement to the function is to have at least C0 continuity. The above inequality defines a closed ndimensional object in E n space with the following characteristics: f(X) > 0 - for points inside the object; f(X) = 0 - for points on the object's boundary; f(X) < 0 - for points outside the object,
where X = (x1 , x 2 ,..., x n ) is a point in E n . In the three-dimensional case, the boundary of such an object is usually so-called an "implicit surface". We should note that the use of the term “implicit surface” here can be considered a historical accident. The considered objects in 3D space are defined by explicit functions of three variables f(x,y,z) with zero-value isosurfaces f(x,y,z)=0 as boundaries. This definition has nothing in common with implicit functions of two variables except the visual form of the equation f(x,y,z)=0 used in the latter case to implicitly define, for example, z variable as a function of variables x and y. Two major types of elements of the set M are simple geometric objects (primitives) and complex geometric objects. Each geometric primitive is described by a concrete type of a function chosen from the finite set of such types. A complex geometric object is a result of operations on primitives. In general, geometric objects defined by the above inequality are not regularized solids required in CSG. Applying operations to an object can result in zero values of the defining function not only on the boundary, but also inside the object. An object can also have a boundary with dangling portions that
Function-Based Shape Modeling
135
are not adjacent to the interior. If it is necessary to provide Frep for objects of lower dimension in the given space, the main idea is that the function f(X) has to take zero values only at the points of this object and be negative everywhere else. The set of geometric operations Φ includes unary, binary, and k-ary operations closed on the object representation: Φ i : M1 + M 2 + ... + M n → M where n is a number of operands of an operation. The result of an operation is also an object from the set M that ensures the closure property of FRep. Let object G1 have the definition f1 (X) ≥ 0 . The term "unary operation" on the object G1 means the operation G 2 = Φ i (G1 ) with the definition f 2 = Ψ (f1 (X)) ≥ 0 , where Ψ is a continuous real function of one variable. The binary operation on objects G1 and G 2 means the operation G 3 = Φ i (G1 , G 2 ) with the definition f 3 = Ψ (f1 (X),f 2 (X)) ≥ 0 , where Ψ is a continuous real function of two variables. Relations can be considered subsets of the Cartesian product of the set M on itself. Relations are defined on the set of objects using predicates. For example, a binary relation is a subset of the set M2 = M × M. It can be defined by a predicate S: M × M → I, where I is a set of integer values corresponding to some k-valued logic.
4
FRep Components
In this section, we discuss specifics of the algebraic system elements, namely, objects, operations, and relations, and provide detailed examples for some of them. 4.1
Objects
A primitive is considered a "black box" with the defining function given by a known function evaluation procedure. A complex object can be constructed by applying different operations to primitive objects. An FRep modeling system can support different types of primitives from simple to relatively complex ones: • • • • • • •
algebraic solids expressed in terms of polynomials (sphere, superellipsoid, torus, etc.); voxel (discrete scalar field) data with trilinear or higher order interpolation; skeleton-based “implicits”: blobby, soft, metaballs, and convolution objects [7, 16]; solid noise and extruded noise [17, 18]; two-dimensional polygons converted to FRep (see 3.1.1); bivariate parametric patches and trivariate parametric volumes (see 3.1.2); objects reconstructed from scattered surface points or from the series of crosssections using radial-basis functions [19].
136
Alexander Pasko and Valery Adzhiev
The possibility should be given to the system developer or the user to extend this set of primitives by providing an analytical or procedural description of a primitive. This flexibility is one of the major advantages of an FRep based shape modeling system. We give here examples of two types of primitives illustrating connections between FRep and other representations: “implicit” polygons illustrating boundary-to-function conversion in 2D case, and “implicit” curves and surfaces defined using parametric patches and volumes. 4.1.1 “Implicit” Polygons
An arbitrary 2D polygon (convex or concave) can be represented by a real function f(x,y) taking zero value at polygon edges. The polygon-to-function conversion problem is stated as follows. A two-dimensional simple polygon is bounded by a finite set of segments. The segments are the edges and their extremes are the vertices of the polygon. A polygon is simple if there is no pair of nonadjacent edges sharing a point, and convex if its interior is a convex set. The polygon-to-function conversion algorithm should satisfy the following requirements: • • •
It should provide an exact polygon boundary description as the zero set of a real-valued function; No points with zero function value should exist inside or outside of the polygon; It should allow for the processing of any arbitrary simple polygon without any additional information.
Rvachev [3] proposed representing a concave polygon with a set-theoretic formula where each of the supporting half-planes appears exactly once and no additional halfplane is used. It is illustrated in Fig. 1. A counter-clockwise ordered sequence of coordinates of polygon vertices A1(x1, y1), A2(x2, y2),..., An(xn, yn) serves as the input. Also, coordinates are assigned to a point An+1(xn+1,yn+1) coincident with A1(x1,y1). It is obvious that the equation fi ≡ − x(yi + 1 − yi ) + y(xi + 1 − xi ) − xi + 1yi + xiyi + 1 = 0
defines a line passing through the points Ai(xi,yi) and Ai+1(xi+1, yi+1); fi is a function positive in an open region Ωi+ and negative in an open region Ωi− located respectively to the left and to the right of the line. When the region Ω + is bounded by a convex polygon, it can be given by the logical formula Ω + = Ω1+ I Ω +2 I ... I Ω +n .
If Ω + is an external region of a convex polygon, then Ω + = Ω1+ U Ω +2 U ... U Ω +n .
Function-Based Shape Modeling
a
137
b
Fig. 1. Polygon-to-function conversion: a) concave polygon; b) tree structure representing the monotone set-theoretic formula
Let us consider the concave polygon shown in Fig. 1a and a tree representing its monotone formula in Fig. 1b. Actually, the approach to the monotone formula construction is similar to the convex decomposition discussed in the previous section. Note that in the tree in Fig. 1b, the convex polygon A1A2 A10A11 is a root (level 0), the polygon A2 A6A10 is level 1, and the polygons A3A4A5 and A7A8A9 are level 2. The internal region Ω + of the initial polygon is defined by the following formula: + + Ω + = Ω1+ I ( Ω +2 U ( Ω 3+ I Ω +4 ) U Ω5+ U Ω6+ U ( Ω 7+ I Ω8+ ) U Ω 9+ ) I Ω10 I Ω11
This formula is especially nice in that each region is present in it only once. It is worth to emphasize that the set-theoretic operation applied to a region is determined by the tree level to which this region belongs. Because Ω +2 ≡ Ω5+ and Ω6+ ≡ Ω 9+ (see Fig. 1a), it can be simplified as follows:
)
+ + Ω + = Ω1+ I ( Ω 2+ U ( Ω 3+ I Ω +4 ) U Ω 6+ U ( Ω7+ I Ω8+ ) I Ω10 I Ω11 .
The final formula for the defining function is obtained by replacing the symbols Ωi+ by fi , symbol I by ∧ and symbol U by ∨ in the monotone formula. For our example (Fig. 1a), the defining function for the polygon is
F = f1 ∧ ( f 2 ∨ ( f 3 ∧ f 4 ) ∨ f 6 ∨ ( f 7 ∧ f 8 )) ∧ f10 ∧ f11 , where symbols ∧ and ∨ correspond to R-functions providing exact functional description for the results of intersection and union (see details in 4.2.1). In practice, the monotone formula construction results in a tree structure (see Fig. 1b). To evaluate the single defining function for the entire polygon at a given point, the algorithm traces the tree from the leaves to the root, evaluates the defining functions of half-planes and applies the corresponding R-functions to them. The conversion procedure is illustrated in Fig. 2 with an input concave polygon (Fig. 2a) and the defining function surface (Fig. 2b), where only positive values of the
138
Alexander Pasko and Valery Adzhiev
function (i.e., the points inside the polygon) are shown and the negative values outside the polygon are set to zero. Once the defining function for the given polygon is obtained, it can be used as other 2D primitives, for example, for modeling 3D objects by sweeping. Note that the similar conversion procedure for an arbitrary 3D polyhedron is still an open research problem.
a
b
Fig. 2. Example of an “implicit” polygon: a) initial concave polygon; b) depth data inside the polygon generated by the polygon-to-function conversion procedure
Fig. 3. Parametric function (B-spline) in the extended 3D space and the corresponding 2D solid in the 2D space
4.1.2 Parametric Patches and Volumes
Here, we discuss modeling of “implicit” 2D curves and 3D surfaces and solids using bivariate and trivariate parametric splines [20, 21]. Let us consider modeling of a 2D solid as it is shown in Fig. 3. The surface S is a B-spline (parametric) function. It is defined in the (x, y, ξ) space, where ξ = f(x, y). The 2D solid belongs to the (x, y) plane and is bounded by the zero-contour line of the surface with its inside part being the projection of the positive part of the 3D surface onto the plane. The surface is defined parametrically, then, by moving its control points vertically along the ξ axis, one can transform the corresponding 2D solid. A similar approach can be applied to define and to deform 3D solids using trivariate parametric splines. A trivariate spline is defined with 3-dimensional control points,
Function-Based Shape Modeling
139
i.e. the x, y and z coordinates. We use the FRep definition, where a solid is defined by its defining function f with the inequality f(x, y, z) ≥ 0, and its boundary is defined by the equality f(x, y, z) = 0. In the parameter space defined by {(x,y,z) : 0 ≤ (x,y,z) ≤ 1}, we assume that the x,y and z coordinates of the surface S(u,v,w) can be expressed as a i
j
k
x = , P y = and P z = , where P is a control point of the regular grid, i.e. Pijk ijk n l ijk m spline, and l,m,n are the number of control points on each axis. We add one more dimension to those points, the ξ coordinate, corresponding to the function value. Then, we define a 3D solid as f(x,y,z) = Sξ(u,v,w). Hence, we can modify the 3D solid by changing the ξ coordinate of control points of the trivariate spline. Bezier splines were used in [20] and B-splines in [21].
a
b
Fig. 4. Functional clipping for trivariate splines: (a) the unit cube, the desired solid inside it, and “ghost” solids outside; (b) the same solid after functional clipping
One undesirable property of Bezier splines and B-splines is that there is no control over the behaviour of the volume outside the unit cube domain. In order to overcome this, the functional clipping was introduced. Fig. 4a shows a solid based on a trivariate B-spline, which is bounded by the unit cube. The aim was to create a 3D solid inside that domain. As it can be observed, the behaviour of the parametric function outside the domain contradicts the requirement that there should be only negative values of a defining function for points outside the defined object. This results in undesirable (“ghost”) solids. Let S(u,v,w) be a function defining a trivariate spline where S(u,v,w) = Sξ(u,v,w). Consider the intersection between the unit cube and the 3D solid defined by the function:
S clip (u , v, w) = S (u , v, w) ∧ α Fs (u , v, w) where Fs(u,v,w) = Fb(u) & Fb(v) & Fb(w) is a defining function of the unit cube with Fb defining the unit strip by each variable:
Fb (t ) = (1 − t )t , and ∧ α is the symbol of the intersection operation defined by an R-function (see details in 3.2.1). The result of this procedure is illustrated in Fig. 4b. The defining function is negative outside the domain (no “ghosts”) and the desirable 3D solid is unchanged. The procedures defining spline based objects can encapsulate the functional clipping. This
140
Alexander Pasko and Valery Adzhiev
allows the user to consider such an object as a standard FRep primitive and to apply to it any operation provided by a modeling system. 4.2
Operations
There is a rich set of operations closed on FRep, i.e., resulting in a continuous realvalued function [15]. Unary operations can be classified as space mappings – transformations of point coordinates (affine transformations, standard deformations such as twisting, tapering, or bending, and feature-based nonlinear deformations), functions mappings – transformations of function values at given points (offsetting, solid sweeping [22], and projection [23]). Binary operations include set-theoretic operations (union, intersection, difference) and Cartesian product defined using R-functions (see 4.2.1), Minkowski operations [24], metamorphosis and others. Bounded blending operations (see 4.2.2) take three objects as arguments, thus illustrating k-ary operations in the FRep framework. Similar to primitives, the user of an FRep based modeling system should be able to introduce any desirable operation by its analytical or procedural description and thus extend the list of operations. As the combination of continuous shape models with the discrete logic based modeling is one of the key points in FRep, we would like to pay special attention to Rfunctions enabling this combination and to the bounded blending operation as one of applications of R-functions. 4.2.1 R-Functions and Set-Theoretic Operations
Following [2-4], we provide here informal description and analytical definitions of several systems of R-functions, and discuss application of them for describing complex geometric objects composed using set-theoretic operations. Informal Description of R-Functions
There are such functions whose some "quality" is completely defined by "qualities" of their arguments. The sign of the function is a typical example of such a “quality”. Given the following functions:
u1 = x1 ⋅ x2 ⋅ x3 ⋅ v( x1 , x2 , x3 ), (v > 0) u2 = x1 + x2 + x12 + x22 + x1 ⋅ x2 , we can observe that the signs of these functions are completely defined by signs of their arguments and do not depend on arguments values. Note, that "qualities" of arguments and the corresponding "quality" of a function can be different. But anyway, appropriate dependence remains. Such functions are called "R-functions". If mentioned "qualities" are enumerated in some way, then there is correspondence between any set of "qualities" and a set of their numbers. So, by introducing some R-function, we simultaneously define the rule which gives some "quality" of Rfunction for any such set and therefore the number of this "quality". This means that there is some logic function matching the R-function with the same number of arguments. Therefore, there is a deep coupling between R-functions and the logic functions
Function-Based Shape Modeling
141
that allow for adaptation of the methods inherent in discrete mathematics to classical continuous analysis. The subject of a special interest is real continuous R-functions and also R-functions with Cm continuity. R-functions belonging to certain defining systems and being built with help of special techniques can have the particular differential and metric properties which can be useful in some applications. Defining Functions of Geometric Objects
The property of R-functions to inherit and maintain such a quality of their arguments as signs is used in description of complex geometric objects being created from more simple objects using operations defined by R-functions. The geometric interpretation of logic functions is well-known and is widely used in classification of space points in relative to geometric objects (which are considered as points sets). Euler Circles (or Venn Diagrams) can serve as a visual illustration of it. Suppose we have a set of geometric objects and each of them is given using the inequality of the form f i ≥ 0, where f i = f i (x 1 , x 2 ,..., x k ) is a continuous realvalued function taking positive values at the points inside the object Gi, and zero values at the boundary points of Gi. Let us introduce 3-valued predicates associated with each of fi and accordingly which each of geometric objects Gi :
0, f i < 0 S 3 ( f i ) = 1, f i = 0 2, f > 0 i To define a new more complex geometric object G as a result of some set-theoretic operations on initial geometric objects {Gi}, let us introduce the following predicate equation built on the base of 3-valued logic:
F [S3 ( f1 ), S3 ( f 2 ),..., S3 ( f m )] = A, where F is a certain 3-valued logic function, and A = { 0, 1, 2 }. It is required to define the continuous function fm+1 ( f1 , f2 , ..., fm), which will define the resulting object G. This function is such that
S 3 ( f m +1 ( f1 , f 2 ,..., f m )) = F [S3 ( f 1 ), S 3 ( f 2 ),..., S3 ( f m )] The process of constructing the defining function f consist of the following steps: – – –
representing F as a composition (superposition) of basic 3-valued logic functions ( disjunction, conjunction, inversion or complement, and so on ); performing the formal replacement of logic functions symbols by symbols of the corresponding R-functions; performing the formal replacement of ‘ S 3 ( f i ) ' symbols by ' f i '.
After the final step, the defining function fm+1 is specified.
142
Alexander Pasko and Valery Adzhiev
The proper choice of F from a set of 3-valued logic functions guarantees that the predicate equations F = 0, F = 1, F = 2 are equivalent to inequalities f < 0, f = 0, f > 0 and a geometric object with f = 0 includes only boundary points and does not include internal points. Note, that R-function can describe both "algebraic" (that is traditional) geometric objects and "semi-algebraic" ones. It is important that a semi-algebraic object is represented with help of R-functions in the form of a single inequality. Usually such an object (e.g., a rectangle) is represented as a system of equations and inequalities. In principle, the geometric object description is ambiguous as there can be an infinite set of defining functions for the same object. This lets us create defining functions with certain additional properties. In particular, even for semi-algebraic objects, smooth defining functions can be constructed: in particular, such sharp edged object as rectangle can be represented as a result of intersection of a smooth surface with a plane). This is important for computer-based applications (in particular, for visualization). An object resulting from set-theoretic operations can be described by the following defining functions: f 3 = f1 ∨ α f 2 for the union;
f 3 = f1 ∧ α f 2 f 3 = f1 \ α f 2
for the intersection; for the subtraction,
where f1 and f 2 are defining functions of initial objects and
∨ α ,∧ α ,\ α are signs of
R-functions. Of all the possible descriptions of the R-functions, we use the following analytical formulae:
1 ( f1 + f 2 + 1+α 1 f1 ∧α f 2 = ( f1 + f 2 − 1+α f1 ∨ α f 2 =
f 12 + f 22 − 2αf1 f 2 ) f 12 + f 22 − 2αf 1 f 2 )
where α = α(f1 ,f 2 ) is an arbitrary continuous function satisfying the following conditions:
− 1 < α ( f 1 , f 2 ) < 1,
α ( f 1 , f 2 ) = α ( f 2 , f 1 ) = α ( − f1 , f 2 ) = α ( f 1 ,− f 2 ) The expression for the subtraction operation is
f 1 \ α f 2 = f1 ∧ α (− f 2 ) Note that with this definition of the subtraction, the resulting object includes its boundary. If α=1, the above functions take the form:
Function-Based Shape Modeling
143
f 1 ∧1 f 2 = min( f 1 , f 2 ) f 1 ∨ 1 f 2 = max( f 1 , f 2 ) These R-functions are very convenient for calculations but have C1 discontinuity when f1 = f 2 . If α=0, the above general formulation takes the most useful in practice form:
f1 ∨ 0 f 2 = f1 + f 2 + f 1 ∧ 0 f 2 = f1 + f 2 −
f 12 + f 22 f 12 + f 22
These functions have C1 discontinuity only in points where both arguments are equal to zero. If C m continuity is to be provided, one may use another set of R-functions: m
f 1 ∨ m f 2 = ( f1 + f 2 +
f12 + f 22 )( f12 + f 22 ) 2
f 1 ∧ m f 2 = ( f1 + f 2 −
2 1
2 2
2 1
2 2
f + f )( f + f )
m 2
(a)
(b) Fig. 5. Contour maps and surfaces of defining functions for a 2D square with a square hole (bold lines): (a) R-functions
∧ 1 ; (b) R-functions ∧ 0
144
Alexander Pasko and Valery Adzhiev
Fig. 5 illustrates the properties of R-functions. The contour maps and surfaces of the function f3(x,y) are shown for different values of parameter α. Here, f 3 = f 1 ∧ α (− f 2 ) , where f1 and f2 define bigger and smaller square areas respectively. The contour lines f3(x,y)=0 drawn in bold are boundaries of the defined 2D square with a square hole. Note the smooth non-zero contours for R-functions ∧ 0 in Fig. 5b. This property is used in the formulation of several other operations, for example, blending versions of set-theoretic operations. 4.2.2 Bounded Blending Operations
A blending operation in shape modeling generates smooth transition between two surfaces. Such operations are usually used in computer-aided design for modeling fillets and chamfers. Blending versions of set-theoretic operations (intersection, union, and difference) on solids approximate exact results of these operations by rounding sharp edges and vertices. The R-functions with α=0 have zero contour lines with sharp vertices (bold line in Fig. 5b). Other contour lines are smooth in the entire domain. This property brings the idea that some displacement of the exact R-function can result in the blending effect. The following definition of a blending set-theoretic operation was proposed in [25]:
Fb ( f1 , f 2 ) = R( f1 , f 2 ) + dispb ( f1 , f 2 ),
R( f1 , f 2 ) is an R-function corresponding to the type of the operation, the arguments of the operation f1 ( X ) and f 2 ( X ) are defining functions of two initial solids, and disp ( f1 , f 2 ) is a Gaussian-type displacement function. The following where
expression for the displacement function was used:
dispb ( f1 , f 2 ) =
a0 2
f f 1 + 1 + 2 a1 a 2
2
,
where a0, a1, an a2 are parameters controlling the shape of the blend. The proposed definition is suitable for blending union, intersection, and difference and allows for generating added and subtracted material, as well as symmetric and asymmetric blends. Blending to the edge is one of the challenging operations. Fig. 6 shows blending union of a sphere (top object) to the edge produced by intersection of two other spheres (bottom object). In the case when the bottom object is constructed using min function (Fig. 6b), the edge is present on the blend surface because of C1 discontinuity of the min function on a plane passing through the initial edge. In the case when the bottom object is constructed using the R-function ∧ 0 , the blend surface is smooth (Fig. 6c).
Function-Based Shape Modeling
a
b
145
c
Fig. 6. Blending to the edge: a) sphere (top object) is blended to the intersection of two other spheres (bottom object); b) min function is used for the bottom object construction; c) Rfunction is used for the bottom object construction
a
b
c
Fig. 7. Shape and position of 3D blend are controlled by the bounding ellipsoid
However, the above displacement function does not get zero value anywhere in the space. This is the reason of the main disadvantage of this definition - the blend has global character and cannot be localized using its parameters. In [26], a different displacement function was proposed, which allows for localization of the blend using an additional bounding solid:
(1 − r 2 ) 3 ,r <1 dispbb (r ) = 1 + r 2 0, r ≥ 1 where r is a generalized distance constructed using defining functions of two initial solids ( f1 and f 2 ) and a bounding solid (function f 3 ):
r12 , r2 > 0 , r 2 = r12 + r2 2 1, r = 0 2 2
where
2
f f r1 ( f1 , f 2 ) = 1 + 2 , a1 a 2 2
146
Alexander Pasko and Valery Adzhiev
f 2 3 , f 3 > 0 2 and r2 ( f 3 ) = a3 , 0, f 3 ≤ 0
a1 and a2 controlling the blend symmetry, and a3 allowing the user to interactively control the influence of the function f 3 on the overall
with numerical parameters
shape of the blend. The shape and position of the bounded blend are controlled by its parameters and by the position and shape of the bounding solid. Control of blend shape and position is illustrated by Fig. 7. The pure union of two polyhedral shapes (Fig 7a) is changed to the bounded blending union using the bounding ellipsoid (transparent shape). The resulting blend is located strictly inside the bounding ellipsoid (Fig. 7b), which produces an unusual blending shape localized at the top part of the initial union of polyhedrons (Fig. 7c). Other unusual applications of bounded blending illustrated in [26] are multiple blending with a bounding solid consisting of several disjoint components, partial edge blending with added and subtracted material, and blend on blend. Note that the bounded blending operation requires three objects as an argument and thus it formally belongs to the class of 3-ary operations of FRep. 4.3
Relations
Let us give here examples of binary relations for point membership and intersection relations between two objects. Similarly to the primitives and operations, the user should be given a possibility to extend the set of relations by providing symbolic or procedural definitions of their predicates. Point Membership Relation
Let iG1 be the interior of the object G1 and bG1 be the boundary of G1 . The point membership relation is described by the 3-valued predicate:
0, if f1 ( X) < 0 for P ∉ G1 S 3 ( P, G1 ) = 1, if f 1 ( X) = 0 for P ∈ bG1 2, if f ( X) > 0 for P ∈ iG 1 1 Note that the system of set-theoretic operations based on R-functions corresponds to the operations of 3-valued logic over predicates S3 but not to the Boolean logic. Intersection Relation
The intersection (or collision) relation indicates if two objects have common points and is defined by the bi-valued predicate
Function-Based Shape Modeling
147
0, if G1 ∩ G2 = ∅ S c (G1 , G2 ) = 1, if G1 ∩ G2 ≠ ∅ The function
f 3 ( X) = f 1 ( X) ∧ α f 2 ( X) defining the result of the intersection
can be used to evaluate Sc . It can be stated that Sc = 0 if f 3 (X) < 0 for any point of E n [4]. This property can be used for the numerical collision detection based on the maximum search for f 3 ( X) .
5
Internal Representation
In this section we provide an outline of the formal specification of the FRep based geometric modeling system. We use the constructive technique based on Vienna Development Method (VDM) [27]. Of course, we can give here only a simplified fragment of the whole VDM specification, and many details are omitted. However, we believe that even in such an incomplete form the specification fragment does provide a solid mathematical framework for building high level representative view of the system which can be useful for understanding internal data structures and computing processes. We use a limited subset of VDM notation which is close to the one used in [28] for specifying GKS. This subset has a traditional though somewhat simplified and mnemonically informative notation. First of all, the specification defines principal abstract data types and operations over them. Let us introduce the concept of FRep_Machine which embodies state-based model of our geometric modeling system. The state of that underlying abstract machine is defined in the form of the Abstract Syntax (see Fig. 8). Line 1 introduces FRep_Machine definition in terms of four components that are briefly described below. Geometric environment Geom_Env (line 2) is defined as a finite map and states the meaning of all the geometric entities present in the system based on their names Geom_Ident. Geometric entities (lines 7 – 11) are defined as composite objects having a number of fields taking values from specified domains. The names attached to these fields (‘s_*_*') serve as selectors (accessor functions), each from the domain of the composite object to the domain of the relevant field to make all the constituent fields accessible. For instance, each object with generic type Gob (line 7) contains the fields stating its names with type ‘Gob_Ident', dimensionality of integer type N, a list of formal parameters ‘Par*', a list of formal coordinate variables ‘X*', and its representation in terms of geometric tree ‘Gob_Tree'. The geometric tree is itself specified as a composite object (line 11) recursively defining a k-ary constructive tree structure. Note that primitive geometric objects Pob (line 8) are represented by a structure of ‘FRep_Pob' type which can embody a functional expression, procedure, etc. A special object is a point in the modeling space ‘Point' (line 6) being characterized by its di-
148
Alexander Pasko and Valery Adzhiev
mensionality and a list of its coordinates. Relations (line 10) are represented by a structure embodying predicate. As to operations (line 9) , they are represented by a structure with type ‘FRep_Transf' embodying a certain transformation of FRep. We can deal with k-ary operations (lines 12-13) whose generic types can be unary (function mappings ‘Op_F_Map', space mapping ‘Op_Space_Map', extended space mapping ‘Op_Extended_Space_map', projection ‘Op_Projection ', etc.), binary set-theoretic (‘Op_ST_U' and ‘OP_ST_Bi'), and ternary bounded blending ‘OP_Blend_Ternary'. Geometric store ‘Geom_Store' (line 3) is a finite map that provides lists of actual parameters for all the geometric entities. Numerical store ‘Num_Store' allows for binding of variable identifiers with their values. Operations on introduced objects are represented as transition functions of FRep_Machine. Let us present here only one yet the most important operation, namely the one evaluating a defining function for a certain instance of a complex geometric object gob at the given point of the modeling space. The definition of such a function ‘f_gob_eval' is shown in Fig. 9. It is recursive and makes use a number of standard key words and operators such as ‘let x = … in …' introducing local variables in function definitions. There are a number of other functions in that definition. Auxiliary functions ‘Value_list' and ‘Value_par' (lines 5 and 7) provide binding of parameters with their actual values through access to the numerical store and usage of standard functions dealing with lists. The principal function ‘f_gob_eval' is eventually reduced to ‘f_gob_tree_eval' (lines 9-56) which deals with the tree structure ‘gob_tree' corresponding to that instance gob (see line 4). Let us give some comments on that function. Firstly, the signature of each input and output variables defining the function type (line 9) is defined. The symbol ‘ ∆ ' (line 10) denotes syntactic equivalence. Line 11 contains precondition on input variables; note that we do not define here invariants such as ‘inv_gob_tree' proving “well-formedness” condition. Then, using selector ‘s_tree_node' (see Fig. 8) we get an access to the geometric entity ‘geom_ident_node' in the tree node (line 12) and form a list of the point coordinates (line 13). Predicates ‘is_*' serve for recognizing the type of ‘geom_ident_node'. If ‘geom_ident_node' is recognized as having ‘Gob' type (line 14), we get all the necessary data about it from the geometric environment (line 15) and the function ‘f_gob_eval' is recursively applied. If ‘Pob' type is recognized (line 17), we get all the information about this primitive from the geometric environment and the geometric store (lines 18-19) with its subsequent substitution into the selector function ‘s_pob_rep' (line 20). Fig. 10 shows how the function 'f_gob_eval' can be used for defining point membership relation.
Function-Based Shape Modeling
1. FRep_Machine = Geom_Env × Geom_Store × Point × Num_Store m
2. Geom_Env = Geom_Ident → Geom_Entity m
3. Geom_Store = Geom_Ident → Arg* m
4. Num_Store = Ident → Val 5. Geom_Entity = Gob | Pob | Op | Rel 6. Point:: s_point_dim: N s_point_coord: Arg* 7. Gob::
s_gob_id: Gob_Ident s_gob_dim: N s_gob_par: Par* s_gob_coord: X* s_gob_rep: Gob_Tree
8. Pob::
s_pob_id: Pob_Ident s_pob_dim: N s_pob_par: Par* s_pob_coord: X* s_pob_rep: FRep_Pob
9. Op::
s_op_id: Op_Ident s_op_dim: N s_op_par: Par* s_op_coord: X* s_op_rep: FRep_Transf
10. Rel:: s_rel_id: Rel_Ident s_rel_dim: N s_rel_par: Par* s_rel_rep: FRep_Pred 11. Gob_Tree:: s_tree_arity: N s_tree_node: Geom_Ident s_tree_leaves: (N × Gob_Tree | nil)* 12. Op = Op_Unary | OP_ST_Bi | OP_ Blend_Ternary 13. Op_Unary =Op_ST_U || Op_F_Map | Op_Space_Map | Op_Extended_Space_map | Op_Projection | … 14. Geom_Ident = Gob_Ident | Pob_Ident | Op_Ident | Rel_Ident 15. Par = Ident 16. Arg = Val | Ident 17. Val = Real | Undef Fig. 8. VDM specification: State of the FRep_Machine (fragment of an abstract syntax)
149
150
Alexander Pasko and Valery Adzhiev
1. type f_gob_eval: Gob × Point × FRep_Machine → Val 2. f_gob_eval (gob, point, frep_machine) ∆ 3. pre is_Gob (gob) I (s_point_dim (point) = s_gob_dim (gob)); 4. let gob_tree = s_gob_rep (gob) in f_gob_tree_eval (gob_tree, point, frep_machine); 5. type Value_list: Arg* × Num_Store → Val* 6. Value_list (arg_list, num_store) ∆ if arg_list = nil then nil else conc (Value_par (hd (arg_list, num_store) ), Value_list (tl (arg_list), num_store) ); 7. type Value_par: Arg × Num_Store → Val 8. Value_par (arg, num_store) ∆ is_Ident (arg) → num_store(arg); is_Val (arg) → arg; 9. type f_gob_tree_eval: Gob_Tree × Point × FRep_Machine → Val 10. f_gob_tree_eval (gob_tree, point, frep_machine) ∆ 11. pre inv_gob_tree (gob_tree, frep_machine); 12. let geom_ident_node = s_tree_node (gob_tree) and 13. coord_value_list = Value_list ( s_point_coord (point) ) in 14. is_Gob_Ident (geom_ident_node) → 15. let gob_node = geom_env (geom_ident_node) in 16. f_gob_eval (gob_node, point, frep_machine); 17. is_Pob_Ident (geom_ident_node) → 18. let pob = geom_env (geom_ident_node) and 19. par_value_list = Value_list (geom_store (geom_ident_node) ) in 20. let frep_pob = s_pob_rep (par_value_list, coord_value_list); 21. is_Op_Unary_Ident (geom_ident_node) → 22. let op_un = geom_env (geom_ident_node) and 23 par_value_list = Value_list (geom_store (geom_ident_node) ) and 24. let gob_tree_left = s_tree_leaves (gob_tree, 1) in 25. 26. 27. 28.
is_Op_F_Map_Ident (geom_ident_node) → let frep_transf = s_op_rep (op_un) in frep_transf (par_value_list, coord_value_list, f_gob_tree_eval (gob_tree_left, point, frep_machine));
29. 30. 31. 32. 33. 34. 35.
is_Op_Space_Map_Ident (geom_ident_node) → let frep_transf = s_op_rep (op_un) in let inverse_coord_list = Value_list (frep_transf (par_value_list, coord_value_list) ) in let inverse_point = mk_point (s_point_dim (point), inverse_coord_list) in f_gob_tree_eval (gob_tree_left, inverse_ point, frep_machine);
36.
is_Op_Extended_Space_Map_Ident (geom_ident_node) → <…> is_Op_ST_Bi_Ident (geom_ident_node) →
37.
Function-Based Shape Modeling 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56.
151
let op_st_bi = geom_env (geom_ident_node) and par_value_list = Value_list (geom_store (geom_ident_node) in let gob_tree_left = s_tree_leaves (gob_tree, 1) and gob_tree_right = s_tree_leaves (gob_tree, 2) in let frep_transf = s_op_rep (op_st_bi) in frep_transf (par_value_list, coord_value_list, f_gob_tree_eval (gob_tree_left, point, frep_machine), f_gob_tree_eval (gob_tree_right, point, frep_machine) ); is_Op_Blend_Ternary_Ident (geom_ident_node) → let op_bl_tern = geom_env (geom_ident_node) and par_value_list = Value_list (geom_store (geom_ident_node) in let gob_tree_1 = s_tree_leaves (gob_tree, 1) and gob_tree_2 = s_tree_leaves (gob_tree, 2) and gob_tree_3 = s_tree_leaves (gob_tree, 3) in let frep_transf = s_op_rep (op_bl_ter) in frep_transf (par_value_list, coord_value_list, f_gob_tree_eval (gob_tree_1, point, frep_machine), f_gob_tree_eval (gob_tree_2, point, frep_machine) f_gob_tree_eval (gob_tree_3, point, frep_machine) ); Fig. 9. VDM specification: Evalation of defining function for geometric object type pred_point_membership: Gob × Point × FRep_Machine → Int pred_point_membership (gob, point, frep_machine) ∆ let f_value = f_gob_eval (gob, point, frep_machine) in is_equal_zero (f_value) type is_equal_zero: Val → Int <…> Fig. 10. VDM specification: Point membership relation
Then, we check if ‘geom_ident_node' is a unary operation (line 21); if so, we get its data from the geometric environment and form the list of its actual parameters (lines 22-23). We get an access to its only subtree ‘gob_tree_left' and can act depending on the type of that operation. In case this is a “Function mapping” operation (line 25) we just get the corresponding representation ‘frep_transf‘ of this operation (ine 26) and evaluate it with proper parameters (line 27) using recursively applying ‘f_gob_tree_eval' function (line 28). If this is a “Space mapping” operation (line 29), one should get an inverse list of coordinates (line 31) with subsequent recursive evaluation of ‘f_gob_tree_eval' at the point ‘inverse_point' formed with help of “make” function ‘mk_point' (lines 33-35). As to an operation of the “Extended space mapping” type combining a function mapping and a space mapping, it can be implemented by combining two previously described ones with two subsequent (down and up) passes of the tree (omitted in the Fig. 9). Finally, let us consider the case when ‘geom_ident_node' is a ternary bounded blending operation (line 46-56). The evaluation involves forming the lists of actual parameters and a recursive application of ‘f_gob_tree_eval' for all three subtrees.
152
Alexander Pasko and Valery Adzhiev
A similar procedure is applied in the case of a binary set-theoretic operation (lines 37–45).
Fig. 11. Tree structure for a metamorphosis operation between a constructive solid and a blobby object defined using algebraic sums of individual blobs
Fig. 12. Stages of metamorphosis between a constructive solid and a blobby object
Fig. 11 shows an example of the internal tree structure for a 4D (time-dependent) object, defined as a binary metamorphosis operation between a constructive solid (left subtree) and a blobby object (right subtree with only algebraic sums in the nodes). Several stages of the object transformation are shown in Fig. 12.
6
Modeling Heterogeneous Objects
Modeling heterogeneous objects is becoming an important research topic. Heterogeneous objects are considered in such different areas as modeling of objects with multiple materials and varying material distribution in CAD/CAM and rapid prototyping, representing results of physical simulations, geological and medical modeling, volume modeling and rendering. We consider real or abstract heterogeneous objects that have internal structure with non-uniform distribution of material and other attributes of an arbitrary nature (photometric, physical, statistical, etc.), and elements of different
Function-Based Shape Modeling
153
dimension. It means these objects are heterogeneous with respect to their structure and dimensionality. Multidimensional point sets with a fixed dimensionality and with multiple attributes can be quite effectively dealt with using a constructive hypervolume model based on real-valued vector-functions (see 6.1). The requirement of dimensional heterogeneity naturally brings the idea of adding a kind of cellular representation to the model while using FRep. Moreover, different applications such as CAD or finite-element analysis require an explicit representation of mixed-dimensional objects along with the functional one. These are the main motivations for introduction of a new hybrid cellularfunctional model (see 6.2). 6.1
Constructive Hypervolume Model
A hypervolume object can be defined as:
o = (G, A1 ,..., Ak ) : ( F ( X ), S1 ( X ),..., S k ( X )) where Χ = (x1, …, xn) is a point in n-dimensional Euclidian space Εn, F: Χ → ℜ is a real-valued defining function of point coordinates representing the point set G, Si: Χ → ℜ is a real-valued scalar function representing an attribute Ai that is not necessarily continuous. The point set G and the attribute functions Si are defined by real-valued functions using FRep. The function F corresponding to an FRep object is at least C0 continuous and defined in the Euclidean space En. As it was discussed earlier, the function F is evaluated by a procedure traversing a tree structure, where primitives are placed at the leaves, and operations at the nodes. Because the function F is built using a constructive method, the proposed model was called a constructive hypervolume model. Similarly, attribute functions Si are evaluated by traversing the corresponding tree structures. Therefore, we can state that the internal representation of a constructive hypervolume includes a constructive geometric tree and constructive attribute trees. The proposed model was used in [29] to extend the well-known concept of solid texturing in two directions: constructive modelling of space partitions for texturing and modelling of multidimensional textured objects. Some operations on attributes such as color blending were also discussed. Other applications of constructive hypervolumes include
• • • • •
Rapid prototyping and fabrication of objects with multiple materials and varying material distribution; Physics based simulations for the analysis of physical field distributions over the given geometric areas; Analysis of geological structures; Medical examination and surgery simulation using data from computer tomography and other scanning devices; Modeling and visualization of amorphous and gaseous phenomena.
154
Alexander Pasko and Valery Adzhiev
6.2
Implicit Complexes
Let us first consider a 2D space and k-dimensional cells in it: k=2: 2D solid or planar area; k=1: curves and their segments; k=0: points.
It is clear that 2D solids can be defined as f(x,y)≥0. Rvachev [4] discussed the construction of such a definition for lower dimensional objects. The main idea is that the function f(x,y) has to be zero only at the points of this object and negative everywhere else. For example, if one wants to describe a straight line segment on a 2D plane, an equation of a straight line can be used: w(x,y)=ax+by+c. The inequality w ≥ 0 defines a halfplane. Then, -w2 ≥ 0 defines the line itself, where in fact the function -w2 is never positive and only becomes zero on the line. The line can be trimmed using some 2D solid to produce one or several segments. The simplest way to define a segment is w2 ∧ 0 g ≥ 0, where g(x,y) ≥ 0 is a definition of a 2D solid disk. In 3D space, we can also define points, curve segments, and surface patches as follows:
• • •
“implicit” definition of a surface patch requires an “implicit” surface and a trimming 3D solid; a curve can be defined as an intersection of two surfaces, each defined as -f2 ≥ 0; a point can be defined as the intersection of three surfaces, a curve and a surface, or directly as d(x,y,z), where d is a negative distance to the given point.
Rvachev et al. [30] showed that such a function representation of lower dimensional cells was quite useful in solving interpolation and boundary value problems. In [31], a hybrid cellular-functional model of heterogeneous objects was introduced. It combines a cellular representation and a constructive representation using real-valued functions. A notion of an implicit complex was introduced in [31]. Such a complex has the following features:
• •
•
it is defined as a union of properly joined cellular spaces (which we call domains to distinguish them from general cellular spaces); subspaces that are shared by two or more domains are represented by explicitly defined cellular subcomplexes; accordingly, some domains can be represented by explicit cellular complexes; for other domains, it is enough to have only a few explicit cells to form a base for the intersection; as to their complete representation, it is defined functionally; as all these cellular spaces are properly joined, they ultimately form a complex, which we call an implicit one.
An example of an implicit complex is given in Fig. 13. Here, using domains with different dimensionalities is necessary. The object consists of a cylinder with a longitudinal hole and a bent surface patch with a hole, which is attached to the cylinder's surface. Here, we use two FRep domains. The first one, D1 is represented as a 3D cylinder defined functionally as F1(x,y,z)≥0. The explicit part of this domain consists
Function-Based Shape Modeling
155
of cells corresponding to two “attaching points” {e01, e02} and one “attaching” line segment e11. The second FRep domain D2 presents a more interesting case. The point set T22 has its preimage (T22)', which is defined on the plane (u,v) by a function F2(u,v)≥0. Then, we must define embedding map h: E2 -> E3, which gives us homeomorphism taking (T22)' to T22. The second domain has the same explicit part as the first one. The hybrid cellular-functional model allows for independent but unifying representation of geometry and attributes of heterogeneous objects, and makes it possible to represent dimensionally non-homogeneous entities and their cellular decompositions. It is a new research area and a lot of work should be done on related operations, conversion to conventional models, as well as on the development of corresponding software tools and applications.
Fig. 13. Example of an implicit complex in E3
7
Specialized Language
In principle, one can utilize a universal programming language like C or Java as an FRep modeling language. However, such languages are too complex and have a lot of unnecessary features for application to shape representation. Their generalised compilation tools make the specialized task of constructing shape models unnecessarily difficult. In [13], we introduced a modeling system architecture built around the shape models in HyperFun, which is a specialized high-level programming language for specifying FRep models.. The language is designed to include all conventional programming constructs and specialized operators necessary for modeling complex objects, yet without any redundant features. While being minimalist, it supports all main notions of FRep. HyperFun is also intended to serve as a lightweight exchange protocol for FRep models to support platform independence and Internet-based collaborative modeling. A model in HyperFun can contain the specification of several FRep or constructive hypervolume objects parameterized by input arrays of point coordinates xi and numerical parameters ai whose values are to be passed from outside the object. The number of coordinate variables can be greater than three to allow for definition of higher dimensional objects. Each object is defined by a function describing its ge-
156
Alexander Pasko and Valery Adzhiev
ometry (the function's name coincides with the object's name) accompanied, if necessary, by a set of scalar functions si representing its attributes. The function can be quite complex: it is represented with the help of assignment statements (using auxiliary local variables and arrays, if necessary); conditional selection ('if-then-else'), and iterative ('while-loop') statements. Functional expressions are composed using conventional arithmetic and relational operators. It is possible to use standard mathematical functions ('exp', 'log', 'sqrt', 'sin', etc.). Fundamental set-theoretic operations are supported by special built-in operators with reserved symbols ("|" - union, "&" - intersection, "\" - subtraction, "~" - negation, "@" - Cartesian product). Functional expressions can also include references to previously defined geometric objects. In principle, the language is self-contained and allows users to build objects from scratch, without the use of any pre-defined primitives and transformations. However, its expressive power is greatly increased by the availability of the system “FRep library” that is easily extendable and can be adapted to particular application domains and can even be customised for the needs of particular users. Currently, the version of the FRep library in general use contains the most common primitives and transformations of quite a broad spectrum. The user can create his/her own library of objects for later reuse. A sample of a HyperFun model can be found in Fig. 14. Application software deals with HyperFun models through using either a built-in interpreter or HyperFun-to-C/HyperFun-to-Java compilers and utilities of the HyperFun API. The HyperFun interpreter has been implemented as a small set of functions in ANSI C. It is quite easy to integrate them into the application software since the developer needs to deal with only two C-functions. The 'Parse' function performs syntax analysis in accordance with the language grammar and semantic rules. For each object described in the HyperFun program, the function generates an internal representation that is actually a collection of the tree structures optimized for subsequent efficient evaluation. If there are any errors in the program, the function outputs a list containing the location and details of each error found. Another interpreter function ('Calc') is called every time when there is a need to evaluate the function at a given point in the modeling space and for the given external numerical parameters. Externally defined values for attribute scalar functions can be passed too. The object's internal representation serves as an input parameter for 'Calc' function that returns both the value of the "geometric" function and a set of values for "attribute" scalar functions - all evaluated at the given point. The formal specification of the internal representation and of the function evaluation procedure was given above. The function 'Parse' is invoked just once while processing the HyperFun program to generate a representation that can be considered as a "byte-code" and can serve as a protocol for data exchange between system components ‘Parse' and ‘Calc'. In fact, these constitute an application programming interface (API) that is simple to use. The software tools developed to support HyperFun include a polygonizer (surface mesh generator), a plug-in to a POVRay ray-tracer, and a set of Web-based modeling tools such as translator to Java, polygonizer in Java, and interactive modeler based on empirical modeling principles and provided as an applet. Examples of HyperFun models created and rendered using these tools are shown in Fig. 15.
Function-Based Shape Modeling
157
Fig. 14. Example of a HyperFun program and the corresponding image of the model in the HyperFun for Windows modeling environment
a
b
c
d
Fig. 15. HyperFun models: a) human embryo digestive system (courtesy of R. Durikovic and S. Czanner); b) Japanese lacquer ware; c) 3D quaternion Julia fractals (courtesy of F. Delhoume); d) multilayer geological structure with internal material attribute distribution, an oil well, and cavities (heterogeneous object)
158
Alexander Pasko and Valery Adzhiev
Main current application areas of FRep and HyperFun include education (geometry and geometric modeling, computer graphics, programming languages), biological modeling, cultural heritage preservation, animation and multimedia, and computer art. The constructive hypervolume models can be applied in multiple material rapid prototyping, geological and biological modeling, physics based simulations, and volume graphics. We are also planning to develop an advanced computer-aided design system based on several geometric representations including FRep and the constructive hypervolume model.
Acknowledgements We would like to thank all the co-authors of FRep related papers and developers of HyperFun software tools, who contributed their knowledge and efforts to our joint research and development during past 15 years.
References [1]
Requicha A., Representations of rigid solids: theory, methods, and systems, Computing Surveys, vol. 12, No. 4 (1980) 437-464. [2] Rvachev V.L., On the analytical description of some geometric objects, Reports of Ukrainian Academy of Sciences, vol. 153, No. 4 (1963) 765-767. [3] Rvachev V.L. Methods of Logic Algebra in Mathematical Physics, Naukova Dumka, Kiev (1974) (in Russian). [4] Rvachev V.L., Theory of R-functions and some applications, Naukova Dumka, Kiev (1982) (in Russian). [5] Ricci A., A constructive geometry for computer graphics, The computer Journal, vol. 16, No. 2 (1973) 157-160. [6] Blinn J., A generalization of algebraic surface drawing, ACM Transactions on Graphics, vol. 1, No. 3 (1982) 235-256. [7] Bloomenthal J. et al., Introduction to Implicit Surfaces, Morgan Kaufmann Publishers, San Francisco (1997). [8] Bowyer A., SVLIS Set-theoretic Kernel Modeller, Introduction and User Manual, Information Geometers, Winchester, UK (1995). [9] Shapiro V., Theory of R-functions and applications: a primer, TR CPA88-3, Cornell University (1988). [10] Shapiro V., Real functions for representation of rigid solids, Computer Aided Geometric Design, 11(2) (1994)153-175. [11] Tsukanov I., V. Shapiro V., The architecture of SAGE - a meshfree system based on RFM, Engineering with Computers, vol. 18, No. 4 (2002) 295-311. [12] Wyvill B., Galin E., Guy A., Extending the CSG tree. warping, blending and Boolean operations in an implicit surface modeling system, Computer Graphics Forum, vol. 18, No. 2 (1999) 149-158.
Function-Based Shape Modeling
159
[13] Adzhiev V., Cartwright R., Fausett E., Ossipov A., Pasko A., Savchenko V., HyperFun project: a framework for collaborative multidimensional F-rep modeling, Implicit Surfaces '99 Workshop (Bordeaux, France), J. Hughes and C. Schlick (Eds.) (1999) 59-69, URL http://www.hyperfun.org/ [14] Pasko A., Savchenko V., Adzhiev V., Sourin A., Multidimensional geometric modeling and visualization based on the function representation of objects, Technical Report 93-1-008, The University of Aizu, Japan (1993) 47 p. [15] Pasko A., Adzhiev V., Sourin A., Savchenko V., Function representation in geometric modeling: concepts, implementation and applications, The Visual Computer, vol.11, No.8 (1995) 429-446, URL http://wwwcis.k.hosei.ac.jp/~F-rep/ [16] McCormack J., Sherstyuk A., Creating and rendering convolution surfaces, Computer Graphics Forum, vol. 17, No. 2 (1998) 113-120. [17] Perlin K., Hoffert E., Hypertexture, SIGGRAPH'89, Computer Graphics, vol. 23, No. 4 (1989) 253-262. [18] Sourin A., Pasko A., Savchenko V., Using real functions with application to hair modelling, Computers and Graphics, vol. 20, No. 1 (1996) 11-19. [19] Savchenko V., Pasko A., Okunev O., Kunii T., Function representation of solids reconstructed from scattered surface points and contours, Computer Graphics Forum, vol.14, No.4 (1995) 181-188. [20] Miura K., Pasko A., Savchenko V., Parametric patches and volumes in the functional representation of geometric solids, Set-theoretic Solid Modeling: Techniques and Applications, CSG 96 (Winchester, UK, 17-19 April 1996), Information Geometers, UK (1996) 217-231. [21] Schmitt B., Pasko A., Schlick C., Constructive modelling of FRep solids using spline volumes, Sixth ACM Symposium on Solid Modeling and Applications (June 6-8, 2001, Ann Arbor, USA), D. Anderson, K. Lee (Eds.), ACM Press (2001)321-322. [22] Sourin A., Pasko A., Function representation for sweeping by a moving solid, IEEE Transactions on Visualization and Computer Graphics, vol.2, No.1, (1996) 11-18. [23] Pasko A., Savchenko V., Projection operation for multidimensional geometric modeling with real functions, Geometric Modeling: Theory and Practice, W. Strasser, R. Klein, R. Rau (Eds.), Springer-Verlag, Berlin/Heidelberg (1997) 197-205. [24] Pasko A., Okunev O., Savchenko V., Minkowski sums of point sets defined by inequalities, Computers and Mathematics with Applications, Elsevier Science, vol. 45, No. 10/11 (2003) 1479-1487. [25] Pasko A., Savchenko V., Blending operations for the functionally based constructive geometry, Set-theoretic Solid Modeling: Techniques and Applications, CSG 94 Conference Proceedings, Information Geometers, Winchester, UK (1994) 151-161. [26] Pasko G., Pasko A., Ikeda M., Kunii T., Bounded blending operations, Shape Modeling International 2002, Banff (Canada, May 17-22), IEEE Computer Society (2002) 95-103.
160
Alexander Pasko and Valery Adzhiev
[27] Bjorner D., Jones C., Formal specification and software development, PrenticeHall, Englewood Cliffs, N.J. (1982). [28] Duce D., Fielding E., Formal specification – a comparison of two techniques, The Computer Journal, vol. 30, No. 4 (1987) 316-327. [29] Pasko A., Adzhiev V., Schmitt B., Schlick C., Constructive hypervolume modeling, Graphical Models, special issue on Volume Modeling, vol. 63, No. 6 (2001) 413-442. [30] Rvachev V., Sheiko T., Shapiro V., Tsukanov I., Transfinite interpolation over implicitly defined sets, Computer-Aided Geometric Design, 18 (2001) 195-220. [31] Adzhiev V., Kartasheva E., Kunii T., Pasko A., Schmitt B., Hybrid cellularfunctional modeling of heterogeneous objects, Journal of Computing and Information Science in Engineering, Transactions of the ASME, vol. 2, No. 4 (2002) 312-322.
C 1 Spline Implicitization of Planar Curves Mohamed Shalaby1 , Bert J¨ uttler2 , and Josef Schicho1 1
Research Institute for Symbolic Computation, Schloss Hagenberg, 4232 Hagenberg, Austria {shalaby, jschicho}@risc.uni-linz.ac.at http://www.risc.uni-linz.ac.at 2 Institute of Analysis, Dept. of Applied Geometry, Johannes Kepler University, Linz, Austria [email protected] http://www.ag.jku.at
Abstract. We present a new method for constructing a low degree C 1 implicit spline representation of a given parametric planar curve. To ensure the low degree condition, quadratic B-splines are used to approximate the given curve via orthogonal projection in Sobolev spaces. Adaptive knot removal, which is based on spline wavelets, is used to reduce the number of segments. The spline segments are implicitized. After multiplying the implicit spline segments by suitable polynomial factors the resulting bivariate functions are joined along suitable transversal lines. This yields a globally C 1 bivariate function. Keywords: implicitization, B-spline, approximation, knot removal
1
Introduction
Planar curves in Computer Aided Geometric Design can be defined in two different ways. In most applications, they are described by a parametric representation, x = x(t)/w(t) and y = y(t)/w(t) where x(t), y(t), and w(t) are often polynomials, or piecewise polynomials. Alternatively, the implicit form f (x, y) = 0 can be used. Both the parametric and implicit representation have their advantages. The availability of both often results in simpler and more efficient computations. For example, if both representations are available, the intersection of two curves can be found by solving a one–dimensional root finding problem. Any rational parametric curve has an implicit representation, while the converse is not true. The process of converting the parametric equation into implicit form is called implicitization. A number of established methods for exact implicitization exists: resultants [3], Gr¨ obner bases [1], and moving curves and surfaces [13]. However, exact implicitization has not found widespread use in CAGD. This is – among other reasons – due to the following facts: – Exact implicitization often produces large data volumes, as the resulting bivariate polynomials may have a huge number of coefficients. – The exact implicitization process is relatively complicated, especially, in the case of high polynomial degrees. For instance, most resultant–based methods need the symbolic evaluation of large determinants. F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 161–177, 2004. c Springer-Verlag Berlin Heidelberg 2004
162
Mohamed Shalaby et al.
– Even for regular parametric curves, the exact implicitization may have unwanted branches or self–intersections in the region of interest. For these reasons, approximate implicitization has been proposed. Several methods are available: Montaudouin and Tiller [11] use power series to obtain local explicit approximation (about a regular point) to polynomial parametric curves and surfaces. Chuang and Hoffmann [2] extend this method using what they called “implicit approximation”. Dokken [5] proposes a new way to approximate the parametric curve or surface globally; the approximation is valid within the whole domain of the curve segment or surface patch. Sederberg et al. [14] use monoid curves and surfaces to find an approximate implicit equation and approximate inversion map of a planar rational parametric curve or a rational parametric surface. As a well–known fact, the parametric and implicit representations of a planar curve have the same polynomial degree. However, the number of the coefficients in the parametric case is 2(n+1) while it is (n+1)(n+2)/2 in the implicit case. In the implicit case, high polynomial degree will lead to expensive computations. This is even more dramatic for surfaces. We restrict ourselves to low degree implicitization. In [8], we used quadratic B–splines for constructing a low degree spline implicit representation of a given parametric planar curve of degree n. A spline implicitization is a partition of the plane into polygonal segments, and a bivariate polynomial for each segment, such that the collection of the zero contours approximately describes the given curve. On the boundaries, these polynomial pieces are joined to form a globally C m spline function, for a suitable choice of m. In [8], we restricted ourselves to continuous functions, i.e. m = 0. Readers who are not familiar with the splines may wish to consult a suitable textbook, e.g.,[7]. Clearly, differentiability (C 1 ) is needed for many applications. For example, in foot point generation, one has to compute a point such that [(p−X), ∇f (X)] = 0. As the computation of the gradient is needed, the curve should be C 1 . Another example is the computation of distance bounds between two planar curves [9]. The main goal of this paper is to find a low degree C 1 spline implicit representation of a given parametric planar curve of degree n. To ensure the low degree condition, quadratic B-splines are used to approximate the given parametric curve (section 2). Adaptive knot removal, which is based on spline wavelets, is used to reduce the number of segments (section 3). The resulting quadratic B-spline segments are implicitized (section 4). Finally, by multiplying with suitable polynomial factors, these implicitized segments are joined together with C 1 continuity (sections 5, 6).
2
Quadratic B–spline Approximation
Following the idea proposed in [12], we generate a quadratic B–spline approximation via orthogonal projection in Sobolev spaces. The quadratic B–splines Bj on [0, 1] with uniform knots (stepsize h = 2−i ) and 3-fold boundary knots form
C 1 Spline Implicitization of Planar Curves
163
00 11 0 1 00 11 000 1 00 11 9 00 11 0 1 00 11 011 1 00 11 0000 1111 11111111111 00000000000 11 00 0000 1111 1 0 0 1 0000 1111 800 11 0 1 000 111 0000 1111 000 111 0 1 0000 1111 7 111 000 0 1 0000 1111 000 111 0000 1111 0 1 0 1 000 111 000 111 0000 1111 6 111 0 1 0 1 000 111 000 000 111 000 111 000 111 5 111 000 000 111 000 111 000 111 000 111 4 1 00 0 11 1 0 1111111 0000000 2 4 6 8 10 12 14 16 18 20 Fig. 1.
A parametric curve of degree 15 and its control points
an orthonormal sequence in a suitably weighted Sobolev space. In the interior of the segment, the inner product is defined by f, g =
1 1 1 (f, g) + h (f , g ) + h3 (f , g ) h 4 30
(1)
where (., .) is the usual L2 inner product. In order to achieve orthogonality at the boundary, additional terms have to be used. These weights and weight matrices (which are used near the boundary), have been specified in [12]. The B-spline approximation g∗ of a given curve g = (g1 (t), g2 (t)), with respect to the norm which is induced by the inner product (1), can then be written as: g1 , Bj dj Bj (t) with dj = g∗ = g2 , Bj j
The control points dj of the approximating B–spline curve can be generated by simple and efficient computations, as only (possibly numerical) integrations are needed. Also, no assumption about the given parametric representation have to be made, except that it should be at least in the underlying Sobolev space H 2,2 . By using sufficiently many segments, an arbitrarily accurate approximation can be generated; the approximation order is 3. Example Consider a polynomial parametric curve g of degree 15 which is shown in Fig. 1. We represent g by its control points. First, we approximate g using quadratic B–splines. Fig. 2 shows the error between g (black) and the quadratic B–spline approximation g∗ (gray) for stepsize h = 1/128 (128 segments). Note that the error had to be exaggerated by a factor δ = 50000 to make it visible.
3
Data Reduction via Spline Wavelets
After computing the initial B–spline approximation, we apply a knot removal (or data reduction) procedure, in order to reduce the number of segments. Such
164
Mohamed Shalaby et al.
9 8 7 6 5 5
10
15
20
Fig. 2. The original curve (black) and the error introduced by approximating it with a quadratic B–spline curve (gray). The error has been exaggerated a reduction means that we approximate the given B–spline in a space S by a B-spline in linear subspace of S. Methods for knot removal have been discussed by several authors, see e.g. [6, 10] and the references cited therein. In [6], the authors propose an optimal technique, by treating the knot removal procedure as a reverse approximative knot insertion process. It is based on a so–called “ranking list”, which is used to compare the error introduced by removing a specific knot. In [8], a special method for our special situation has been proposed, which is based on the use of spline wavelets [4]. For more information about spline wavelets the reader may consult a wavelet textbook, e.g., [15, 16]. The method is not optimal, but it is cheaper than all other methods since no sorting or ranking lists are required. For the convenience of the reader, we give an outline of the method. 1. First, the wavelet transform of the given B-spline curve is computed. 2. Then, by setting all wavelets coefficients vectors with norm less than the threshold to be zero, we can remove blocks of wavelets with zero coefficients vector. For each block, one of the two common knots can be removed from the knot sequence. The length of these blocks varies between 2 and 5 wavelets, depending on the location of the removed knot in the knot sequence (that is, if the knot is an inner knot or close to the boundary). 3. Finally, the B–spline final representation g∗∗ of the given B–spline curve g∗ is computed over the reduced knot sequence Kfinal . The error can be bounded simply by applying the wavelet synthesis to the set of removed wavelets. Due to the convex hull property of the B–splines, the error is bounded by the maximum absolute value of the resulting B´ezier control points. Example continued We apply the procedure to the quadratic B–spline curve g∗ . The number of knots is reduced from 133 to 13 (the number of segments is reduced from 128 to 8) , where the threshold is equal to 10−3 . Fig. 3 shows the error between the original curve g (black) and the final B–spline representation curve g∗∗ (gray) over Kfinal . The knots are plotted as circles. The knots at the
C 1 Spline Implicitization of Planar Curves
165
9 8 7 6 5 5
10
15
20
Fig. 3. The original curve (black) and the B–spline approximation curve after the data reduction (gray). The error is exaggerated (amplified) by a factor δ = 5
boundary have multiplicity 3. The error is exaggerated by a factor δ = 5 to make it visible.
4
Segment-wise Implicitization
After the data reduction process, we have a quadratic B–spline approximation g∗∗ defined over the reduced non–uniform knot sequence Kfinal . In order to implicitize this curve, we split the B–spline representation of this curve into the B´ezier segments. Then, each quadratic B´ezier segment is implicitized. The conversion from B–spline representation of the curve to B´ezier representation can easily be achieved via knot insertion. By increasing the knot multiplicity at each knot to be equal to the degree of the curve (in our case to be 2), the B–spline representation is converted to B´ezier representation. Each quadratic parametric B´ezier segment has three control points. Let (p0 , q0 ), (p1 , q1 ) and (p2 , q2 ) be the control points of one of these segments. Then the implicit form of this segment can be shown to be equal to Q0 (y)P2 (x) − P0 (x)Q2 (y) Q0 (y)P1 (x) − P0 (x)Q1 (y) G(x, y) = det Q1 (y)P2 (x) − P1 (x)Q2 (y) Q0 (y)P2 (x) − P0 (x)Q2 (y) where
5
2 Pi (x) = (pi − x), i
2 Qi (y) = (qi − y) i
for
i = 0, 1, 2.
Joining Two Segments
In order to generate a C 1 continuous function, we modify the bivariate polynomials, which have been produced by the implicitization process, by multiplying them with suitable quadratic polynomial factors. We shall use the following abbreviation:
166
Mohamed Shalaby et al.
L f2,1 (x, y)
r
s f1,2 (x, y) q G2 (x, y) G1 (x, y) p
Fig. 4. Multiplying by quadratic polynomial factors Definition 1. For a given polynomial f (x, y), let Z(f ) be the zero set, Z(f ) = {(x, y) | f (x, y) = 0}. In this section, we consider two neighboring B´ezier segments of g∗∗ , with implicit representations Gi (x, y), i = 1, 2. These segments are parabolas which have a common tangent Tg at their common point p (see Fig. 4). Clearly, this point is non–singular. We choose the transversal line L as an arbitrary line passing through p, which is different from Tg . Let q and r be the second points of intersection of Z(G1 ) and Z(G2 ), respectively, with the chosen transversal line L. Let s be a point on L, distinct from p, q and r. We multiply G1 (x, y) and G2 (x, y) by quadratic polynomial factors f2,1 (x, y) and f1,2 (x, y) respectively such that: ˆ = L(x, ˆ y), where L ˆ (i) Neither f2,1 (x, y) nor f1,2 (x, y)) contains the factor L is the linear polynomial that vanishes on the line L. (ii) Z(f2,1 ) and Z(G2 ) have a common tangent at r. (iii) Z(f1,2 ) and Z(G1 ) have a common tangent at q. (iv) Z(f1,2 ) and Z(f2,1 ) have a common tangent at s. We consider the bivariate polynomials F1 (x, y) = G1 (x, y)f2,1 (x, y)
and
F2 (x, y) = G2 (x, y)f1,2 (x, y).
Theorem 1. If the conditions (i) − (iv) are satisfied, then, after multiplying F2 by a suitable constant, the two bivariate polynomials F1 (x, y) and F2 (x, y) are C 1 along the transversal line L.
C 1 Spline Implicitization of Planar Curves
167
Proof. Let G1 (x, y) =
ai,j xi y j ,
G2 (x, y) =
i+j≤2 i,j≥0
f2,1 (x, y) =
bi,j xi y j ,
i+j≤2 i,j≥0
ci,j xi y j ,
i+j≤2 i,j≥0
f1,2 (x, y) =
di,j xi y j .
i+j≤2 i,j≥0
By normalization and simple change of coordinates, we may achieve that p = (0, 0), ∇G1 (0, 0) = ∇G2 (0, 0), and L is the y–axis. Let the coordinates of the points q, r, s be (0, k1 ), (0, k2 ) and (0, k3 ), respectively, with certain constants k1 , k2 and k3 . The zero contours of G1 and G2 pass through p and they have the same tangent at this point. Thus, a0,0 = b0,0 = 0, a1,0 = b1,0 and a0,1 = b0,1 . The conditions (ii) − (iv) give 9 linear equations. By solving this system of equation, it is easy to show that after multiplying F2 by (k2 c0,2 )/(k1 d0,2 ), the coefficients Ai,j , Bi,j of F1 (x, y) and F2 (x, y) respectively are equal whenever i ≤ 1. Hence, F1 (x, y) and F2 (x, y) meet with C 1 along L. The cases k1 = 0 and k2 = 0 are excluded since p is nonsingular. The ˆ and this is case c0,2 = 0 (d0,2 = 0) is the case where f2,1 (resp. f1,2 ) contains L; also excluded from the assumption (condition (i)). Remark 1. 1. A similar analysis shows that the theorem is also valid if s = q, s = r, or s = q = r (these are just degenerate cases). 2. In practice we choose s far away from p, in order to avoid singular points in the area of interest. Note that the above construction has one degree of freedom. 3. It should be noted that a C 1 joint along L can be achieved also (see Fig. 5) if: ˆ 2 or (a) f2,1 = f1,2 = L ˆ fˆ1 , f1,2 = L ˆ fˆ2 and fˆ1 G1 , fˆ2 G2 are joined with continuously (b) f2,1 = L ˆ ˆ along L, where f1 , f2 are two linear factors. These two cases are not interesting for applications, due to the presence of singularities. 4. It is clear that the transversal line passing through p should be chosen differently from the tangent to the curve at p. In the sequel of this paper, we assume that this assumption is always satisfied.
6
Joining Several Segments
Now we use the technique from the previous section in order to join more than two segments. As an example, Figure 6 shows three neighboring segments which
168
Mohamed Shalaby et al.
L G1 (x, y)
fˆ1 (x, y)
L G2 (x, y)
L G2 (x, y)
G1 (x, y)
G2 (x, y) G1 (x, y)
G1 (x, y)
G1 (x, y)
G2 (x, y)
ˆ2 f2,1 = f1,2 = L
fˆ2 (x, y)
fˆ1 (x, y)
fˆ2 (x, y)
G2 (x, y)
G1 (x, y)
ˆ fˆ1 , f2,1 = L
ˆ fˆ2 f1,2 = L
G2 (x, y)
ˆ Fig. 5. Multiplying by quadratic polynomial factors contain L
ri−1 f2,i−1
Gi
qi
f1,i
Gi−1
f2,i
qi−1
Gi−1
li+1 Li
Li−1 pi−1
f1,i+1 si
li
li−1
Gi+1
ri
si−1
Gi+1 Gi
pi
Fig. 6. The original curve (black) and the quadratic polynomial factors (gray)
are described by bivariate polynomials Gi−1 , Gi and Gi+1 . In order to join Gi−1 and Gi along Li−1 , we multiply Gi−1 by f2,i−1 and Gi by f1,i where f2,i−1 , f1,i are quadratic polynomial factors satisfying the conditions (i) − (iv). Similarly, by multiplying Gi , Gi+1 with f2,i , f1,i+1 , respectively, we join these segments along Li . In general, the polynomials f1,i and f2,i are different. Thus, we split the i-th patch again into two sub-patches by a line li and join the two different factors with C 1 continuity along it. 6.1
The Algorithm
According to Theorem 1, we may achieve a C 1 –joint along the transversal lines passing through the junction points pi , after multiplying with suitable quadratic
C 1 Spline Implicitization of Planar Curves
169
polynomial factors. In order to obtain a globally C 1 spline function, we propose the following algorithm (see Fig. 6): 1. Divide the plane into patches by arbitrary lines Li passing through the junction points pi . For instance, one may choose the normals to the curve. 2. Each internal patch (from the second to the m − 1th patch, where m is the number of patches) is subdivided into two sub–patches by an arbitrary line li . For instance, one may choose the normal to the curve at the midpoint. 3. On the first boundary patch, we multiply by a quadratic polynomial factor f2,1 such that Z(f2,1 ) is tangent continuous with the next parabola Z(G2 ) at r1 . 4. The next patch is modified by applying a piecewise quadratic multiplier, defined as a quadratic polynomial f1,i and f2,i on each of the two subpatches. The multiplier has to satisfy the following conditions: – It must be C 1 on the whole patch. – Z(f1,i ) is tangent continuous with the previous parabola Z(Gi−1 ) at qi−1 . – Z(f1,i ) is tangent continuous with Z(f2,i−1 ) at si−1 . – Z(f2,i ) is tangent continuous with the next parabola Z(Gi+1 ) at ri . The first condition is fulfilled by a 7–dimensional linear space of spline functions. The other three conditions give two homogeneous linear conditions each1 . This results in a homogeneous system of equations, which provides at least one nontrivial solution. 5. The previous step is repeated until one arrives at the last segment. 6. Finally, a similar construction as in Step 3 is used for the last segment. Remark 2. 1. Theoretically, it could happen that the nontrivial solution computed in step 4 vanishes with multiplicity two along the transversal line. In this case, we cannot form a global C 1 function, because the multiplying constant would be zero. The next Lemma analyzes this degenerate case in more detail, showing that it can be excluded in practice. 2. The above construction provides two degrees of freedom. When joining the first two patches, one may choose the location of the point s1 and the slope of tangent T1 (the tangent of f2,1 at s1 ). In general, the multipliers which are applied to the other patches are then determined up to scalar constants. Lemma 1. Consider the situation of step 4, see figure 7. In addition, we assume that the following assumptions are satisfied. – – – – 1
The three points pi−1 , qi−1 and si−1 are distinct. The three points pi , ri and si are distinct. Li−1 does not pass through ri . Li does not pass through qi−1 or si−1 .
The zero contours of two bivariate functions h1 and h2 are tangent continuous at a point p ∈ R2 , if h1 (p) = h2 (p) and det(∇h1 (p), ∇h2 (p)) = 0. This leads to two homogeneous linear equations.
170
Mohamed Shalaby et al.
Gi
ri−1 T1 Gi−1
T3 ri
si−1 f2,i−1
T2
qi
Gi+1
f1,i
f2,i
qi−1
Gi−1
s2 Li
li
Li−1
Gi+1
pi−1
Gi
pi
Fig. 7. Step 4 of the construction
– li does not pass through ri , qi−1 or si−1 . – li does not pass through the intersection points of Li−1 and T3 , Li and T1 , or Li and T2 , where T1 is the tangent of f1,i at si−1 , T2 is the tangent of f1,i at qi−1 , and T3 is the tangent of f2,i at ri . Then the nontrivial solution obtained in Step 4 does not vanish along the transversal lines Li−1 or Li . Proof. Let f1,i = c0,0 + c1,0 x + c2,0 x2 + c1,1 xy + c0,1 y + c0,2 y 2 and f2,i = d0,0 + d1,0 x + d2,0 x2 + d1,1 xy + d0,1 y + d0,2 y 2 . By normalization and suitable choice of coordinates, we may achieve that pi−1 = (0, 0) and Li−1 is the y–axis. Let li be defined by y − y0 − m0 (x − x0 ) = 0 If f1,i and f2,i are C 1 along li , then f1,i = c0,0 + c1,0 x + c2,0 x2 + c1,1 xy + c0,1 y + c0,2 y 2 f2,i = f1,2 + (d0,2 − c0,2 )(y − y0 − m0 (x − x0 ))2 .
and
Let m1 , m2 and m3 be the slopes of T1 , T2 and T3 respectively. Moreover let (0, y1 ), (0, y2 ) and (x3 , y3 ) be the coordinates of qi−1 , si−1 and ri , respectively. Z(f1,i ) passes through qi−1 , si−1 and has tangents T2 , T1 at these points. Also, Z(f2,i ) passes through ri and tangent T3 there. This gives 6 homogeneous linear conditions for 7 unknowns (d0,2 and ck,j , k, j = 0..2, k + j ≤ 2).
C 1 Spline Implicitization of Planar Curves
171
Assume that c0,0 = 1, i.e., f1,i does not vanish at Li−1 . Then we get a system of 6 linear equations for 6 unknowns. By factoring the determinant of the coefficient matrix we get 2 y1 y2 (y1 − y2 ) x3 (y3 − y0 − m0 (x3 − x0 )) (y3 − m3 x3 − y0 + m0 x0 ) 1, 2, 3
4
5
6
Clearly, there exist two quadratic factors f1,i and f1,i satisfying the above conditions if the determinant is not equal to zero. The first three factors vanish if the three points pi−1 , qi−1 and si−1 are not identical. The fourth factor vanishes if Li−1 passes through ri , and the fifth factor vanishes if li passes through ri . The lines L1 and T3 intersect at (0, y3 −m3 x3 ). Consequently, the sixth factor vanishes if li passes through the intersection point of Li−1 and T3 . Analogously, by applying the same technique to f2,i and Li , it can be shown that the three points pi , ri and si should be distinct, Li−1 should not pass through qi−1 or si−1 , li should not pass through qi−1 or si−1 , and li should not pass through intersection points of Li and T1 , or L2 and T2 . As the main problem of this construction, the coordinates of the point si depend on the coordinates of the previously generated point si−1 . After the first patch, we do not have any control on the coordinates of the points sl , l = 2, . . . , m − 1 where m is the number of the patches2 . Hence, sl may coincide with pl , ql or rl , i.e the polynomial factors vanish on the transversal line. Moreover, the polynomial factors may intersect the original curve at the area of interest. As an example, Fig. 8 shows the original curve segments (black) and the quadratic polynomial factors (gray), these factors intersecting the original curve at points A∗ and B ∗ . Here, the intersection at the point A∗ is not so important because this happened far away from our area of interest. The main problem is at the point B ∗ . In order to avoid this problem, we will localize our approach. 6.2
The Modified Algorithm
If there is an intersection of the quadratic polynomial factors and the original curve, or sl coincides with pl , ql or rl , then we introduce an unwanted singularity in the region of interest. There is degree of freedom to choose the point s1 and the tangent T1 , but it may not be sufficient to guarantee that there is a choice avoiding singularities. This problem can be avoided by dividing each patch to 4 sub-patches instead of 2 sub-patches. Below, we give the sketch of the modified algorithm (see Fig. 9). 1. Divide the plane into patches by arbitrary lines Li passing through the junction points pi . For instance, one may choose the normals to the curve. 2
It is the same problem as for C 1 interpolation with quadratic splines. Once we fix the tangent direction for the first quadratic function we do not have freedom to choose any of the tangent directions afterwards.
172
Mohamed Shalaby et al.
A∗ li−1
Gi+2 li+2
Gi
Li+1 Gi−1
Gi+2 Li
Li−1 Gi−1 Gi
li+1
li Gi+1
B∗
Fig. 8. The quadratic factors intersect the original curve at A∗ , B ∗ Gi
ri−1
qi
f3,i−1 f4,i−1 si−1 f1,i
Gi−1
f2,i
f3,i
f4,i
qi−1 li−1
mi−1
Gi+1
ri
ni
mi
li
f1,i+1
f2,i+1
si Li
ni+1
Li−1
Gi+1
Gi−1 pi−1
li+1
Gi
pi
Fig. 9. The original curve (black) and the modified quadratic factors (gray) 2. Each internal patch (from patch 2 to patch m − 1, where m is the number of patches) is subdivided into 4 sub-patches by arbitrary lines li , ni , mi . For instance, one may choose the normals to the curve at three equally spaced points. 3. On the first boundary patch, we multiply by a factor f4,1 of degree 2 such that Z(f4,1 ) is tangent continuous with the next parabola Z(G2 ) at r1 . 4. On the next patch, we multiply by a piecewise multiplier, defined as a quadratic polynomial f1,i , f2,i , f3,i , and f4,i on each of the four sub-patches. It has to satisfy the following conditions: – It must be C 1 within the whole patch.
C 1 Spline Implicitization of Planar Curves 8
8
6
y4
6
Ti
y4
si
Gi−1
Gi+1
Gi
2
0
2
4
x
6
8
10
Ti Gi+1
Gi
2
0
si
Gi−1
2
4
x
6
8
6
6
Ti y4
si
Gi−1 Gi
2
0
10
8
8
y4
173
Gi+1
4
x
6
8
10
Ti
si
Gi+1
Gi
2
0 2
Gi−1
2
4
x
6
8
10
Fig. 10. Using the slope of the tangent Ti to control the curve locally – Z(f1,i ) is tangent continuous with the previous parabola Z(Gi−1 ) on qi−1 . – Z(f1,i ) is tangent continuous with Z(f4,i−1 ) at si−1 . – Z(f4,i ) is tangent continuous with the next parabola Z(Gi+1 ) at ri . The first condition is fulfilled by a 9-dimensional vector-space of splines. The other three conditions give two linear conditions each, so we gain two additional degrees of freedom. After choosing these two degrees of freedom (see below) there is a nontrivial solution. 5. The previous step is repeated until one arrives at the last segment. 6. Finally, a similar construction as in Step 3 is used for the last segment. 6.3
Using the Additional Degree of Freedom
Using the above algorithm, for each internal patch, we gain two additional degrees of freedom. They can be used to control the curve locally. This can be done by choosing the intersection point si and the slope of tangent Ti at this point. Fig. 10 shows the original curve (black) and the polynomial factors (gray) for different choice of the tangent Ti at si . If there is an intersection between the polynomial factors and the original curve at any patch (for instance patch i) or si coincide with pi , qi or ri , we modify the coordinate of si or the slope of Ti at this patch to avoid the intersection. Any such modification will act locally and affect only two patches (patch i and patch i + 1). Clearly, subdividing into four sub–patches is more expensive than subdividing into two sub–patches, and it leads to a higher data volume. In practice, one may
174
Mohamed Shalaby et al.
A∗
A∗
Ti+1
si+1
B∗
Fig. 11. Using the two additional degree of freedom to avoid the intersection between the quadratic factors and the original curve
use the following method. First, divide each patch into two sub–patches. Only if a singularity is introduced at patch i, then we discard the two sub-patches and subdivide into four sub–patches. Fig. 11 shows the same example of Fig. 8. In the left figure, the polynomial factors intersect the original curve at points A∗ , B ∗ . After using the localized method, we avoid the intersection between the quadratic polynomials factors and the original curve at the area of interest (right figure). We kept the intersection at points A∗ because it is far away from the area of interest. Remark 3. According to our experience, it is possible to avoid singularity by using 4 sub–patches. A theoretical investigation may be a matter of future research. Example (finished) We start with the piecewise quadratic function whose zero contour G(x, y) = 0 is the quadratic B–spline curve in Fig. 3. We multiply by suitable quadratic polynomial factors. As a result, we get a C 1 bivariate function consists of 13 segments. Fig. 12 shows the algebraic offsets3 (thin lines) of Z(G) (thick line) and the transversal lines through the junction points. To make the picture clearer, we enlarge a part of the curve and draw some additional algebraic offsets, see Fig. 13. It can clearly be seen that the algebraic offsets are tangent continuous.
7
Conclusion
We have derived a method for constructing a low degree C 1 implicit spline representation of a given parametric planar curve. The construction consists of 3
The algebraic offsets are the curves Z(G − c), where c = 0 is a certain constant.
C 1 Spline Implicitization of Planar Curves
10 9 8 y7 6 5 4
2
4
6
8
10 x
12
14
16
18
175
20
Fig. 12. C 1 implicitized curve and its algebraic offsets 11 10.5 10 9.5 y 9 8.5 8 7.5 10
11
x
12
13
14
Fig. 13. C 1 Implicitized curve and its algebraic offsets (enlarged)
four steps: B–spline curve approximation, knot removal, segment implicitization and segment joining. Compared to the existing methods for implicitization, our method has the following advantages. – The method is computationally simple. In particular, no evaluations (symbolic or numerical) of large determinants are needed. – It produces a low degree implicit representation. For instance, the intersection of a line with the implicitized curve can be found by computing the roots of a quartic polynomial. – The methods avoids unwanted branches or singularities. Figure 14 shows a parametric cubic curve. Although the parametric curve has no singularities, the implicitized curve, using exact implicitization, has a singular point (see
176
Mohamed Shalaby et al.
Fig. 14. A cubic parametric curve.
Fig. 15. Exact implicitized curve and its algebraic offsets
Fig. 16. C 1 implicitized curve and its algebraic offsets
Fig. 15). This can be avoided by using the spline implicitization, see Fig. 16. – The implicit function is globally C 1 continuous. – The method can be applied to any parametric curve with coordinate functions in the Sobolev space H 2,2 , not just to polynomial or piecewise polynomial representations. As a matter of future research, we plan to find out an automatic method for adjust the tangents slope (for the modified algorithm 6.2) and generalize this method to surfaces.
Acknowledgements This research has been supported by Austrian science fund (FWF) in the frame of the Special Research Program (SFB) F013 “Numerical and Symbolic Scientific Computing”, project 15. The second author has also been supported by the European Commission through its Fifth Framework Programme (Project GAIA II entitled “Intersection algorithms for geometry based IT-applications using approximate algebraic methods”, contract no. IST-2002-35512)
References [1] B. Buchberger, Application of Gr¨ obner bases in non-linear computational geometry, in: J. Rice, (ed.), Mathematical Aspects of Scientific Software, Springer, New York/Berlin, 1988, pp. 59–87. 161 [2] J. H. Chuang and C. M. Hoffmann, On local implicit approximation and its application, ACM Trans. Graphics 8, 4 (1989), pp. 298–324. 162 [3] D. Cox, J. Little, and D. O’Shea, Ideals, varieties and Algorithms, Springer-Verlag, New York, 1997. 161 [4] C. K. Chui and E. Quak, Wavelets on a bounded interval, in: D. Braess, L. L. Schumaker (eds.), Numerical Methods in Approximation Theory Vol. 9, Birkh¨ auser, Basel, 1992, pp. 53–75. 164 [5] T. Dokken, Approximate implicitization, in: T. Lyche, L. L. Schumaker (eds.), Mathematical Method in CAGD, Vanderbilt University Press, Nashville London, 2001, pp. 81–102. 162
C 1 Spline Implicitization of Planar Curves
177
[6] M. Eck, and J. Hadenfeld, Knot removal for B-spline curves, Computer Aided Geometric Design 12 (1995), pp. 259–282. 164 [7] J. Hoschek and D. Lasser, Fundamentals of Computer Aided geometric Design, A K Peters, Ltd., Wellesley, Massachusetts, 1993. 162 [8] B. J¨ uttler, J. Schicho and M. Shalaby, Spline Implicitization of Planar Curves, in: T. Lyche, M. Mazure, and L. L. Schumaker (eds.), Curves and Surfaces Design: Saint–Malo 2002, Nashboro press, Brentwood 2003, ISBN 0–9728482–0–7, pp. 225–234. 162, 164 [9] B. J¨ uttler, Bounding the Hausdorff Distance of Implicitly Defined and/or Parametric Curves, in T. Lyche and L. L. Schumaker (eds.), Mathematical Methods in CAGD: Oslo 2000, Vanderbilt University Press, Nashville 2001, pp. 223–232. 162 [10] T. Lyche, Knot removal for spline curves and surfaces, in E. W. Cheney, C. Chui, and L. Schumaker (eds), Approximation Theory VII, Academic Press, New York, 1992, pp. 207–226. 164 [11] Y. de Montaudouin, W. Tiller, and H. Vold, Application of power series in computational geometry, Computer-Aided Design 18, 10, 1986, pp. 93–108. 162 [12] U. Reif, Orthogonality Relations for Cardinal B-Splines over Bounded Intervals, in: W. Strasser, R. Klein and R. Rau (eds.), Geometric Modeling: Theory and Practice, Springer, 1998, pp. 56–69. 162, 163 [13] T. W. Sederberg and F. Chen, Implicitization using moving curves and surfaces, in: R. Cook, (ed.), Computer Graphics 29 (SIGGRAPH ’95 Conference Proceedings), pp. 301–308, Addison-Wesley, Reading, MA. 161 [14] T. W. Sederberg, J. Zheng, K. Klimaszewski and T. Dokken, Approximate Implicitization Using Monoid Curves and Surfaces, Graphical Models and Image Processing 61, 1999, pp. 177–198. 162 [15] E. J. Stollnitz, T. D. Derose, and D. H. Salesin, Wavelets for Computer Graphics: Theory and Applications, Morgan-Kaufmann Publishers, Inc., San Francisco, 1996, pp. 90–97. 164 [16] P. Wojtaszczyk, A Mathematical Introduction to wavelets, Cambridge University Press, 1997, pp. 51–65. 164
Analysis of Geometrical Theorems in Coordinate-Free Form by Using Anticommutative Gr¨ obner Bases Method Irina Tchoupaeva Moscow State University, Russia, Department of Mechanics and Mathematics, LCM [email protected] Abstract. In this paper we present an algorithm to prove geometric theorems with the Gr¨ obner basis method in Grassman algebra based on a coordinate-free approach.
1
Introduction
During last few years several approaches to prove geometrical theorems have been developed. Some of them require the introduction of coordinates for the points involved (see [4] and [7]), but the others use the vector calculation (see [5] and [16]). The approaches which deal with coordinate system may use the method of commutative Gr¨ obner bases, Ritt’s bases etc. The method described in [16] and [5] work with the Gr¨ obner bases in vector space. Wang in his work [21] mentions coordinate-free technique by introducing the outer product of the vectors and the Grassman algebra, generated by the points of the theorem. Those points are treated as the vectors drawn from the origin 0. We will consider this approach in order to analyse the geometrical theorems in affine m -dimensional space. The theory of non-commutative Gr¨ obner bases was developed by Mora [12], and the reader can refer to [13] and [14] for more details. It was El From [9] who introduced the algebras of solvable type. In work [11] the authors introduce the theory of Gr¨ obner bases in algebras of solvable type. They decide the problem of ideal membership in such type of algebras. Clifford and Grassman algebras may be considered as quotients of a solvable polynomial ring by a two-side ideal, generated by the system {Xi2 −qi : 1 ≤ i ≤ n}. This system is a Gr¨obner basis of the ideal they generate. Hartley and Tuckey [10] consider Gr¨ obner bases of one-side ideal in Clifford and Grassman algebras. In our work we consider the automated proving of geometry theorems, by using Gr¨ obner bases in Grassman algebra. Because we consider the theorems of affine geometry in coordinate-free form, we have no restriction on dimension, which exist in coordinate technique. In our case we can analyze the dimension of the space, generated by points (vectors) of the theorem, and we can find the maximal dimension of the space in which the theorem will be generally true. The corresponding algorithms are also presented. F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 178–193, 2004. c Springer-Verlag Berlin Heidelberg 2004
Analysis of Geometrical Theorems in Coordinate-Free Form
2
179
Geometrical Theorems in Coordinate-Free Form
Primarily, let us describe objects and tasks which will be considered. We deal with geometrical theorems in m-dimensional affine space IRm , where m ∈ IN0 . Let {A1 , A2 , A3 , . . . , An } ∈ IRm be points of the theorem. We treat these points as vectors drawn from the origin 0. Then, geometrically, the outer product of two vectors A and B is the bivector corresponding to the parallelogram obtained by sweeping vector A along vector B. The parallelogram obtained by sweeping B along A differs from the parallelogram obtained by sweeping A along B only in the orientation. Let us consider the algebra generated by points A1 , A2 , A3 , . . . , An with an outer product A ∧ B, which is associative and anticommutative: A ∧ B = −B ∧ A. This algebra is called Grassman algebra. We will consider the Grassman algebra over the field of real numbers. It can be easily proven that the monomial is equal to zero, if it involves a variable in the power at least two. The dimension of this algebra is equal to 2n (the number of all non-zero monomials). In the Grassman algebra some geometrical statements may be formulated in these terms as polynomials. Data of a theorem contain a finite number of points A1 , . . . , An and a finite number of k1 , . . . , kl -dimensional subspaces of IRm , k1 , . . . , kl ≤ m and their properties. We consider that statement, which can be described by polynomials in Grassman algebra. Assuming that the dimension of our space m ≥ (n − 1), because in general case n points define an (n − 1)-space, and considering space with m < (n − 1), we put some restrictions on initial independent points. Let the theorem consist of a number of hypotheses H1 , . . . , Hs and conclusion C. Then, these geometrical statements correspond to polynomials h1 , . . . , hs ∈ Gr and c ∈ Gr. In Chou’s collection of examples [4] of the two-dimensional geometrical theorems there are some geometrical statements of constructive type, which can be written as polynomials of their coordinates. And the first question is: which of these statements can be rewritten in the coordinate-free form? One can easily check that the following assertions hold: 1. three points A1 , A2 , A3 are collinear iff (A1 − A2 ) ∧ (A1 − A3 ) = 0; 2. lines A1 A2 and A3 A4 are parallel iff (A1 − A2 ) ∧ (A3 − A4 ) = 0; 3. a point A3 divides the interval [A1 ; A2 ] in the ratio n : m iff m(A3 − A1 ) = n(A2 − A3 ) = 0. Then, the second question arises: which statements of an m-dimensional space can be written as polynomials in Grassman algebra? The answer depends on the properties of the outer product of the vectors. They do not allow us formulate conditions concerning angles and circles; thus, we are not able to do this in terms of the Grassman algebra. But we can formulate the statement about parallel and intersecting subspaces. And the third question is: what kind of polynomials in the Grassman algebra may be treated as statements of algebraic geometry? Only homogeneous polynomials can have a geometrical sense in Grassman algebra. Then, the third question transforms into the question: what kind of
180
Irina Tchoupaeva
homogeneous polynomials can be treated as statements of algebraic geometry? Let us formulate the following statements: 1. (k + 2) points {Ai1 , . . . , Aik+2 } ⊆ {A1 , . . . , An }, k + 2 ≤ n ≤ m + 1, belong to the same k-dimensional subspace IRk ⊆ IRm or, in other words, the point Aik+2 belongs to the k-subspace defined by the points Ai1 , . . . , Aik+1 iff (1) (Ai1 − Aik+2 ) ∧ · · · ∧ (Aik+1 − Aik+2 ) = 0 , where {i1 , . . . , ik+2 } ⊂ {1, . . . , n}; 2. two k-dimensional spaces are parallel, i.e., S1 S2 ⊂ IRm , iff ∀ (k + 1) points A1 , . . . , Ak+1 ∈ S1 and any two points B1 , B2 ∈ S2 we have (A1 − Ak+1 ) ∧ · · · ∧ (Ak − Ak+1 ) ∧ (B1 − B2 ) = 0 ;
(2)
3. (k + 2) points A1 , . . . , Ak+2 , k + 2 ≤ n ≤ m + 1, belong to the same kdimensional subspace IRk of IRm and the proportion is known iff α1 (A1 − Ak+2 ) + · · · + αk+1 (Ak+1 − Ak+2 ) = 0, where α1 , . . . , αk+1 ∈ IR; 4. as a generalization of the previous expressions, a linear dependence of a finite number of k-vectors means that α(i1 ,...,ik ) Ai1 ∧ · · · ∧ Aik = 0 . (3) (i1 ,...,ik )∈IRk
For example, the statement two points are equal (A − B = 0), meaning that the two points belong to the same 0-dimensional subspace is a particular case of this kind of statements. Thus, all homogeneous polynomials may be treated as some statements of algebraic geometry.
3
Gr¨ obner Bases in Grassman Algebra
The theory of Gr¨ obner bases of two- and one-side ideals in Grassman algebra as a particular case of algebras of solvable type in [11] and in [10]. We briefly describe this problem. Let Gr be the Grassman algebra in the variables x1 , . . . , xn over the field K = IR. This is the associative anticommutative algebra, which consists of Grassman polynomials (i1 ,...,ik ) αi1 ,...,ik xi1 ∧ · · · ∧ xik . For all homogeneous polynomials f, g ∈ Gr of degree deg(f ) = deg(g) = 1 we have f ∧ g = −g ∧ f and f ∧ f = 0. The maximal degree of monomials in Gr is equal to n and the dimension of this algebra equals 2n . By analogy with the commutative case, where the terms can be treated as points in ZZ n , any term in Gr t = xi1 ∧ · · · ∧ xik = xu1 1 ∧ · · · ∧ xunn with 1 ≤ i1 < · · · < ik ≤ n, where i1 , . . . , ik are the indices of variables with non-zero power in the product, and uj ∈ {0, 1}, j = 1, . . . , n, can be treated as the point (u1 , . . . , un ) ∈ {0, 1}n. This representation is used in our implementation. In this terms we can write the result of multiplication and the result of division of two ¯. monomials. For simplification we write multidegree (a1 , dots, an ) as a
Analysis of Geometrical Theorems in Coordinate-Free Form
181
Example 1. For Gr = x1 , x2 , x3 , x4 and u = x1 ∧ x4 we have i1 = 1, i2 = 4, (u1 , u2 , u3 , u4 ) = (1, 0, 0, 1) ∈ {0, 1}4. The product of two monomials m1 and m2 , where m1 = α · xa1 1 ∧ · · · ∧ xann of multidegree a ¯ ∈ {0, 1}n with non-zero components at the positions 1 ≤ i1 < · · · < ik ≤ n and m2 = β · xb11 ∧ · · · ∧ xbnn of multidegree ¯b ∈ {0, 1}n with non-zero components at the positions 1 ≤ j1 < · · · < jl ≤ n, may be written as the monomial m = m1 ∧ m2 , 0, if a ¯ ¯b = (0, . . . , 0) , (4) m= (α · β) · (−1)σ · xc11 ∧ · · · ∧ xcnn , if a ¯ ¯b = (0, . . . , 0) where c¯ ∈ {0, 1}n is a vector with non-zero elements at the positions 1 ≤ h1 < · · · < hs ≤ n, s = k + l, and, as a non-ordered set, {h1 , . . . , hs } is equivalentto ¯ ¯b. the union of two non-ordered sets {i1 , . . . , ik } ∪ {j1 , . . . , jl } such that c¯ = a Here, σ is the sign of the permutation (i1 , . . . , ik , j1 , . . . , jl ). Example 2. If m1 = 5 · x1 ∧ x4 and m2 = 3 · x2 , we have (a1 , a2 , a3 , a4 ) = (1, 0, 0, 1) ∈ {0, 1}4, (b1 , b2 , b3 , b4 ) = (0, 1, 0, 0) ∈ {0, 1}4, i1 = 1,i2 = 4 and j1 = 2. Thus, deg(t1 ) = k = 2 and deg(t2 ) = l = 1, (a1 , a2 , a3 , a4 ) (b1 , b2 , b3 , b4 ) = (0, 0, 0, 0), σ = sign(1, 4, 2) = 1 and (c1 , c2 , c3 , c4 ) = (1, 1, 0, 1). Thus m = m1 ∧ m2 = −15 · x1 ∧ x2 ∧ x4 . We introduce the partial order ≥ on the set {0, 1}n as follows: we write (a1 , . . . , an ) ≥ (b1 , . . . , bn ) iff ∀i ∈ {1, . . . , n} ai ≥ bi . In these terms we can write the result of division of one monomial m1 = (−1)σa · xa1 1 ∧ · · · ∧ xann with non-zero entries at the positions 1 ≤ i1 < · · · < ik ≤ n by another one m2 = (−1)σb · xb11 ∧ · · · ∧ xbnn with non-zero entries at the positions 1 ≤ j1 < · · · < jl ≤ n. We can see, that m1 is divisible by m2 , iff the inequality a ¯ ≥ ¯b holds. Therefore, m1 = (−1)σu u ∧ m2 , where σu monomial mr = (−1) ·u is right quotient and can be described by the following way. (u1 , . . . , un ) = (a1 − b1 , . . . , an − bn ) with non-zero entries at the positions 1 ≤ h1 < · · · < hs ≤ n is the multidegree of this monomial, and σu is the sign of the permutation (h1 , . . . , hs , j1 , . . . , jl ). According this description, one can easily construct an algorithm for finding the right quotient of a monomial ma by a monomial mb : mr = RightQuotient(ma , mb ) .
(5)
By analogy one can construct the left quotient ml = LeftQuotient(ma , mb ). By analogy with the commutative case, after introducing an admissible mono mial order on Gr, for each polynomial Gr p = (i1 ,...,in ) α(i1 ,...,in ) xi11 ∧ · · · ∧ xinn we can define its leading monomial lm(p) = u and its leading coefficient lcoeff(p) = α. Knowing the leading monomials, we can find the normal form NForm of the polynomial p by the set of polynomials p1 , . . . , pk , using any normal form
182
Irina Tchoupaeva
algorithm. A Gr¨ obner basis of an ideal I in Gr is a set of polynomials g1 , . . . , gs ∈ I Gr such that
lterm(g1 ), . . . , lterm(gs ) = lterm(I) .
(6)
Gr is a finite dimensional algebra, hence, any ideal I Gr is the finite dimensional, therefore any ideal has a finite Gr¨ obner basis in Gr. Proposition 1. Let ma and mb be monomials in Gr, ma = α · xa1 1 ∧ · · · ∧ xann and mb = β ·xb11 ∧· · ·∧xbnn and α, β = 0, (a1 , . . . , an ), (b1 , . . . , bn ) ∈ {0, 1}n. Then 1 we can find the least common multiple m as a monomial m = (−1)σ γ ·xm 1 ∧· · ·∧ mn xn such that (m1 , . . . , mn ) = (a1 , . . . , an ) (b1 , . . . , bn ) and γ = lcm(α, β). Proof. First, ma and mb divide m, and, second, there is no term m1 with the property m1 ≺ m such that m1 is divisible by both ma and mb . The Gr¨ obner bases algorithm for Grassman algebra can be found in [11] and [10]. The representation, described in this section, we use in our program module for analyzing the geometrical theorems.
4
Gr¨ obner Bases Method Applied to Coordinate-Free Geometry
To prove this kind of theorems, which are formulated in the coordinate-free form, the theory of anticommutative Gr¨ obner bases may be applied. The polynomials corresponding to the hypotheses of a theorem are considered as generators of an ideal in the Grassman algebra. The Grassman algebra is generated by points A1 , . . . , An of our theorem over the field IR. Let the theorem consist of a number of hypotheses H1 , . . . , Hs and a conclusion C. Then, these geometrical statements correspond to polynomials h1 , . . . , hs ∈ Gr and c ∈ Gr. Geometrical statements (hypotheses of the theorem) are formulated as polynomials in Gr: h1 (A1 , . . . , An ) = 0 .. (7) . hs (A1 , . . . , An ) = 0 and c(A1 , . . . , An ) = 0 is the conclusion. Definition 1. Let {h1 , . . . , hs } ⊂ Gr be a set of polynomials corresponding to the hypotheses of the theorem and c ∈ Gr be a polynomial corresponding to the conclusion of the theorem. We say that the theorem is generally true if, for each solution (A01 , . . . , A0n ) ∈ (IRm )n of the system h1 = 0, . . . , hs = 0, we have c(A01 , . . . , A0n ) = 0. It is well known, that the radical of the ideal I in an algebra A is the set √ I = {f ∈ A : ∃n ∈ IN f n ∈ I} . (8)
Analysis of Geometrical Theorems in Coordinate-Free Form
183
Definition 2. Let H(Gr) be the set of all homogeneous polynomials of Gr, and Hk (Gr) be the set of all homogeneous polynomials of Gr of degree k. Proposition 2. For each f ∈ Hk (Gr), 1 ≤ k ≤ n, we have f n+1 ≡ 0. Proof. Let f be a homogeneous polynomial of the degree k ≥ 1. Then f n+1 will be also homogeneous polynomial of the degree k · (n + 1) ≥ n + 1 > n, but non-zero monomial in Gr(A1 , . . . , An ) may have a maximal degree n. By this proposition, any for any homogeneous polynomial f with √ the degree deg(f ) ≥ 1, and for any ideal I Gr(A1 , . . . , An ) we have f ∈ I. To exclude this situation let us introduce a pseudo radical of the ideal in Gr(A1 , . . . , An ) Note that, when formulating theorems, we use only homogeneous polynomials of degree deg(f ) ≥ 1. Definition Gr be an ideal in Grassman algebra. The pseudo radical √ ps 3. Let I n of I is I = {f ∈ k=1 Hk | ∃ m ∈ IN such that f m ≡ 0, f m ∈ I}. By Prop. 2 we have n √ ps I = {f ∈ Hk | ∃ 1 ≤ m ≤ n such that f m ≡ 0, f m ∈ I} .
(9)
k=1
√ ps Here, to verify whether non-constant homogeneous polynomial f ∈ I , we have to check only a finite number of inclusions f ∈ I, . . . f n ∈ I. Let G = {g1 , . . . , gq } be a finite Gr¨ obner basis of the ideal I Gr. The property f ∈ I is equivalent to zero reducibility of this polynomial f by G NForm(f, G) = 0 in Gr .
(10)
The following algorithm √ ps allows us to check whether non-constant homogeneous polynomial f ∈ I in Gr: Algorithm: InP seudoRadical(I, f) Input: I Gr, f ∈ nk=1 Hk √ ps Output: if f ∈ I or no begin Calculate a Gr¨ obner basis G of I for k = 1 to n do f k = f k; if (f k ≡ 0) then N F =NForm (f k, G); if (N F = 0) then √ √ ps return “f ∈ I ⊆ I” endif else √ √ ps return “f ∈ ( I \ I )” endif
184
Irina Tchoupaeva
endfor √ √ ps return “f ∈ ( I \ I )” end Proof. It is evident that the algorithm is terminated in a finite number of steps. n By Prop. 2 for polynomials f ∈ k=1 Hk we have to check only finite number of properties, if for some 1 ≤ k ≤ n f k ≡ 0, but NForm(f k , G) = 0. nNote, if for some k we have f k = 0, then f k+1 = 0. And f n+1 = 0 for all f ∈ k=1 Hk √ √ ps n Note, that I ⊆ k=1 Hk ⊆ I. If for some homogeneous polynomial f f k ≡ 0 for some 1 ≤ k ≤ n, then the set of solution of equation f k = 0 is the whole space of the set {A01 , . . . , A0n } ∈ (IRm )n . So, statements of the theorems we consider are the homogeneous polynomial of the degree greater then zero. It means that if conclusion of the theorem belongs to the pseudo radical, then the theorem is generally true. Thus, the idea is to take a theorem, reformulate it as a set of polynomials in Gr, calculate a Gr¨ obner √ psbasis of the ideal generated by these polynomials and verify whether c ∈ I in Gr. If the result is “yes”, then the theorem is generally true, otherwise we do not know whether the theorem is generally true. Most of generally true theorems in coordinate-free form can be verified by using this method.
5
Implementation
We implemented the algorithm for computing anticommutative Gr¨ obner bases and the normal form of polynomials with rational coefficients. The interface of our software is optimized to deal with the geometrical theorems in coordinatefree form. The user interface allows us to input data from the file on the internal metalanguage. This software was used for proving and analyzing some theorems. The main algorithm in the program is the following: Algorithm: P rover(T) Input: points A1 , . . . , An , order, hypothesis H1 , . . . , Hs , conclusion C Output: “the theorem is generally true”, if the theorem is true in general; “we do not know, if the theorem is generally true”, otherwise. begin reformulate statements in the polynomial form H1 , . . . , Hs , C =⇒ H1 , . . . , Hs , Conc ∈ nk=1 Hk ps if (Conc ∈ H1 , . . . , Hs ) return “The theorem is generally true”; else return “We do not know, if the theorem is generally true”; endif end The project ncbg was written on C++.
Analysis of Geometrical Theorems in Coordinate-Free Form
185
Example 3 (Gauss’ line theorem). Let be A1 A2 ∩ B1 B2 = A3 , A1 B2 ∩ B1 A2 = B3 , M1 is the midpoint of A1 B1 , M2 is the midpoint of A2 B2 and M3 is the midpoint of A3 B3 . Then M1 , M2 and M3 are collinear. We take nine points A1 , A2 , A3 , B1 , B2 , B3 , M1 , M2 , M3 in the space IRm for some m, see Fig. 1. And hypotheses: 1. 2. 3. 4. 5.
the line A1 A2 intersect the line B1 B2 in the point A3 the line A1 B2 intersect the line B1 A2 in the point B3 point M 1 is the midpoint of the segment A1 B1 point M 2 is the midpoint of the segment A2 B2 point M 3 is the midpoint of the segment A3 B3
Then the points M1 , M2 and M3 are collinear. Rewrite these conditions as a homogeneous polynomials in Grassman algebra. −1 ∗ A1 ∧ A3 + 1 ∗ A1 ∧ A2 + 1 ∗ A2 ∧ A3 +1 ∗ A3 ∧ B1 + 1 ∗ B1 ∧ B2 − 1 ∗ A3 ∧ B2 −1 ∗ A1 ∧ B3 + 1 ∗ A1 ∧ B2 + 1 ∗ B2 ∧ B3 −1 ∗ B1 ∧ B3 − 1 ∗ A2 ∧ B1 + 1 ∗ A2 ∧ B3 +1 ∗ A1 + 1 ∗ B1 − 2 ∗ M 1 +1 ∗ A2 + 1 ∗ B2 − 2 ∗ M 2 +1 ∗ A3 + 1 ∗ B3 − 2 ∗ M 3
(11)
And the conclusion is −1 ∗ M1 ∧ M3 + 1 ∗ M1 ∧ M2 + 1 ∗ M2 ∧ M3
(12)
Using pure lexicographical term order with the A1 > A2 > A3 > B1 > B2 > B3 > M 1 > M 2 > M 3, one can get the Gr¨ obner basis of the ideal, generated
A3
A2
M2
B2
M3
B3
M1 A1
Fig. 1. Gauss’ line theorem
B1
186
Irina Tchoupaeva
by the hypotheses: 1 ∗ M3 − 1/2 ∗ B3 − 1/2 ∗ A3 1 ∗ M2 − 1/2 ∗ B2 − 1/2 ∗ A2 1 ∗ M1 − 1/2 ∗ B1 − 1/2 ∗ A1 1 ∗ B3 ∧ B2 − 1 ∗ B3 ∧ A1 + 1 ∗ B2 ∧ A1 1 ∗ B3 ∧ B1 − 1 ∗ B3 ∧ A2 + 1 ∗ B1 ∧ A2 1 ∗ B2 ∧ B1 − 1 ∗ B2 ∧ A3 + 1 ∗ B1 ∧ A3 1 ∗ A3 ∧ A2 − 1 ∗ A3 ∧ A1 + 1 ∗ A2 ∧ A1
(13)
The normal form of the conclusion by the Gr¨ obner basis NForm(c, G) = 0, thus the theorem is generally true, and time of calculation is 0.531 sec. Example 4 (Pappus’ theorem). Let the points A1 , B1 , C1 are collinear, and the points A2 , B2 , C2 are collinear. And A1 B2 ∩ A2 B1 = M1 , A1 C2 ∩ A2 C1 = M2 and B1 C2 ∩ B2 C1 = M3 . Then the points M1 , M2 and M3 are collinear. Le A1, B1, C1, A2, B2, C2, M 1, M 2, M 3 be the points. If 1. 2. 3. 4. 5. 6. 7. 8.
the the the the the the the the
points points points points points points points points
A1, B1, C1 are collinear A2, B2, C2 are collinear A1, M 1, B2 are collinear A2, M 1, B1 are collinear A1, M 2, C2 are collinear A2, M 2, C1 are collinear B1, M 3, C2 are collinear B2, M 3, C1 are collinear
then the point M 1, M 2, M 3 are collinear. Rewrite these conditions as homoge-
C1 B1 A1 M1
A2
M M
3
2 B
2
Fig. 2. Pappus’ line theorem
C
2
Analysis of Geometrical Theorems in Coordinate-Free Form
187
neous polynomials in Grassman algebra. −1 ∗ A1 ∧ C1 + 1 ∗ A1 ∧ B1 + 1 ∗ B1 ∧ C1 −1 ∗ A2 ∧ C2 + 1 ∗ A2 ∧ B2 + 1 ∗ B2 ∧ C2 −1 ∗ A1 ∧ B2 + 1 ∗ A1 ∧ M1 − 1 ∗ B2 ∧ M1 +1 ∗ B1 ∧ A2 + 1 ∗ A2 ∧ M1 − 1 ∗ B1 ∧ M1 −1 ∗ A1 ∧ C2 + 1 ∗ A1 ∧ M2 − 1 ∗ C2 ∧ M2 +1 ∗ C1 ∧ A2 + 1 ∗ A2 ∧ M2 − 1 ∗ C1 ∧ M2 +1 ∗ C1 ∧ B2 + 1 ∗ B2 ∧ M3 − 1 ∗ C1 ∧ M3 −1 ∗ B1 ∧ C2 + 1 ∗ B1 ∧ M3 − 1 ∗ C2 ∧ M3
(14)
And the conclusion is 1 ∗ M1 ∧ M3 + 1 ∗ M1 ∧ M2 + 1 ∗ M2 ∧ M3
(15)
Using pure lexicographical term order with the A1 < A2 < A3 < B1 < B2 < B3 < M 1 < M 2 < M 3, we get the Gr¨ obner basis of the ideal, generated by the hypotheses: 1 ∗ A1 ∧ B1 − 1 ∗ A1 ∧ C1 + 1 ∗ B1 ∧ C1 1 ∗ A1 ∧ B2 − 1 ∗ A1 ∧ M1 + 1 ∗ B2 ∧ M1 1 ∗ A1 ∧ C2 − 1 ∗ A1 ∧ M2 + 1 ∗ C2 ∧ M2 1 ∗ B1 ∧ A2 − 1 ∗ B1 ∧ M1 + 1 ∗ A2 ∧ M1 (16) 1 ∗ B1 ∧ C2 − 1 ∗ B1 ∧ M3 + 1 ∗ C2 ∧ M3 1 ∗ C1 ∧ A2 − 1 ∗ C1 ∧ M2 + 1 ∗ A2 ∧ M2 1 ∗ C1 ∧ B2 − 1 ∗ C1 ∧ M3 + 1 ∗ B2 ∧ M3 1 ∗ A2 ∧ B2 − 1 ∗ A2 ∧ C2 + 1 ∗ B2 ∧ C2 The normal form of the conclusion by the Gr¨ obner basis NForm(c, G) = 0, and c2 ≡ 0, thus we do not have an answer if the theorem is generally true, time of calculation is 0.125 sec. Example 5 (Iteration Reflection). Let O1 , O2 , O3 be a triangle, M0 be an arbitrary point, M1 is the reflection of M0 on O1 , M2 is the reflection of M1 on O2 , M3 is the reflection of M2 on O3 , M4 is the reflection of M3 on O1 , M5 is the reflection of M4 on O2 . Then M0 is the reflection of M5 on O3 ,see Fig. 3. The hypotheses of the theorem as polynomials in Grassman algebra are: 1 ∗ M1 + 1 ∗ M0 − 2 ∗ O1 1 ∗ M2 + 1 ∗ M1 − 2 ∗ O2 1 ∗ M3 + 1 ∗ M2 − 2 ∗ O3 1 ∗ M4 + 1 ∗ M3 − 2 ∗ O1 1 ∗ M5 + 1 ∗ M4 − 2 ∗ O2
(17)
1 ∗ M5 + 1 ∗ M0 − 2 ∗ O3
(18)
and the conclusion:
188
Irina Tchoupaeva
M3
M1
O1
M4
O2
M5
O3
M0
M2 Fig. 3. Iterated reflection theorem Using pure lexicographical term order with the O1 < O2 < O3 < M 0 < M 1 < M 2 < M 3 < M 4 < M 5 we obtain the Gr¨ obner basis: 1 ∗ O1 − 1/2 ∗ M3 − 1/2 ∗ M4 1 ∗ O2 − 1/2 ∗ M4 − 1/2 ∗ M5 1 ∗ O3 − 1/2 ∗ M2 − 1/2 ∗ M3 1 ∗ M0 − 1 ∗ M2 − 1 ∗ M3 + 1 ∗ M5 1 ∗ M1 + 1 ∗ M2 − 1 ∗ M4 − 1 ∗ M5
(19)
The normal form of the conclusion by the Gr¨ obner basis NForm(c, G) = 0, and time of calculation is 0.109 sec.
6
Analysis of Geometrical Theorems in Coordinate-Free Form
So, we have a comprehensive space IRm and a theorem with its n points A1 , . . . , An ∈ IRm .
(20)
Let Spk be a set of statements such that all points of the theorem belong to the same k-dimensional space (for each set of points {Ai1 , . . . , Aik+2 } ⊂ {A1 , . . . , An }, one can construct a polynomial using the previous rules). We obtain Cnk+2 polynomials. For a fixed 1 ≤ k ≤ m, consider two classes of theorems: ¯ = {H1 , . . . , Hs } imply the statement that all 1. hypotheses of the theorem H points of this theorem lie in the same k-dimensional subspace IRk of IRm ; 2. all other theorems.
Analysis of Geometrical Theorems in Coordinate-Free Form
189
For the first class of theorems, we obtain the following: {H1 , . . . , Hs } =⇒ {Spk }
(21)
Notice that, if n points A1 , . . . , An are involved in the theorem, then, for any compatible set of hypotheses, we have {H1 , . . . , Hs } =⇒ {Spn−1 } ,
(22)
because any set of n points is contained in an (n − 1)-dimensional space. This can easily be verified using the Gr¨ obner bases method. Hence, we have that ∀ T ∃ 1 ≤ k(T) ≤ m such that {H1 , . . . , Hs } =⇒ {Spk(T) }. On the other hand, for any 1 ≤ k ≤ m, we have {Spk } =⇒ {Spk+1 } .
(23)
This can also be verified using the Gr¨ obner bases method. Therefore, the following implication holds: ({H1 , . . . , Hs } =⇒ C) =⇒ ({H1 , . . . , Hs , Spk } =⇒ C) .
(24)
This means that, if a theorem is generally true in IRm , then the projection of this theorem onto a subspace IRk ⊂ IRm (1 ≤ k ≤ m) is also generally true in IRk . Thus, we obtain that, if {H1 , . . . , Hs } =⇒ {Spk } and the theorem is generally true, then this theorem is generally true in any subspace Spk for 0 ≤ k ≤ n − 1. Definition 4. The dimension of a theorem T is the minimal number k(T) (1 ≤ k(T) ≤ m) such that {H1 , . . . , Hs } =⇒ {Spk }. To find the dimension k(T) of a theorems, one can use the following algorithm, using the notions above: Algorithm: DIM T heorem(T) Input: T = {H1 , . . . , Hs ; C} Output: k(T) begin for i = 0 to n − 1 do Prove ({H1 , . . . , Hs } =⇒ {Spi }) if (T RU E) then return i endif endfor end We see that the dimension of a theorem is a property of the hypotheses of this theorem. In other words, the dimension of a theorem in the minimal number 1 ≤ k(T) ≤ (n − 1) such that {H1 , . . . , Hs } =⇒ {Spk(T) } .
(25)
190
Irina Tchoupaeva
The number k(T) exists for each theorem, because for any set of hypotheses H1 , . . . , Hs the theorem T = {H1 , . . . , Hs ; Spn−1 } is generally true. Note that, if (26) {H, . . . , Hs , Spk } =⇒ {C} , then {H, . . . , Hs , Spk−1 } =⇒ {C} .
(27)
Example 6. As we can see, the theorem T = {H1 , . . . , H7 ; C} in Ex. 3 is generally true. And number of points in this task is equal to nine: P oints = {A1 , A2 , A3 , B1 , B2 , B3 , M1 , M2 , M3 }
(28)
In this case k(T) = 2. The set of conditions Spk , for k = 0 caan be written as a list of equations for each pair {Xi1 , Xi2 } ∈ P oints : Xi1 − Xi2 = 0 .
(29)
And we try to check a new theorem T = {H1 , . . . , H7 ; Sp0 }. But this theorem is not generally true. For example the new conclusion c = A1 − A2 do not reduce to the zero by Gr¨ obner basis of ideal of the hypothesis. The last statement in the power of 2 gives us a zero polynomial (c )2 ≡ 0. This means that our hypotheses do not give us a condition, that all points belong to the same 0 -dimensional space. Let us check the theorem T = {H1 , . . . , H7 ; Sp1 }. We also have not the answer, that the new theorem is generally true. If we take one of the conclusion, that point A1 , A2 and B1 are collinear, we will not obtain a generally true theorem. The condition c : 1 ∗ A1 ∧ B1 + 1 ∗ A1 ∧ A2 + 1 ∗ A2 ∧ B1
(30)
is not reduceable to the zero by the obtained Gr¨ obner basis, and (c )2 ≡ 0. But if we take the statement Sp2 as a conclusion of the theorem T = {H1 , . . . , H7 ; Sp2 }, we obtain the generally true theorem. So, the dimension of this task k(T) = 2. We can consider another property of the theorem T. Let 1 ≤ d(T) ≤ m be the maximal number such that {H1 , . . . , Hs , Spd(T) } =⇒ {C} ,
(31)
which we call the maximal dimension d(T) of the space in which this theorem is generally true. The number d(T) exists for any theorem, because, for any set of hypotheses H1 , . . . , Hs and any conclusion C , the theorem T = {H1 , . . . , Hs , Sp0 ; C } is generally true. So, we can construct the algorithm for finding d(T): Algorithm: d(T) Input: T = {H1 , . . . , Hs ; C}, k(T)
Analysis of Geometrical Theorems in Coordinate-Free Form
191
Output: d(T) begin For i = k(T) to 1 do Prove ({H1 , . . . , Hs , Spi } =⇒ {C}) if (T RU E) then return i endif endfor end By using this algorithm, we can find the maximal dimension d(T) of the space in which this theorem is generally true. For example, if we find that 1 ≤ k(T) ≤ m and {H, . . . , Hs } =⇒ {Spk(T) } ,
(32)
{H, . . . , Hs } =⇒ {C} ,
(33)
{H, . . . , Hs , Spd(T) } =⇒ {C} .
(34)
but and It means that 1 ≤ d(T) < k(T), and the additional conditions Spd(T) are some restrictions for A1 , . . . , An .
7
Advantages of the Coordinate-Free Method
In the commutative Gr¨ obner bases method we have to introduce a coordinate system (e1 , . . . , eq ), then all statements are projected onto the coordinate subspace IRq ⊆ IRm : Π : IRm −→ IRq (35) ¯ i , i = 1, . . . , s , Π : Hi −→ H ¯ i is a statement in the space IRq . All points A1 , . . . , An are also mapped where H to the coordinate subspace: Π : Ai −→ A¯i (xi1 , . . . , xiq ), i = 1, . . . , n
(36)
and for each point A¯j in the space IRq , j = 1, . . . , s, in the general case of coordinate system, we have to introduce q new variables xji , i = 1, . . . , q. So, we will have n · q variables for the theorem. Moreover, if q < (n − 1) ≤ m we have an additional constraint for points A1 , . . . , An of the theorem, but this constraint is absent in the coordinate-free method. This is equivalent to adding the properties Spq to the hypotheses. And it will be a restriction, also if q < d(T). • We analyze the dimension of the theorem k(T) and the maximal size of the space in which the theorem is generally true d(T). We can also do it in the coordinate case. But it requires much more efforts: we have either to take the size of the coordinate system q > (n − 1), or, at each step of the algorithm, to reformulate all conditions into a new coordinate system with q > q. But, in the coordinate-free case, this is not necessary.
192
Irina Tchoupaeva
• In the coordinate case, we have to make the preliminary analysis by choosing a good coordinate system to minimize the number of equations. We have to do this analysis for each theorem before checking it automatically. In the coordinate-free case, we have no coordinate system and do not need to make this analysis. • In the general coordinate case (without preliminary choosing the good coordinate system), we have q · n variables, but, in the coordinate-free case, we have only n variables, where n is the number of points in the theorem and q is the number of coordinate orts. • It is easier to interpret the Grassman polynomials as geometrical expressions. • All polynomials in the Buchberger algorithm can not have degree higher than n (where n is the number of points in the theorem), but it is a problem in the commutative case.
Acknowledgements I am grateful to my advisor E. V. Pankratiev for suggestions while preparing this paper and for many valuable remarks and to K. J. Andreev for the help while implemening the algorithms. The work was supported by the Russian Foundation for Basic Research, project no. 02-01-01033-a.
References [1] Buchberger, B.: Gr¨ obner bases: an algorithmic method in polynomial ideal theory. In N. K. Bose (ed.), Recent trends in multidimensional system theory. Reidel (1985) [2] Beresin, F. A.: The method of secondary quantization. In Polivanov, M. K. (ed.), NFMI (2000) [3] Beresin, F. A.: Introduction to the algebra and analysis with the anticommutative variables. In Palamodov, V. P. (ed.), Izdatelstvo Moskovskogo Universiteta, Moscow (1983) [4] Chou, S.-C.: Mechanical Geometry Theorem Proving. Mathematics and Its Applications, D. Reidel, Dordrecht (1987) 178, 179 [5] Chou, S.-C., Gao, X.-S., Zhang, J.-Z.: Automated geometry theorem proving by vector calculation. Proc. ISSAC ’93, In Bronstein, M. (ed.) ACM Press (1993) 284–291 178 [6] Cox, D., Little, J., O’Shea, D.: Using Algebraic Geometry. Springer, New-York (1998) [7] Cox, D., Little, J., O’Shea, D.: Ideals, Varieties, and Algorithms. An Introduction to Computational Algebraic Geometry and Commutative Algebra. Second edition, Springer, New-York (1998) 178 [8] Eisenbud, D., Peeva, I., Sturmfels, B.: Noncommutative Gr¨ obner Bases for Commutative Ideals. To appear in Proc. Am. Math. Soc. (1998) [9] El From, Y.: Sur les algebres de type resoluble. These de 3e cycle, Univ. Paris 6 (1983) 178
Analysis of Geometrical Theorems in Coordinate-Free Form
193
[10] Hartley, D., Tuckey, Ph.: Gr¨ obner bases in Clifford and Grassman algebras. J. Symb. Comput. 20(2) (1995) 197-205 178, 180, 182 [11] Kandry-Rody, A., Weispfenning, V.: Non-commutative Gr¨ obner bases in algebras of solvable type. J. Symb. Comp. 9 (1990) 1–26 178, 180, 182 [12] Mora, F.: Groebner bases for non-commutative polynomial rings. Proc. AAECC5, Springer LNCS 229 (1986) 353–362 178 [13] Mora, T.: Gr¨ obner bases in noncommutative algebras. Proc. ISSAC’88, Springer LNCS 358 (1989) 150–161 178 [14] Mora, T.: An Introduction to Commutative and Noncommutative Gr¨ obner Bases. Theoretical Computer Science 134 (1994) 131–173 178 [15] Piotkovsky, D. I.: Non-commutative Gr¨ obner bases, coherentness of associative algebras, and divisibility in semigroups. Fundamentalnaya i prikladnaya mathematika 7(2) (2001) 495–513 [16] Stifter, S.: Geometry theorem proving in vector spaces by means of Gr¨ obner bases. Proc. ISSAC ’93, In Bronstein, M. (ed.) ACM Press (1993) 301–310 178 [17] Tchoupaeva, I. J.: Application of the Noncommutative Gr¨ obner Bases Method for Proving Geometrical Statements in Coordinate Free Form. Proc. Workshop on Under- and Overdetermined Systems of Algebraic or Differential Equation, Karlsruhe, Germany (2002) [18] Tchoupaeva, I. J.: Application of Methods of Noncommutative Gr¨ obner Bases to the Proof of Geometrical Statements Given in Noncoordinate Form. Proc. International Workshop on Computer Algebra and its Application to Physics, Dubna, Russia (2001) [19] Ufnarovski, V.: Introduction to Noncommutative Gr¨ obner Bases Theory. Gr¨ obner Bases and Applications, in Buchberger, B. and Winkler, F. (eds). Proc. London Math. Soc. vol. 251 (1998) [20] Vasconcelos, V. W.: Computational Methods in Commutative Algebra and Algebraic Geometry. Springer Verlag (1998) [21] Wang, D.: Gr¨ obner Bases Applied to Geometric Theorem Proving and Discovering. Gr¨ obner Bases and Applications, B. Buchberger, B. and Winkler, F. (eds). Cambridge Univ. Press (1998) 281–302 178
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically Dongming Wang Laboratoire d’Informatique de Paris 6, Universit´e Pierre et Marie Curie – CNRS 4 place Jussieu, F-75252 Paris Cedex 05, France
Abstract. GEOTHER provides an environment for handling and proving theorems in geometry automatically. In this environment, geometric theorems are represented by means of predicate specifications. Several functions are implemented that allow one to translate the specification of a geometric theorem into an English or Chinese statement, into algebraic expressions, and into a logic formula automatically. Geometric diagrams can also be drawn automatically from the predicate specification, and the drawn diagrams may be modified and animated with a mouse click and dragging. Five algebraic provers based on Wu’s method of characteristic sets, the Gr¨ obner basis method, and other triangularization techniques are available for proving such theorems in elementary (and differential) geometry. Geometric meanings of the produced algebraic nondegeneracy conditions can be interpreted automatically, in most cases. PostScript and HTML files can be generated, also automatically, to document the manipulation and machine proof of the theorem. This paper presents these capabilities of GEOTHER, addresses some implementation issues, reports on the performance of GEOTHER’s algebraic provers, and discusses a few challenging problems.
1
Introduction
We refer to the proceedings of the first three International Workshops on Automated Deduction in Geometry (published as LNAI 1360, 1669, and 2061 by Springer-Verlag in 1997, 1999, and 2001 respectively) and the Bibliography on Geometric Reasoning (http://www-calfor.lip6.fr/~wang/GRBib) for the current state-of-the-art on automated theorem proving in geometry. The construction of theorem provers has been a common practice along with the development of effective algorithms on the subject. The GEOTHER environment described in this paper is the outcome of the author’s practice for more than a decade. An early version of it was ready for demonstration in 1991, and in 1996 was published a short description of the enhanced version GEOTHER 1.0 [8]. The current version GEOTHER 1.1 provides a user-friendly environment for handling and proving theorems in geometry automatically. In this environment, geometric theorems are represented by means of predicate specifications. Several functions are implemented that allow one to translate the specification of a geometric theorem into an English or Chinese statement, into algebraic expressions, and into F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 194–215, 2004. c Springer-Verlag Berlin Heidelberg 2004
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
195
a logic formula automatically. Geometric diagrams can also be drawn automatically from the predicate specification, and the drawn diagrams may be modified and animated with a mouse click and dragging. Five algebraic provers based on Wu’s method of characteristic sets, the Gr¨ obner basis method, and other triangularization techniques are available for proving such theorems in elementary (and differential) geometry. Geometric meanings of the produced algebraic nondegeneracy conditions can be interpreted automatically, in most cases. PostScript and HTML files can be generated, also automatically, to document the manipulation and machine proof of the theorem. The majority of GEOTHER code has been written as Maple programs, and one can use GEOTHER as a standard Maple package on any platform. However, some of the GEOTHER functions need external programs written in Java (and previously in C) and interact with the operating system. This concerns in particular the functions for automatic generation of diagrams and documents and the graphic interface, which might not work properly under certain operating systems and Java installations. GEOTHER has been included as an application module in the author’s Epsilon library [10] which will be made available publicly in Summer 2003. The reader will find more information about GEOTHER from http://www-calfor.lip6.fr/~wang/GEOTHER. There are several similar geometric theorem provers implemented on the basis of algebraic methods. We refer to [1, 2, 3] for descriptions of such provers. As a distinct feature of it compared to other provers, GEOTHER is designed not only for proving geometric theorems but also for handling such theorems automatically. Our design and full implementation of new algorithms for (irreducible) triangular decomposition make GEOTHER’s proof engine also more efficient and complete. In this paper, we describe the capabilities of GEOTHER, explain some implementation strategies, report experimental data on the performance of GEOTHER’s algebraic provers, and discuss a few challenging problems. The main contents of the paper will be integrated into a book entitled “Elimination Practice: Software Tools and Applications” to be published by Imperial College Press, London in late 2003.
2
Specification of Geometric Theorems
We recall the following specification of Simson’s theorem: Simson := Theorem( [arbitrary(A,B,C), oncircle(A,B,C,D), perpfoot(D,P,A,B,P), perpfoot(D,Q,A,C,Q), perpfoot(D,R,B,C,R)], collinear(P,Q,R), [x5, x6, x7, x8, x9] ); This is a typical example of predicate specification, which will be used throughout the paper for illustration. In general, a geometric theorem specified in GEOTHER has the following form T := Theorem(H, C, X)
196
Dongming Wang
where Theorem is a predicate specially reserved, T is the name, H the hypothesis and C the conclusion of the theorem, and the optional X is a list of dependent variables (see Sect. 2.1 below). The hypothesis H is a list or set of geometric predicates or polynomials, while the conclusion C may be a single geometric predicate or polynomial, or a list or set of predicates or polynomials. Geometric predicates are usually of the form Relation(A, B, C, ...) which declares a geometric relation among the objects A, B, C, . . . . For example, oncircle(A, B, C, D) declares that “the point D is on the circumcircle of the triangle ABC and collinear(P, Q, R) declares that “the three points P, Q and R are collinear.” Most of the arguments to the geometric predicates in GEOTHER are points in the plane. In order to perform translation, drawing, and proving, coordinates have to be assigned to these points, so that geometric problems may be solved by using algebraic techniques. The assignment of coordinates can be done either manually by the function Let or automatically by the function Coordinate. 2.1
Let and Coordinate
– Inputted a sequence T of equalities P1 = [x1 , y1 ], . . . , Pn = [xn , yn ], Let(T) assigns the coordinates (xi , yi ) to each point Pi for 1 ≤ i ≤ n. For instance, the coordinates of the points in Simson’s theorem may be assigned by Let(A = [-x1,0], B = [x1,0], C = [x2,x3], D = [x4,x5], P = [x4,0], Q = [x6,x7], R = [x8,x9]): A point may be free if both of its coordinates are free parameters, or semifree if one coordinate is free and the other is a dependent variable (constrained by the geometric condition), or dependent if both coordinates are dependent variables. All the dependent coordinates listed according to their order of introduction are supplied as the third argument X to Theorem. – Inputted the predicate specification T of a geometric theorem, Coordinate(T) reassigns the coordinates of the points appearing in T and returns a (new) specification of the same theorem, in which only the third argument (i.e., the list of variables) is modified. For example, Coordinate(Simson) reassigns the coordinates [u1,0], [u2,0], [0,v1], [x1,y1], [x2,y2], [x3,y3], [x4,y4] respectively to the points A, B, C, D, P, Q, R in Simson’s theorem. The output specification is the same as Simson but the third argument is replaced by [x1, y1, x2, y2, x3, y3, x4, y4].
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
2.2
197
Algebraic Specification
There are a (limited) number of geometric predicates available in GEOTHER, which are implemented mainly for specifying theorems of equality type in plane Euclidean geometry. The user may add new predicates to the environment if he or she looks into the GEOTHER code and figures out how such predicates may be implemented (which in fact is rather easy). If the user wishes to specify a geometric theorem but cannot find applicable predicates to express the involved geometric relations, he or she may transform the geometric relations (for the hypothesis and conclusion) into algebraic equations manually and provide the set of hypothesis polynomials to H and the conclusion polynomial or the set of conclusion polynomials to C. For example, the following is an algebraic specification of a theorem in solid geometry: Solid := Theorem( {2*u1*x7-u1*(u2+u4), 2*(u2-u1)*x7+2*u3*x8-u4*(u2-u1)-u3*u5, 2*(u4-u2)*x7+2*(u5-u3)*x8+2*u6*x9-u1*(u4-u2), (2*u2-u1)*x11-2*u3*x10+u1*u3, (u2-2*u1)*x11-u3*x10+u1*u3, 4*x12-3*x10-u4, 4*x13-3*x11-u5, 4*x14-u6, 2*x15-u1, 2*u2*x15+2*u3*x16-u2^2-u3^2, 2*u4*x15+2*u5*x16+2*u6*x17-u4^2-u5^2-u6^2}, {x13*x15+x7*x16+x8*x12-x7*x13-x8*x15-x12*x16, x9*x12+x14*x15+x7*x17-x7*x14-x9*x15-x12*x17}, [x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17] ); Geometric theorems with algebraic specifications may be proved by any of the algebraic provers as well. However, English and Chinese translation, automated diagram generation, and automated interpretation of nondegeneracy conditions do not work for algebraic specifications.
3
Basic Translations
The predicate specification (together with the optional assignment of coordinates by Let) is all what is needed for handling and proving the theorem. 3.1
English and Chinese
– Inputted the predicate specification T of a geometric theorem or a geometric predicate T with arguments, English(T) translates T into an English statement. For example, English(Simson) yields Theorem: If the points A, B, and C are arbitrary, the point D is on the circumcircle of the triangle ABC, P is the perpendicular foot of the line DP to the line AB, Q is the perpendicular foot
198
Dongming Wang
of the line DQ to the line AC, and R is the perpendicular foot of the line DR to the line BC, then the three points P, Q and R are collinear. and English(perpfoot(D, P, A, B, P)) yields: P is the perpendicular foot of the line DP to the line AB – Inputted the predicate specification T of a geometric theorem or a geometric predicate T with arguments, Chinese(T) translates T into a Chinese statement. For example, Chinese(Simson) yields
and Chinese(oncircle(A, B, C, D)) yields:
3.2
Algebraic and Logic
– Inputted the predicate specification T of a geometric theorem, or a geometric predicate T with arguments, or a sequence T of points occurring in the current theorem loaded to the GEOTHER session, Algebraic(T) translates T into an algebraic specification of the theorem or into one or several algebraic expressions, or prints out the coordinates of the points in T. The output algebraic specification has the same form as the predicate specification T, but the geometric predicates are replaced by their corresponding polynomials (or polynomial inequations). Usually, a polynomial means a polynomial equation (i.e., “= 0” is omitted), and a polynomial inequation is represented by means of “<> 0.” For example, Algebraic(Simson) yields 2 2 Theorem([2 x1 (x1 x3 - x1 x5 - x3 x6 x2 + x6 x1 - x4 x2 - x4 x1 + -x3 x6 - x3 x1 + x2 x7 + x1 x7, x8 x2 - x8 x1 - x4 x2 + x4 x1 + x2 x9 - x1 x9 - x3 x8 + x3 x1], [x5, x6, x7, x8, x9])
2 2 2 2 x5 + x5 x2 - x4 x3 + x5 x3 ), x3 x7 - x3 x5, x3 x9 - x3 x5, x6 x9 - x9 x4 -x7 x8 + x7 x4,
Algebraic(A, B, C, D, P, Q, R) prints [-x1, 0], [x1, 0], [x2, x3], [x4, x5], [x4, 0], [x6, x7], [x8, x9] and Algebraic(not collinear(P, Q, R)) yields: -x7 x8 + x7 x4 + x6 x9 - x9 x4 <> 0
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
199
– Inputted the specification T of a geometric theorem, Logic(T) translates T into a logic formula. For instance, the output of Logic(Simson) is: (Any D A~R B C P Q) [ oncircle(A,B,C,D) /~perpfoot(D,P,A,B,P) /\ perpfoot(D,Q,A,C,Q) /~perpfoot(D,R,B,C,R) ==> collinear(P,Q,R) ] The translations explained in this section are simple and straightforward. A more complicated translation discussed in Sect. 6.1 is for interpreting algebraic nondegeneracy conditions geometrically.
4
Proving Geometric Theorems Automatically
The five provers presented in this section are the algebraic proof engine of GEOTHER. They are implemented on the basis of some sophisticated elimination algorithms using characteristic sets, triangular decompositions, and Gr¨ obner bases. In fact, the main subroutines of these functions are from the Epsilon modules CharSets and TriSys and the Maple built-in Groebner package. The reader is pointed to the references given below in which the proving methods underlying our implementation are described. 4.1
Wprover
– Inputted the specification T of a geometric theorem, Wprover(T) proves or disproves T, with subsidiary conditions provided. Wprover is essentially an implementation of Wu’s method as described in [12]. The following is part of a machine proof produced by this prover for the butterfly theorem with specification Let(A = [0,0], B = [x1,0], C = [x2,x3], O = [x4,x5], D = [x6,x7], H = [x8,0], E = [x9,x10], F = [x11,x12]): Butterfly := Theorem( [arbitrary(A,B,C), circumcenter(A,B,C,O), oncircle(A,B,C,D), intersection(A,B,C,D,H), online(A,C,E), perpendicular(O,H,E,H), intersection(E,H,B,D,F)], [midpoint(E,F,H)], [x4,x5,x7,x8,x9,x10,x11,x12] ); GEOTHER> Wprover(Butterfly); Theorem: If the points A, B, and C are arbitrary, the point O is the circumcenter of the triangle ABC, the point D is on the circumcircle of the triangle ABC, the two lines AB and CD intersect at H, the point E is on the line AC, the line OH is perpendicular to the line EH, and the two lines EH and BD intersect at F, then H is the midpoint of E and F. Proof: char set produced: [2 x4 1] [6 x5 1] [6 x7 2] [4 x8 1] [5 x9 1] [2 x10 1]
200
Dongming Wang
pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder: pseudo-remainder:
[8 x11 1] [4 x12 1] [3 x11 1] = -x11 + ... (2 terms) [9 x10 1] = x1*x8*x10 + ... (8 terms) [9 x9 2] = -x2*x7*x9^2 + ... (8 terms) [10 x8 3] = x2^2*x8^3*x7*x5*x3 + ... (9 terms) [36 x7 4] = -x7^4*x2^5*x5*x3 + ... (35 terms) [22 x5 2] = -2*x3^2*x1*x2^7*x5^2 + ... (21 terms) [37 x4 2] = -4*x4^2*x2^9*x1 + ... (36 terms) [37 x5 2] = -2*x2^9*x3*x5^2 + ... (36 terms) [61 x4 2] = -4*x4^2*x2^11 + ... (60 terms) [22 x5 2] = 4*x2^6*x3^3*x5^2 + ... (21 terms) [37 x4 2] = 12*x4^2*x2^8*x3 + ... (36 terms) [30 x5 2] = 2*x3^2*x2^7*x5^2 + ... (29 terms) [62 x4 2] = 4*x4^2*x2^9 + ... (61 terms)
. . . . . . pseudo-remainder: pseudo-remainder:
[82 x5 1] = 2*x3^2*x2^11*x5 + ... (81 terms) [62 x4 2] = 2*x3*x2^11*x4^2 + ... (61 terms)
The theorem is true under the following subsidiary conditions: . . . . . .
the the the the the the
three points A, B and C are not collinear line AB is not parallel to the line CD line EH is not parallel to the line BD line AC is not perpendicular to the line AB line DB is not perpendicular to the line AB line OH is not perpendicular to the line CA
QED.
The geometric interpretation of algebraic nondegeneracy conditions is done by using the function Generic (see Sect. 6.1). 4.2
Gprover
– Inputted the specification T of a geometric theorem, Gprover(T) or Gprover (T, Kapur) proves T (without providing subsidiary conditions) or reports that it cannot confirm the theorem. Gprover is an implementation of Kutzler–Stifter’s method as described in [5] and Kapur’s method as described in [4], both based on Gr¨obner bases. The former is used if the optional second argument is omitted or given as KS, and the latter is used if the second argument is given as Kapur. 4.3
GCprover
– Inputted the specification T of a geometric theorem, GCprover(T) proves T, with subsidiary conditions provided, or reports that it cannot confirm the theorem.
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
201
GCprover is an implementation of the method proposed in [9]. It works by first computing a Gr¨ obner basis plus normal-form reduction (over the ground field) according to Kutzler–Stifter’s approach [5] and, if this step fails, then taking a quasi-basic set of the computed Gr¨obner basis and performing pseudodivision. In this way, subsidiary conditions may be provided explicitly. 4.4
Tprover
– Inputted the specification T of a geometric theorem, Tprover(T) proves or disproves T, with subsidiary conditions provided. Tprover implements the method using zero decomposition proposed by the author in [6]. The system of hypothesis polynomials (for both equations and inequations) are fully decomposed into (irreducible) triangular systems. The theorem is proved to be true or false for all the components including degenerate ones, so the provided subsidiary conditions are minimized (see Sect. 7.5). 4.5
Dprover
– Inputted the algebraic specification T of a (differential geometry) theorem in the local theory of curves, Dprover(T) proves or disproves T, with algebraic subsidiary conditions provided. Dprover implements the method using ordinary differential zero decomposition proposed in [7]. The system of hypothesis differential-polynomials (for equations and inequations) are fully decomposed into (irreducible) differential triangular systems. The theorem is proved to be true or false for all the components including degenerate ones, thus allowing the subsidiary conditions to be minimized.
5 5.1
Automated Generation of Diagrams and Documents Geometric
– Inputted the predicate specification T of a geometric theorem, Geometric(T) generates one or several diagrams for T. Each generated diagram is displayed in a new window and can be modified and animated with a mouse click and dragging. The Maple function system is used for the interaction with the operating system. Some implementation details about this drawing function are described in [11]. The window shown in Fig. 1 is an output of Geometric(Simson). 5.2
Print
– Inputted the current geometric theorem T in the session and optionally its name ’T’, Print(T, ’T’) generates an HTML file (with Java applet) documenting the last manipulations and proof of T and invokes Netscape to view
202
Dongming Wang
the file. If the optional third argument is given as LaTeX, then Print(T, ’T’, LaTeX) generates a PostScript file documenting the theorem and invokes Ghostview to view the file.
Fig. 1. Output of Geometric
Fig. 2. HTTP document generated by Print
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
203
Fig. 3. PostScript document generated by Print
The window dumps in Figs. 2 and 3 above show parts of the generated documents (with Print(Simson, ’Simson’) and Print(Simson, ’Simson’, LaTeX)) viewed by Netscape and Ghostview for Simson’s theorem.
6 6.1
Nondegeneracy Conditions and Miscellaneous Functions Interpretation of Nondegeneracy Conditions
– Inputted the predicate specification T of a geometric theorem and a (simple) polynomial p (or a set p of polynomials) in the coordinates of the points occurring in T, Generic(T, p) translates the algebraic condition p <> 0 with respect to T into geometric/predicate form. This translation might not work for an arbitrary polynomial p. It works only for some simple polynomial whose nonvanishing has a clear geometric meaning with respect to the theorem. When the translation fails, the algebraic condition p <> 0 is returned. For instance, Generic(Simson, x1-x2) results in . the line AB is not perpendicular to the line BC not perpendicular(A, B, B, C)
204
Dongming Wang
and Generic(Simson, x1-2*x2) returns . x1-2*x2 <> 0 not x1 - 2 x2 The function Generic is used within the provers to produce nondegeneracy conditions in geometric form stated in English or Chinese. See Sect. 7.4 for some discussions about its implementation. 6.2
Load and Search
– Inputted the name T of a geometric theorem, Load(T) reads the specification of the theorem from the built-in library to the GEOTHER session. GEOTHER has a small collection of well-known geometric theorems specified by the author. The user may load any of these theorems to the GEOTHER session and write his or her own specifications for interesting geometric theorems (in plane Euclidean geometry). To see which theorems are contained in the library, one may use the following function.
– Inputted a string S, Search(S) lists all the names of theorems containing S in the library. If S is given as all or All, then all the theorems in the library are listed. 6.3
Demo and Click
– Demo() gives an automated demonstration of GEOTHER. During the demonstration, GEOTHER commands appear automatically and the user only needs to enter semicolon ; and then return. – Click() starts a menu-driven GEOTHER user interface. The windows in Fig. 4 show the graphic interface, with which the user does not need to enter keyboard commands except for the name of a theorem, a string, or a polynomial when calling Load, Search, or Generic respectively. Clicking on a button causes an application of the indicated function to the current theorem (last loaded) in the session. This interface works only under Unix and Linux, of which the pipe facility is used for data communication.
Fig. 4. Graphic user interface
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
6.4
205
Online Help
GEOTHER provides online help for all its functions with examples. This help facility is used in the usual way as for standard Maple packages. This paper and part of the book mentioned at the end of Sect. 1 will serve as an introduction to GEOTHER. Additional documents and future updates of GEOTHER will be made available on the author’s web page.
7
Implementation Details
The implementation of most GEOTHER functions is easy and straightforward, but as usual it is a time-consuming task and requires special care to handle all the technical details at the programming level. This section discusses some of the implementation issues; of course we cannot enter into all the details. 7.1
The Geometric Specification Language
As the reader has seen, a geometric theorem in GEOTHER is specified by using a simple predicate language. This specification language provides a basic representation, that is extensible, for a large class of geometric theorems, and with which a theorem may be manipulated, proved, and translated into other representations. A basic element of the language is predicate. Except for a few specially reserved predicates like Theorem and dTheorem, the other predicates declaring geometric relations are implemented with a standard list of information entries. A typical example is the routine corresponding to the predicate online shown
Fig. 5. Maple routine for predicate online
206
Dongming Wang
in Fig. 5. Information contained in this routine includes the English and Chinese interpretations of online and its negation, a possible degeneracy condition isotropic(a, b), two geometric objects line(a, b) and line(a, c) involved, and the corresponding algebraic expressions. It is not difficult to imagine how the information contained in the predicate entries may be used naturally for manipulating and translating a geometric theorem involving such predicates at the running time. We shall discuss part of the usage in the following subsections. Composition of the corresponding entries of all the involved predicates using appropriate connectives for the whole theorem is merely an implementation of simple heuristics. Since predicate routines have a standard form, it is easy to add new predicates to the geometric language; thus the language may be easily extended and made more expressive. 7.2
Automated Assignment of Coordinates
Coordinates of points are assigned by Let to a Maple function internally, not to the letters labeling the points. This keeps the letters always as symbols, to which the corresponding coordinates of points may be printed out by Algebraic. The function Coordinate for assigning coordinates of points automatically in the plane is implemented according to a simple principle: it checks whether the theorem’s specification contains a perpendicularity predicate, and if so, takes the two perpendicular lines (on which there are more points) as the two axes; then the coordinates of their intersection point are both 0. If there is no perpendicularity predicate in the specification, then take a line which contains the maximum number of points possible as the first axis, with the other axis passing through one or more points not on the first axis. For any point other than the origin on the axes, one of the coordinates is assigned 0. Finally, generic coordinates are assigned to the remaining points not on the axes. The heuristic choice of axes aims at getting more coordinates to 0, but without loss of generality, in order to simplify the involved algebraic computations. 7.3
Automated Generation of Diagrams
Generating geometric diagrams automatically is a more complex process. Our basic idea is to take random values for the free coordinates, solve the geometric constraint equations to get the values for the dependent coordinates, finally check whether there exist two points which are too close, or too far away (so that the points cannot fit into a fixed window), and if so, then go back to take other random values. When proper values for the coordinates of points are determined, the geometric objects such as lines and circles contained in the g obj entries of the predicates are drawn (and this is rather easy). The letters labeling the points are placed according to the centroid principle explained in [11] (see also Sect. 9.2). Our drawing program is made somewhat complicated because of the requirement that the drawn diagrams can be modified and animated with a mouse click
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
207
and dragging. We shifted our implementation of the drawing function from C to the Java language. In our current version, not simply the concrete coordinate values but also the triangularized geometric constraint relations computed in Maple are passed onto the Java programs. This is detailed in [11]. 7.4
Automated Interpretation of Nondegeneracy Conditions
Interpreting the geometric meanings of algebraic nondegeneracy conditions automatically is mainly a heuristic process. The function Generic is implemented for this purpose according to the following two principles. First, in the routine of each predicate an information entry is included that predetermines possible degeneracy conditions associated with this predicate. The reader may recall the degeneracy condition isotropic(a, b) associated with online. For another example: in the predicate intersection(A, B, C, D, P) (meaning “the two lines AB and CD intersect at P”) the degeneracy condition parallel(A, B, C, D) is included. For each given predicate specification T of a geometric theorem, there is a finite collection C of possible nondegeneracy conditions in predicate form. For any input p, Generic(T, p) works by translating all the conditions in C into polynomial inequations and then comparing if any of the inequations is equivalent to p <> 0. If so, then p <> 0 is “translated” into the corresponding nondegeneracy condition of predicate form in C. The second principle works by fixing a finite set of predicates corresponding to popular degeneracy conditions such as two points coincide, three points are collinear, and two lines are parallel. For a given specification T, Generic applies each of these predicates to the points occurring in T in a combinatoric way, translates the predicate applied to concrete points into a polynomial equation, and verify if the obtained polynomial is equivalent to the input p. This is done one by one for different combinations of points and thus involves heuristic search. If an equivalence is discovered, then the translation is done for p. This approach is used when the approach according to the first principle fails. It requires extensive searching, but the involved computation is not expensive, so it works rather well. 7.5
Implementation of Algebraic Provers
The main routines for polynomial elimination and reduction in GEOTHER provers are called from the two Epsilon modules CharSets and TriSys and the Groebner package provided by Maple. We implemented the proof methods described in [12, 4, 5, 6, 7, 9] as indicated in Sect. 4 in a quite straightforward way, so we do not discuss the aspect of algebraic computation. A major issue is how to produce appropriate subsidiary conditions. Our attention has mainly been focused on Tprover, which decomposes the system of hypothesis polynomials (for equations and inequations) into irreducible triangular systems and check whether the conclusion of the theorem holds true for each triangular system. In other words, it is verified whether the theorem is true in all cases, generic or degenerate. Since a geometric theorem may be false in the degenerate cases and the algebraic formulation using polynomial equations and
208
Dongming Wang
inequations may not rule out some undesired situations introduced by geometric ambiguities such as internal or external bisection of angles and internal or external contact of circles, the conclusion is usually true only for some of the irreducible triangular systems. Now the question is how to form the subsidiary conditions to exclude those triangular systems for which the conclusion is false. Let us look at a simple example: we want to prove that (∀x, y)[x2 = 1 ∧ y 2 = 1 =⇒ (x + 1)(y + 1) = 0]. In this case, we have four irreducible triangular sets T1 = [x + 1, y + 1],
T2 = [x + 1, y − 1],
T3 = [x − 1, y + 1],
T4 = [x − 1, y − 1]
and the conclusion is false for T4 and true for the other three. The triangular = 1∨y = 1. This example set T4 may be excluded by the subsidiary condition x shows why we need to use disjunction to form subsidiary conditions as proposed in [6]. Nevertheless, subsidiary conditions formed by means of conjunction and disjunction as in [6] may be very tedious. How to simplify the conditions is a question that still remains (see Sect. 9.1). We have adopted the following heuristics for Tprover and Dprover. Suppose that the conclusion of the theorem is true for T1 , . . . , Te and false ¯ t , where the triangular sets Ti and T ¯ j are all irreducible. For j = ¯ 1, . . . , T for T ¯ j whose pseudo-remainders 1, . . . , t, let ∆j be the set of those polynomials in T are not identically equal to 0 with respect to all Ti . If ∆j = ∅, then let Dj := (T = 0). ¯j T ∈T
Otherwise, let Ej be an element of ∆j that has the maximum number of occur rences in ∆1 , . . . , ∆t and Dj := (Ej = 0). We take Ω := D∈{D1 ,...,Dt } D as the subsidiary condition for the theorem to be true. The generation of Ω requires extra computation. Without this computation the produced condition may exclude more components for which the theorem is true. This may happen for the subsidiary conditions produced by the other provers in GEOTHER. 7.6
Soundness Remarks
Since a predicate or algebraic specification of a geometric theorem may be a false proposition in the logical sense, proving the theorem is not simply a yes or no confirmation. Often we want and try to produce a proof of the theorem, even if its specification is not correct logically, by imposing certain subsidiary conditions. This makes the proving problem much harder, in particular, when a bad nonsensical specification is submitted to the prover. In this case, a nonsensical proof of the “theorem” may be produced. This is not the fault of our provers
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
209
because determining whether a meaningful theorem can be derived from an arbitrary specification is much beyond the scope of the provers. Therefore, the user must make sure that his or her specification of the geometric theorem is correct, or at least almost correct. If a nonsensical proof is produced, we advise the user to check the specification carefully, or try to use a different specification. Moreover, GEOTHER functions for manipulation and proof are made as automatic as possible. To achieve this, we have adopted a number of heuristics at the implementation level. These heuristics may fail in certain cases, and thus some functions may not work or work unpleasantly for some specifications of theorems. It is completely normal if the user gets an automatically drawn diagram that has a poor look or even looks bizarre. GEOTHER is not yet a perfect piece of software, but it shows how geometric theorems can be handled and proved automatically and nicely.
8
Experiments with Algebraic Provers
Comparing algebraic provers in terms of computing time is not necessarily instructive because the quality of the proofs produced by different provers may Table 1. Proving times in Maple 8 on Pentium III 700 Gprover Theorem Butterfly Ceva Desargues Euler Line Feuerbach Gauss Line Gauss Point Leisenring Menelaus Miquel Morley Morley–Wu Orthocenter Pappus Pascal Pascal Conic Poncelet Ptolemy Secant Simson Simson Line Steiner Steiner–Lehmus Steiner–Wu Th´ebault–Taylor
Wprover .41 .28 .02 .04 .12 .04 .76 .25 .23 > 2000 63.95 1.56 .01 .06 .12 2.68 6.76 .03 .01 .05 .04 4.43 1.38 1.61 10.50
KS
Kapur
.64 1.41 .03 .05 .33 .08 .95 .36 .09 > 2000 * 58.92 2.42 .02 .10 1.85 > 2000 * .27 .06 .07 .09 .08 * .09 * 15.99 1.91 * .60
2.00 1.64 .06 .08 .44 .11 2.16 .36 .18 > 2000 * 34.41 3.09 .04 .15 57.20 > 2000 * 2.90 .11 .09 .13 .11 * 7.02 * 443.69 3.08 * 53.18
GCprover Tprover > 2000 .94 .09 .34 .72 .07 1.71 > 2000 .17 > 2000 > 2000 > 2000 .03 2.59 > 2000 > 2000 * .65 .09 .18 3.62 .65 * .83 * 153.63 > 2000 > 2000
18.84 1.56 .12 .18 .47 .10 1.58 58.84 .22 > 2000 279.09 230.88 .05 1.03 197.11 > 2000 2.87 .05 .07 1.07 .54 1.51 3.08 > 2000 19.83
210
Dongming Wang
differ. For instance, Wprover and GCprover provide explicit subsidiary conditions, while Gprover does not. Wprover does not verify whether the theorem is true in the degenerate cases, while Tprover does. The purpose of the experiments reported in this section is to provide the reader with an idea about the magnitude of computing time required by different provers for some wellknown geometric theorems. In fact, our main interest is not in the quantitative performance of these provers (because the efficiency of the underlying algebraic methods is quite well known); rather we want to see how much qualitatively we can do with algebraic methods for geometric theorem proving. Table 1 shows the times for proving 25 theorems in plane Euclidean geometry using different provers. All the computations were performed in Maple 8 under Linux 2.4.7-10 on a laptop Pentium III 700 MHz with 128 MB of memory. The proving time is given in CPU seconds and includes the time for producing subsidiary conditions and for garbage collection. The cases in which the prover fails to prove the theorem after the indicated time are marked with ∗. As it is well known, Wu’s method (implemented as Wprover in GEOTHER) is the most efficient for confirming geometric theorems. Methods based on Gr¨obner bases (computed over the field of rational functions in parametric variables) are slightly slower but also efficient. For GCprover Gr¨ obner bases are computed over the ground field (i.e., the field of rational numbers), so the computation is much more expensive. This prover fails to prove some of the theorems within 2000 CPU seconds, while it is capable of deciding whether a geometric theorem is universally true, and if not, providing explicit subsidiary conditions for the theorem to be true. The method based on zero decomposition is also less efficient, but the produced proofs are of higher quality: all the degenerate cases are verified and the generated subsidiary conditions exclude fewer degenerate cases where the theorem is true. For some theorems such as Butterfly, Leisenring, and Pascal, a considerable amount of time has been spent to generate such conditions.
9
Challenging Problems
The previous sections have focused on presenting the capabilities and performance of GEOTHER as well as some programming techniques. A reader interested in the design and implementation of software systems for geometric reasoning might ask: what are the challenges and difficulties behind for the development of GEOTHER? In this section, we discuss some of the difficulties that we have encountered, but not yet completely overcome. 9.1
Nondegeneracy Conditions Revisited
Although the axiom system of geometry has been considered a model of axiomatization in mathematics since Euclid, most theorems in Euclidean geometry are not rigorously stated, unfortunately; they may be false or become meaningless in some degenerate cases. It is Wu [12] who first pointed out the importance of nondegeneracy conditions for geometric theorem proving. Such conditions are not explicitly mentioned in the usual statements of theorems. The proving of
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
211
a geometric theorem on computer proceeds rigorously in the logical sense, so we must know or be able to determine when the theorem is true or false. There are two ways to go: either state the theorem rigorously by adding all the necessary nondegeneracy conditions a priori, or let the prover find such conditions in the proof process. We may agree that a flat triangle with three collinear vertices is a degenerate one, but it is disputable whether an equilateral triangle may also be considered as degenerated. Can we assume that a theorem is false or meaningless only in the flat case but not in the equilateral case? No, we cannot. Here is a nontrivial example [9]: if the segment joining the midpoints of the diagonals of a trapezoid is extended to intersect a side of the trapezoid, then it bisects that side. This well-known example originates from an early paper coauthored by H. Gelernter. The theorem is not true when the trapezoid is a parallelogram! The author was not aware of this not really degenerated case; it is GEOTHER who discovered the necessary condition. This example shows the difficulty of predetermining all the cases where a theorem may be false and meaningless. Even if one can identify all such cases and state the theorem rigorously, the statement will become very tedious, contrary to the traditional conciseness and beautifulness of geometric statements. It is also difficult to know whether all the cases excluded by the rigorous statement are really necessary. Therefore, it is not realistic to determine all the necessary conditions in advance to make the theorem rigorously stated. The above example also indicates that the term degenerate cannot be easily defined. As another example, consider the proposition that the bisectors of the three angles of an arbitrary triangle are concurrent. This proposition is false if two of the bisectors are internal and the third is external, or the three bisectors are all external. It is not reasonable to consider these cases as degenerated. For these reasons, we prefer to call a condition under which the theorem is false a subsidiary condition. A subsidiary condition is considered a nondegeneracy condition if its negation corresponds to a commonly recognized degenerate case of the theorem. We advocate including only a few obvious nondegeneracy conditions in the specification of the theorem. The prover is supposed to find the remaining conditions. Using Wu’s or other algebraic methods, one can determine, during the proof, all the cases in which the theorem is not true by decomposing the (quasi-) algebraic variety defined by its hypothesis expressions into irreducible components. The decomposition consists of two major steps: the first step is to compute a set Ψ of irreducible triangular sets and the second setp is to construct irreducible varieties from the triangular sets, and both steps are time-consuming. For proving the theorem, the first step is sufficient, but some unnecessary conditions cannot be removed. Let Ψ + be the set of all those triangular sets in Ψ for which the theorem is true, and Ψ − = Ψ \ Ψ + . In general, Ψ − contains many triangular sets. How to form a minimal or the simplest set of conditions that rules out all the triangular sets in Ψ − , but the fewest triangular sets possible from Ψ + ? The strategy explained in Sect. 7.5 works, but not yet ideally. The subsidiary condition produced may be still very complex and it is not necessarily minimal.
212
Dongming Wang
If the decomposition proceeds to the second step so that irreducible subvarieties are obtained, then some redundant components may be removed. This will help simplify the subsidiary conditions, but the computational process is very expensive. We did not incorporate it in our implementation. An implied question is how to measure the minimality and simplicity of conditions. Minimality and simplicity may be defined algebraically in different ways, but how to define them geometrically or in terms of computer output, display, or representation is another difficult question. When algebraic subsidiary conditions are obtained, we need to interpret them geometrically. The heuristics explained in Sect. 7.4 work quite well in general, but may fail in many cases. Return to the above example about the concurrency of angular bisectors of a triangle. When a polynomial condition of the form D =0 is obtained, how do we know that this condition corresponds to the geometric fact that the number of external bisectors of the triangle is even? Heuristically, we can still handle such cases by incorporating the ambiguities of internal or external bisection of angles and contact of circles, etc. as geometric knowledge into the prover. However, automatic interpretation of algebraic conditions whose geometric meanings are unknown to the knowledge base is a very difficult task. We believe that a satisfactory treatment of this task will require extensive computations over the reals (as inequalities have to be involved), numerical simulation (to determine the topological structure and shape of real configurations), and techniques from artificial intelligence. 9.2
What Diagrams Look Good?
Now we come back to the problem of automated generation of geometric diagrams. Generating a diagram satisfying given geometric constraints is not a difficult task for theorems in plane Euclidean geometry. In our case there are infinitely many such diagrams and a nontechnical question is which of them are good. So we have to ask a prequestion: how to decide algebraically whether or not a diagram looks good geometrically? This question does not have a unique answer because different people may have different views as what diagrams can be considered good. Our criterion of good looking is explained as follows. We fix two parameters d and D with 0 < d < D, where D is smaller than the width and height of the window in which the diagram is to be displayed. Let P1 , . . . , Pm be all the points appearing in the diagram. In our program, the diagram is considered good if the condition d ≤ |Pi Pj | ≤ D,
i = j, 1 ≤ i, j ≤ m,
(1)
is satisfied. This condition is natural and simple: the distance between any two points should not be too short and all the points can fit into the window. However, it is not trivial computationally to get the distance condition (1) satisfied. It is easy to choose values randomly for the free coordinates such that d ≤ |Pi Pj | ≤ D is satisfied for all the free points Pi and Pj . Once the free coordinates are fixed, the dependent coordinates are determined by the geometric
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
213
constraints. Therefore, condition (1) can be completely verified only after the constraint equations are solved. It is very often that some dependent or semifree point gets too close to another point or goes far away, so that (1) does not hold. In this case, we have to choose other values for the free coordinates and solve the constraint equations again. This is the main reason why in some cases (when the diagram is complicated) our drawing program may take quite long time or even fail. In our current implementation, when nonsatisfaction of the distance condition (1) is detected, a new set of values is chosen randomly for all the free coordinates without taking into account the previous computation. An alternative is to change the coordinate values only for some of the free or semifree points, so that the previous computation may be partially used. This would make the searching process dynamic and probably raise its efficiency. We have this alternative in mind, but have not experimented with it. Where to place the diagram in the display window and where to label the points? We treat these two questions according to the centroid principle, a simple technique that works pretty well. Let M be the centroid of the points P1 , . . . , Pm . The diagram is translated so that M is located at the center of the display window. The letter that labels the point Pi is placed on the ray from M to Pi and near Pi on the side of direction (see [11]). The diagram and the labeling letters in the display window are reset to their default positions determined according to this principle when the button Move is clicked (see Fig. 1). One may also require that the labeling letters have a minimal overlap with the lines, arcs, etc. in the diagram, but this can be achieved only with extensive computation. 9.3
Language for Symbolic Geometric Reasoning
To extend the simple specification language of GEOTHER, we are interested in a more comprehensive language for symbolic geometric computation and reasoning. The basic elements of such a language in our mind are symbolic geometric objects and the language is oriented around these objects. A symbolic geometric object such as a general triangle or a general circle may be defined as a class with data and operations. Such data and operations may be grouped into several components such as representation, property, knowledge, derivedObject, and method, named tentatively. For example, a triangle may be represented by its three vertices, or by two sides and their included angle, or by two angles and their included side, and a circle may be represented by its center and radius, or by its center and a point on the circle, or by three distinct points on the circle. A triangle has the properties that the sum of its three internal angles is 180◦ and the sum of its two sides is greater than its third side. The class that defines the general triangle may contain the knowledge that any side of the triangle is a segment, the three vertices are usually assumed to be noncollinear, and there are three escribed circles and one inscribed circles that are tangent to the three sides of the triangle. There are many objects derived from a triangle: area, perimeter, centroid, incenter, orthocenter, inscribed circle, circumcircle, etc. Methods
214
Dongming Wang
are required to convert one representation into another, to compute derived objects, and to manage the knowledge and properties. When the class for a general triangle is defined, any concrete triangle, symbolic or numerical, generic or specialized, is an instance of the general triangle, obtained by assigning values to some of the attributes of the class. Symbolic geometric objects in the language interact through standard geometric relations, which may be defined as procedures with data and information entries, similar to the predicates defined in GEOTHER. Once fundamental geometric objects and relations are defined in the language, a simple syntax may be designed to formulate geometric statements, propositions, theorems, etc. and to describe more complex geometric objects and relations. At this level, advanced methods and techniques need be used and developed to handle and visualize geometric objects, perform operations, verify properties, prove theorems, derive new relations, and document manipulations. We anticipate that such a language, if well designed and implemented, will provide a solid basis for further investigations on computer-aided geometric reasoning. It should be emphasized that the geometric objects under discussion even after the instantiation are symbolic, i.e., the radius of a circle may still remain as a symbol without assigned value and the vertex of a triangle may have symbolic coordinates. Such objects are indefinite in character and how to manipulate them efficiently and correctly is a difficult question. For instance, two indefinite circles may intersect at two points or at a single point, and the two intersection points may be complex or real, depending on the size and location of the circles. Without specifying the symbolic radii and coordinates of their centers, the number of intersection points, if computed, is not an integer but a symbolic expression that depends also upon the geometry-associated field. In general, reasoning and visualization for indefinite geometric objects involve both numerical and symbolic computations (over the field of rational numbers, its algebraic extensions, and the field of real numbers). Effective methods for these computations need be incorporated in a practical implementation of the above-mentioned language. Design and implementation of the language powered with devices and techniques from symbolic and algebraic computation for doing geometry on computer are part of a research project in preparation.
Acknowledgements The author wishes to thank Roman Winkler and Xiaofan Jin who have contributed to the implementation of Coordinate and Generic, respectively, and an anonymous referee whose suggestion leads to Sect. 9. Part of this work is supported by the SPACES project (http://www.spaces-soft.org) and the Chinese national 973 project NKBRSF G19980306.
GEOTHER 1.1: Handling and Proving Geometric Theorems Automatically
215
References [1] Chou, S.-C., Gao, X.-S., Liu, Z., Wang, D.-K., Wang, D.: Geometric theorem provers and algebraic equation solvers. In: Mathematics Mechanization and Applications (X.-S. Gao and D. Wang, eds.), pp. 491–505. Academic Press, London (2000). 195 [2] Gao, X.-S., Zhang, J.-Z., Chou, S.-C.: Geometry Expert (in Chinese). Nine Chapters Publ., Taiwan (1998). 195 [3] Hong, H., Wang, D., Winkler, F.: Short description of existing provers. Ann. Math. Artif. Intell. 13: 195–202 (1995). 195 [4] Kapur, D.: Using Gr¨ obner bases to reason about geometry problems. J. Symb. Comput. 2: 399–408 (1986). 200, 207 [5] Kutzler, B., Stifter, S.: On the application of Buchberger’s algorithm to automated geometry theorem proving. J. Symb. Comput. 2: 389–397 (1986). 200, 201, 207 [6] Wang, D.: Elimination procedures for mechanical theorem proving in geometry. Ann. Math. Artif. Intell. 13: 1–24 (1995). 201, 207, 208 [7] Wang, D.: A method for proving theorems in differential geometry and mechanics. J. Univ. Comput. Sci. 1: 658–673 (1995). 201, 207 [8] Wang, D.: GEOTHER: A geometry theorem prover. In: Automated Deduction (M. A. McRobbie and J. K. Slaney, eds.), LNAI 1104, pp. 166–170. SpringerVerlag, Berlin Heidelberg (1996). 194 [9] Wang, D.: Gr¨ obner bases applied to geometric theorem proving and discovering. In: Gr¨ obner Bases and Applications (B. Buchberger and F. Winkler, eds.), pp. 281–301. Cambridge University Press, Cambridge (1998). 201, 207, 211 [10] Wang, D.: Epsilon: A library of software tools for polynomial elimination. In: Mathematical Software — Proceedings ICMS 2002 (A. M. Cohen, X.-S. Gao, and N. Takayama, eds.), pp. 379–389. World Scientific, Singapore New Jersey (2002). 195 [11] Wang, D.: Automated generation of diagrams with Maple and Java. In: Algebra, Geometry, and Software Systems (M. Joswig and N. Takayama, eds.), pp. 277– 287. Springer-Verlag, Berlin Heidelberg (2003). 201, 206, 207, 213 [12] Wu, W.-t.: Mechanical Theorem Proving in Geometries: Basic Principles (translated from the Chinese by X. Jin and D. Wang). Springer-Verlag, Wien New York (1994). 199, 207, 210
Distance Coordinates Used in Geometric Constraint Solving Lu Yang Guangzhou University, Guangzhou 510405, China CICA, Chinese Academy of Sciences, Chengdu 610041, China [email protected] [email protected]
Abstract. In this paper, an invariant method based on distance geometry is proposed to construct the constraint equations for geometric constraint solving.
1
Distance Geometry
The classical distance geometry studies metric relations based on the single kind of geometric invariant: distance between points. To meet the requirement of geometric computing and reasoning, a generalized frame was developed by the author and his collaborator in 1980s-1990s. In this frame, an abstract distance is defined over a configuration of points, hyperplanes and hyperspheres. The following definition helps solving geometric constraint on a point-plane configuration. Given an n-tuple of points and oriented hyperplanes in an Euclidean space, P = (p1 , p2 , · · · , pn ), we define a mapping g : P × P → R by letting • •
•
g(pi , pj ) be the square of the distance between pi and pj if both are points, g(pi , pj ) be the signed distance from pi to pj , if one is a point and the other an oriented hyperplane, 1 g(pi , pj ) be − cos(pi , pj ), if both are oriented hyperplanes. 2
By gij denote g(pi , pj ) and G denote the matrix (gij )n×n , and let δ = (δ1 , δ2 , · · · , δn )
where δi =
1, 0,
if pi is a point if pi is a hyperplane
where i = 1, . . . , n. Then, let M (p1 , p2 , · · · , pn ) =
G δT δ 0
This work is supported in part by NKBRSF-(G1998030602).
F. Winkler (Ed.): ADG 2002, LNAI 2930, pp. 216–229, 2004. c Springer-Verlag Berlin Heidelberg 2004
Distance Coordinates Used in Geometric Constraint Solving
217
which is called the Cayley-Menger matrix of P , and let G δT D(p1 , p2 , · · · , pn ) = δ 0 which is called the Cayley-Menger determinant of P . The following theorem is an extension of the classical result on Cayley-Menger determinant. Theorem 1. Let D(p1 , p2 , · · · , pn ) be the Cayley-Menger determinant of an n-tuple of points and oriented hyperplanes in d-dimensional space. If n ≥ d+2, then (1) D(p1 , p2 , · · · , pn ) = 0. This theorem is essentially the Theorem 1.1 of article [9], and can also be found in earlier articles [7, 8]. Proof . Assume there is at least one point amongst p1 , p2 , · · · , pn , otherwise, the Cayley-Menger matrix is obviously singular since the entries of the last row all are zero. Without loss of generality, we let p1 , p2 , · · · , ps be oriented hyperplanes (where s < d) and ps+1 , . . . , pn be points. Take pn as the origin of coordinates. By α1 , · · · , αs denote the unit normal vectors of oriented hyperplanes p1 , · · · , ps , by αs+1 , · · · , αn denote the position vectors of points ps+1 , . . . , pn , and β1 , · · · , βs denote the position vectors of the feet of the perpendiculars to hyperplanes p1 , · · · , ps from the origin, respectively. Then, gij , all the entries of the Cayley-Menger matrix G, can be represented in a vector format as follows: 1 − αi αj (1 ≤ i ≤ s, 1 ≤ j ≤ s) gij = g(pi , pj ) = α 2(α − β ) (2) (1 ≤ i ≤ s, s < j ≤ n) i i j 2 (αi − αj ) (s < i ≤ n, s < j ≤ n). In this case, clearly,
δi =
1, 0,
(1 ≤ i ≤ s) (s < i ≤ n).
Now, do a series of elementary transformations to matrix G step by step: 1. Multiply the ith row by −2, for i = 1, . . . , s. 1 2. Multiply the j th column by − , for j = s + 1, . . . , n. 2 3. Multiply the last row (i.e. the (n + 1)th row) by −2. 4. Add the last row times αi βi to the ith row, for i = 1, . . . , s. 5. Add the last column times αj βj to the j th column, for j = 1, . . . , s. 1 6. Add the last row times α2i to the ith row, for i = s + 1, . . . , n. 2 1 7. Add the last column times α2j to the j th column, for j = s + 1, . . . , n. 2 The procedure results in a matrix L, F δT L= , where F = (fij )n×n δ 0
(3)
218
Lu Yang
with fij = αi αj for i, j = 1, . . . , n, and δ = (δ1 , δ2 , · · · , δn ) defined as (3). By |F |[n,n] denote the (n, n) th cofactor of determinant |F |, i.e. the determinant of the matrix (fij )(n−1)×(n−1) . Since αn is a null vector, we have fn i = αn αi = 0, fi n = αi αn = 0, for i = 1, . . . , n. Thus F δT = −|F |[n,n] . |L| = δ 0 Noting that |F |[n,n] is Gram determinant of d-dimensional vectors α1 , · · · , αn−1 and n − 1 > d, it is vanishing, so is |L|, and so is D(p1 , p2 , · · · , pn ) because L is a result of some elementary transformations from G. This completes the proof. Generally, by A[i,j] denote the (i, j) th cofactor of a determinant A, i.e. the sub-determinant of A in which the ith row and the j th column have been removed. As a corollary of Theorem 1, we have Corollary 1. Let D be the Cayley-Menger determinant of an n-tuple of points and oriented hyperplanes in d-dimensional space. If n ≥ d + 3, then D[i,j] = 0
( for i, j = 1, . . . , n.)
(4)
Proof . This depends on a lemma on determinants: ˜iven a determinant A, it holds for i < j that A[i,i] A[j,j] − A[i,j] A[j,i] = A (A[j,j] )[i,i] .
(5)
Here (A[j,j] )[i,i] is the (i, i) th cofactor of A[j,j] , simply speaking, that stands for the sub-determinant of A in which the ith, j th rows and ith, j th columns have been removed. The identity (5) was used in Blumenthal’s book [1] several times without proof, maybe he thought it well-known, see the pages 100, 102, etc. A proof can be found in [7] or [8]. Applying (5) to the Cayley-Menger determinant D, D[i,i] D[j,j] − D[i,j] D[j,i] = D(D[j,j] )[i,i] , where clearly D[i,i] is the Cayley-Menger determinant of an (n − 1)-tuple, by Theorem 1, D[i,i] = 0, D = 0 because n ≥ d + 3. Noting D is symmetric, we have D[i,j] = 0. Corollary 1 thus holds. For practical convenience sometimes we need also consider an n-tuple of points, oriented hyperplanes and oriented hyperspheres in Euclidean space, P ∗ = {p1 , p2 , · · · , pn }, with a mapping g ∗ : P ∗ × P ∗ → R as follows. •
ri2 + rj2 − oi oj 2 if both are oriented hyperspheres with radii 2 ri rj ∗ ri , rj and centers oi , oj , so g (pi , pj ) = cos(pi , pj ) when pi intersects pj . Note that ri and rj are signed since pi and pj oriented. g ∗ (pi , pj ) be
Distance Coordinates Used in Geometric Constraint Solving •
•
• •
•
219
g ∗ (pi , pj ) be cos(pi , pj ) if both are oriented hyperplanes, or one is oriented hyperplane and the other oriented hypersphere that pi intersects pj . hij g ∗ (pi , pj ) be if pi is an oriented hypersphere with radius ri and center oi , ri and pj an oriented hyperplane whereof the signed distance from oi is hij . 1 g ∗ (pi , pj ) be − pi pj 2 if both are points. 2 g ∗ (pi , pj ) be the signed distance from pi to pj , if one is a point and the other an oriented hyperplane. 1 2 g ∗ (pi , pj ) be (r − oi pj 2 ) if pi is an oriented hypersphere with radius ri 2ri i and center oi , and pj a point.
∗ ∗ denote g ∗ (pi , pj ) and G∗ denote the matrix (gij )n×n , by By gij
D∗ (p1 , p2 , · · · , pn ) denote the determinant |G∗ | and call it D∗ -determinant of P ∗ . Analogously, we have Theorem 2. Let D∗ (p1 , p2 , · · · , pn ) be the D∗ -determinant of an n-tuple of points, oriented hyperplanes and oriented hyperspheres in d-dimensional space. If n ≥ d + 3, then (6) D∗ (p1 , p2 , · · · , pn ) = 0. This theorem is simply the Theorem 1.3 of article [9], and can also be found in earlier article [8]. We do not repeat the proof here. Corollary 2. Let D∗ be the D∗ -determinant of an n-tuple of points, oriented hyperplanes and oriented hyperspheres in d-dimensional space. If n ≥ d+ 4, then ∗ D[i,j] =0
( for i, j = 1, . . . , n.)
(7)
As for a systematic and complete investigation on metric relations of points, hyperplanes and hyperspheres, see [10].
2
Distance Coordinates and Constraint Equations
There are different ways to introduce a distance coordinate system for solving geometric constraint problems, see below for example. Triple Coordinate System in E3 Choose 3 points or oriented planes as a reference triangle, say, {pi1 , pi2 , pi3 }. For any point or oriented plane pj , take ( g(pj , pi1 ), g(pj , pi2 ), g(pj , pi3 ) ) as the coordinates of pj , where function g was well-defined in last section.
220
Lu Yang
Here the choice for the reference triangle may be arbitrarily but the CayleyMenger determinant of pi1 , pi2 , pi3 must be non-vanishing, i.e. D(pi1 , pi2 , pi3 ) = 0. To solve a constraint problem on a point-plane configuration {p1 , · · · , pn }, we need only find the distance coordinates of every pi . For any couple (pi , pj ) with i < j, if g(pi , pj ) is given as a constraint and {pi , pj } ∩ {pi1 , pi2 , pi3 } = ∅, then we take D(pi1 , pi2 , pi3 , pi , pj ) = 0 as a constraint equation. A complete set of constraint equations is established in this way. Let k be the number of these equations. On the other hand, let S1 = {(pi , pj ) | 1 ≤ i < j ≤ n, {pi , pj } ∩ {pi1 , pi2 , pi3 } = ∅},
(8)
then the cardinal number of set S1 is 3n − 6. Assume this geometric constraint problem is well-constrained. Then, the number of independent constraints should be 3n − 6 since this is a point-plane configuration. It was known from above argument that exactly k constraints do not concern pi1 , pi2 , pi3 , so exactly 3n − 6 − k constraints concern pi1 , pi2 , pi3 . Therefore, among 3n − 6 distances (or angles) on S1 , there are exactly 3n − 6 − k items are given as constraints, so that k items are unknown. Thus, the number of unknowns equals that of constraint equations. Quartuple Coordinate System in E3 Choose 4 points or oriented planes as a reference tetrahedron, say, {pi1 , pi2 , pi3 , pi4 }. For any point or oriented plane pj , take ( g(pj , pi1 ), g(pj , pi2 ), g(pj , pi3 ), g(pj , pi4 ) ) as the coordinates of pj . Here the choice for the reference tetrahedron may be arbitrarily but the Cayley-Menger determinant of pi1 , pi2 , pi3 , pi4 must be non-vanishing, i.e. D(pi1 , pi2 , pi3 , pi4 ) = 0. To solve a constraint problem on a point-plane configuration {p1 , · · · , pn }, we need only find the distance coordinates of every pi . For any couple (pi , pj ) with i < j, if g(pi , pj ) is given as a constraint and {pi , pj } ∩ {pi1 , pi2 , pi3 , pi4 } = ∅, then we take (9) D(pi1 , pi2 , pi3 , pi4 , pi , pj )[5,6] = 0 as a constraint equation, where D[5,6] stands for the (5,6) th cofactor of D, as defined formerly. Let l be the number of these equations. Furthermore, for ev/ {pi1 , pi2 , pi3 , pi4 }, take ery pj ∈ D(pi1 , pi2 , pi3 , pi4 , pj ) = 0
(10)
Distance Coordinates Used in Geometric Constraint Solving
221
Fig. 1. as a constraint equation, we obtain n − 4 equations. A complete set of constraint equations with l + n − 4 members is established in the two ways. On the other hand, let S2 = {(pi , pj ) | 1 ≤ i < j ≤ n, {pi , pj } ∩ {pi1 , pi2 , pi3 , pi4 } = ∅},
(11)
then the cardinal number of set S2 is 4n − 10. Assume this geometric constraint problem is well-constrained. Then, the number of independent constraints should be 3n − 6 since this is a point-plane configuration. It was known from above argument that exactly l constraints do not concern pi1 , pi2 , pi3 , pi4 , so exactly 3n − 6 − l constraints concern pi1 , pi2 , pi3 , pi4 . Therefore, among 4n − 10 distances (or angles) on S2 , there are exactly 3n − 6 − l items are given as constraints, so that l + n − 4 items are unknown. Thus, the number of unknowns equals that of constraint equations. As one of the advantages, the quartuple coordinates can uniquely determine the Cartesian coordinates when the reference tetrahedron is fixed, while the triple coordinates usually give alternate Cartesian coordinate representations; hence we suggest readers use quartuple coordinates sometimes.
3
Examples
The 6p Octahedral Problem. This was discussed in many articles [2, 5, 4]. Hoffmann mentioned a paper by Michelucci [6] where Cayley-Menger determinant was used to solve this problem, but it did not follow a systematic algorithm. Referring to Fig. 1, where each pi may be a point or an oriented plane, the quartuple coordinate system with reference tetrahedron {p2 , p3 , p4 , p5 } produces a complete set of constraint equations consisting of 2 equations, D(p2 , p3 , p4 , p5 , p1 ) = 0, D(p2 , p3 , p4 , p5 , p6 ) = 0, with 2 unknowns, g(p2 , p4 ) and g(p3 , p5 ). This coincides with the result of [6]. It is not difficult to find the symbolic solutions of the above set of equations. Alternatively, the triple coordinate system with reference triangle {p1 , p2 , p3 } produces
222
Lu Yang
a complete set of constraint equations consisting of 3 equations, D(p1 , p2 , p3 , p4 , p5 ) = 0, D(p1 , p2 , p3 , p4 , p6 ) = 0, D(p1 , p2 , p3 , p5 , p6 ) = 0, with 3 unknowns, g(p2 , p4 ), g(p3 , p5 ) and g(p1 , p6 ). The 12p Icosahedral Problem. Referring to Fig. 2, the triple coordinate system with reference triangle {p1 , p2 , p3 } produces a complete set of constraint equations consisting of 18 equations, while the routine Cartesian coordinate approach would produce a set of 30 constraint equations. Following is the set of 18 equations: D(p1 , p2 , p3 , p4 , p5 ) = 0, D(p 1 , p2 , p3 , p4 , p9 ) = 0, D(p 1 , p2 , p3 , p4 , p10 ) = 0, D(p 1 , p2 , p3 , p5 , p6 ) = 0, D(p 1 , p2 , p3 , p5 , p10 ) = 0, D(p 1 , p2 , p3 , p5 , p11 ) = 0, D(p 1 , p2 , p3 , p6 , p7 ) = 0, D(p 1 , p2 , p3 , p6 , p11 ) = 0, D(p1 , p2 , p3 , p7 , p8 ) = 0, D(p1 , p2 , p3 , p7 , p11 ) = 0, D(p 1 , p2 , p3 , p7 , p12 ) = 0, D(p 1 , p2 , p3 , p8 , p9 ) = 0, D(p 1 , p2 , p3 , p8 , p12 ) = 0, D(p 1 , p2 , p3 , p9 , p10 ) = 0, D(p 1 , p2 , p3 , p9 , p12 ) = 0, D(p 1 , p2 , p3 , p10 , p11 ) = 0, D(p 1 , p2 , p3 , p10 , p12 ) = 0, D(p1 , p2 , p3 , p11 , p12 ) = 0.
Fig. 2.
Distance Coordinates Used in Geometric Constraint Solving
223
Alternatively, the coordinate system with reference tetrahedron {p1 , p2 , p3 , p4 } produces a complete set of constraint equations consisting of 23 equations, and that with reference tetrahedron {p1 , p2 , p9 , p11 } produces a complete set of constraint equations consisting of 19 equations, that is, D(p1 , p2 , p9 , p11 , p3 , p4 )[5,6] = 0, D(p 1 , p2 , p9 , p11 , p3 , p8 )[5,6] = 0, D(p 1 , p2 , p9 , p11 , p4 , p5 )[5,6] = 0, D(p 1 , p2 , p9 , p11 , p4 , p10 )[5,6] = 0, D(p 1 , p2 , p9 , p11 , p5 , p6 )[5,6] = 0, D(p 1 , p2 , p9 , p11 , p5 , p10 )[5,6] = 0, D(p 1 , p2 , p9 , p11 , p6 , p7 )[5,6] = 0, D(p 1 , p2 , p9 , p11 , p7 , p8 )[5,6] = 0, D(p1 , p2 , p9 , p11 , p7 , p12 )[5,6] = 0, D(p1 , p2 , p9 , p11 , p8 , p12 )[5,6] = 0, D(p1 , p2 , p9 , p11 , p10 , p12 )[5,6] = 0, D(p 1 , p2 , p9 , p11 , p3 ) = 0, D(p 1 , p2 , p9 , p11 , p4 ) = 0, D(p 1 , p2 , p9 , p11 , p5 ) = 0, D(p 1 , p2 , p9 , p11 , p6 ) = 0, D(p 1 , p2 , p9 , p11 , p7 ) = 0, D(p 1 , p2 , p9 , p11 , p8 ) = 0, D(p 1 , p2 , p9 , p11 , p10 ) = 0, D(p1 , p2 , p9 , p11 , p12 ) = 0 where D(· · ·)[5,6] stands for the (5, 6) th cofactor of determinant D(· · ·), as introduced in Section 1. The 4p1L Problem. Consider a spatial configuration of points p1 , · · · , p4 and a straight line L, given the distances between the points, p 1 p 2 = a1 , p 2 p 3 = a2 , p 3 p 1 = a3 , p1 p4 = b 1 , p2 p4 = b 2 , p3 p4 = b 3 , and the distances from every pi to L, distance(pi , L) = di , for i = 1, . . . , 4. Since (p1 , · · · , p4 , L ) is not a point-plane configuration, we consider a new one instead. Through point p4 draw a plane p5 perpendicular to L, and assume p5 intersects L at point p6 . Now we have a point-plane configuration, p1 , · · · , p6 . By x1 , x2 , x3 denote the unknown signed distances from p1 , p2 , p3 to plane p5 , respectively, i.e. x1 = g(p1 , p5 ), x2 = g(p2 , p5 ), x3 = g(p3 , p5 ). It follows by Pythagorean Theorem that g(p1 , p6 ) = x21 + d21 ,
g(p2 , p6 ) = x22 + d22 ,
g(p3 , p6 ) = x23 + d23 .
224
Lu Yang
With {p4 , p5 , p6 } as reference triangle, construct a triple coordinate system, and obtain a set of 3 constraint equations, D(p4 , p5 , p6 , p1 , p2 ) = 0, D(p4 , p5 , p6 , p2 , p3 ) = 0, D(p4 , p5 , p6 , p3 , p1 ) = 0, with just 3 unknowns, x1 , x2 , x3 . Write these equations in detail: 0 0 d24 b21 b22 1 0 −1 0 x1 x2 0 2 2 2 2 2 2 d4 0 0 x + d x + d 1 1 2 2 1 2 2 = 0, b1 x1 x21 + d21 0 a 1 1 2 2 2 2 b2 x2 x2 + d2 a1 0 1 1 0 1 1 1 0 0 0 d24 b22 b23 1 0 −1 0 x2 x3 0 2 2 2 2 2 2 d4 0 0 x2 + d2 x3 + d3 1 2 = 0, b2 x2 x22 + d22 0 a22 1 2 2 b3 x3 x23 + d23 a2 0 1 1 0 1 1 1 0 0 0 d24 b23 b21 1 0 −1 0 x3 x1 0 2 2 2 2 2 2 d4 0 0 x3 + d3 x1 + d1 1 2 = 0. b3 x3 x23 + d23 0 a23 1 2 2 b1 x1 x21 + d21 a3 0 1 1 0 1 1 1 0
(12)
(13)
(14)
The 5p1L Problem. Analogously, consider a spatial configuration of points p1 , · · · , p5 and a straight line L, given the lengths of some segments, p 1 p 2 = a1 , p 2 p 3 = a2 , p 3 p 4 = a3 , p 4 p 1 = a4 , p1 p5 = b 1 , p2 p5 = b 2 , p3 p5 = b 3 , p4 p5 = b 4 , and the distances from every pi to L, distance(pi , L) = di , for i = 1, . . . , 5. Since (p1 , · · · , p5 , L ) is not a point-plane configuration, we consider a new one instead. Through point p5 draw a plane p6 perpendicular to L, and assume p6 intersects L at point p7 . Now we have a point-plane configuration, p1 , · · · , p7 . By x1 , x2 , x3 , x4 denote the unknown signed distances from p1 , p2 , p3 , p4 to plane p6 , respectively, i.e. x1 = g(p1 , p6 ), x2 = g(p2 , p6 ), x3 = g(p3 , p6 ), x4 = g(p4 , p6 ). It follows by Pythagorean Theorem that g(p1 , p7 ) = x21 + d21 , g(p3 , p7 ) = x23 + d23 ,
g(p2 , p7 ) = x22 + d22 , g(p4 , p7 ) = x24 + d24 .
Distance Coordinates Used in Geometric Constraint Solving
225
With {p5 , p6 , p7 } as reference triangle, construct a triple coordinate system, and obtain a set of 4 constraint equations, D(p5 , p6 , p7 , p1 , p2 ) = 0, D(p5 , p6 , p7 , p2 , p3 ) = 0, D(p5 , p6 , p7 , p3 , p4 ) = 0, D(p5 , p6 , p7 , p4 , p1 ) = 0, with just 4 unknowns, x1 , x2 , x3 , x4 . Write these equations in detail: 0 0 d25 b21 b22 1 0 −1 0 x1 x2 0 2 2 2 2 2 2 d5 0 0 x + d x + d 1 1 2 2 1 2 2 = 0, b1 x1 x21 + d21 0 a 1 1 2 b2 x2 x22 + d22 a21 0 1 1 0 1 1 1 0 0 0 d25 b22 b23 1 0 −1 0 x2 x3 0 2 2 2 2 2 2 d5 0 0 x + d x + d 2 2 3 3 1 2 2 b2 x2 x22 + d22 = 0, 0 a 1 2 2 2 2 2 b3 x3 x3 + d3 a2 0 1 1 0 1 1 1 0 0 0 d25 b23 b24 1 0 −1 0 x3 x4 0 2 2 2 2 2 2 d5 0 0 x + d x + d 3 3 4 4 1 2 2 b3 x3 x23 + d23 = 0, 0 a 1 3 2 2 2 2 b4 x4 x4 + d4 a3 0 1 1 0 1 1 1 0 0 0 d25 b24 b21 1 0 −1 0 x4 x1 0 2 2 2 2 2 2 d5 0 0 x + d x + d 4 4 1 1 1 = 0. 2 2 b4 x4 x24 + d24 0 a 1 4 2 2 b1 x1 x21 + d21 a 0 1 4 1 0 1 1 1 0
(15)
(16)
(17)
(18)
See [5] for different approaches to 4p1L and 5p1L problems. The Ball Touch Problem. Draw a ball which touches four given balls. By p1 , p2 , p3 , p4 and r1 , r2 , r3 , r4 denote the centers and radii of the given balls, respectively, and let p5 and x be the center and radius of the ball we want. Set a quartuple coordinate system with reference tetrahedron {p1 , p2 , p3 , p4 }. We need only find g(pi , p5 ), i.e. (x + ri )2 , the distance coordinates of p5 , for i = 1, 2, 3, 4, which depend on a single unknown x. Then, the single equation, D(p1 , p2 , p3 , p4 , p5 ) = 0, is enough for solving the constraint problem.
(19)
226
Lu Yang
Fig. 3.
4
More Distance Coordinate Systems
When we investigate the planar configurations formed by circles, (straight) lines and points, it is sometimes more convenient to use a coordinate system with circles and lines as reference triangle/tetrahedron. The Malfatti Problem. Draw 3 circles into a triangle such that each circle contacts other two and contacts two sides of the triangle, as shown in Fig. 3. By L1 , L2 , L3 and θ1 , θ2 , θ3 denote the sides and interior angles, and C4 , C5 , C6 the circles, respectively. Let the triangle and all the circles have the counterclockwise orientation. Referring to Theorem 2, construct a triple coordinate system with reference triangle {L1 , L2 , L3 }. Take ( g ∗ (Cj , L1 ), g ∗ (Cj , L2 ), g ∗ (Cj , L3 ) ) as the coordinates of Cj for j = 4, 5, 6, where function g ∗ was well-defined before. This triple coordinate system produces a complete set of constraint equations consisting of 3 equations, ∗ D (L1 , L2 , L3 , C4 , C5 ) = 0, (20) D∗ (L1 , L2 , L3 , C4 , C6 ) = 0, ∗ D (L1 , L2 , L3 , C5 , C6 ) = 0, with 3 unknowns, g ∗ (L2 , C4 ), g ∗ (L3 , C5 ), g ∗ (L1 , C6 ), which we denote by x, y, z. Note that (L2 , L3 ) = π − θ1 , (L3 , L1 ) = π − θ2 , (L1 , L2 ) = π − θ3 , hence cos(L2 , L3 ) = − cos θ1 , cos(L3 , L1 ) = − cos θ2 , cos(L1 , L2 ) = − cos θ3 . Write the equations of (20) in detail:
Distance Coordinates Used in Geometric Constraint Solving
1 − cos θ3 − cos θ2 1 1 1 − cos θ3 − cos θ2 1 z 1 − cos θ3 − cos θ2 1 z
− cos θ3 − cos θ2 1 1
− cos θ1 x
− cos θ1
1
1
x
1
1
1
y
−1
− cos θ3 − cos θ2 1 1
− cos θ1 x
− cos θ1
1
1
x
1
1
1
1
−1
− cos θ3 − cos θ2 1 1
− cos θ1 1
− cos θ1
1
y
1
y
1
1
1
−1
1 1 y = 0, −1 1 z 1 1 = 0, −1 1 z 1 1 = 0. −1 1
227
(21)
(22)
(23)
Alternatively, the coordinate system with reference tetrahedron {L2 , L3 , C4 , C5 } produces a complete set of constraint equations consisting of 2 equations, ∗ D (L2 , L3 , C4 , C5 , L1 ) = 0, (24) D∗ (L2 , L3 , C4 , C5 , C6 ) = 0, with 2 unknowns, x = g ∗ (L2 , C4 ) and y (24) in detail: 1 − cos θ1 x − cos θ1 1 1 x 1 1 1 y −1 − cos θ3 − cos θ2 1
= g ∗ (L3 , C5 ). Write the equations of 1 − cos θ3 y − cos θ2 −1 1 = 0, 1 1 1 1
(25)
228
Lu Yang
1 − cos θ1 − cos θ1 1 x 1 1 y 1 1
x
1
1
y
1 −1 −1 1 −1 −1
1 1 −1 = 0. −1 1
(26)
It is not difficult to find the symbolic solutions of the set consisting of (25) and (26). Contrastively, it was reported in [3] that, for the same problem, a complete set of constraint equations consisting of 30 equations with 30 unknowns was obtained using Cartesian coordinate system. The 6 Circle Packing Problem. Draw 6 circles into a triangle such that each circle either contacts other two circles and two sides of the triangle, or contacts other 4 circles and one side, as shown in Fig. 4. By L1 , L2 , L3 and θ1 , θ2 , θ3 denote the sides and interior angles, and C4 , · · · , C9 the circles, respectively. Let the triangle and all the circles have the counterclockwise orientation. Construct a triple coordinate system with reference triangle {L1 , L2 , L3 }. Take ∗ ( g (Cj , L1 ), g ∗ (Cj , L2 ), g ∗ (Cj , L3 ) ) as the coordinates of Cj for j = 4, . . . , 9. This triple coordinate system produces a complete set of constraint equations consisting of 9 equations, ∗ D (L1 , L2 , L3 , C4 , C5 ) = 0, ∗ (L1 , L2 , L3 , C4 , C9 ) = 0, D ∗ D (L1 , L2 , L3 , C5 , C6 ) = 0, D∗ (L1 , L2 , L3 , C5 , C7 ) = 0, (27) D∗ (L1 , L2 , L3 , C5 , C9 ) = 0, ∗ D (L , L , L , C , C ) = 0, 1 2 3 6 7 D∗ (L1 , L2 , L3 , C7 , C8 ) = 0, ∗ D∗ (L1 , L2 , L3 , C7 , C9 ) = 0, D (L1 , L2 , L3 , C8 , C9 ) = 0. Alternatively, the coordinate system with reference tetrahedron {L1 , C5 , C7 , C9 } produces a complete set of constraint equations consisting of 10 equations, ∗ D (L1 , C5 , C7 , C9 , L2 , L3 )[5,6] = 0, ∗ D (L1 , C5 , C7 , C9 , L2 , C6 )[5,6] = 0, ∗ D (L1 , C5 , C7 , C9 , L2 , C8 )[5,6] = 0, ∗ (L1 , C5 , C7 , C9 , L3 , C4 )[5,6] = 0, D ∗ D (L1 , C5 , C7 , C9 , L3 , C8 )[5,6] = 0, (28) D∗ (L1 , C5 , C7 , C9 , L2 ) = 0, D∗ (L1 , C5 , C7 , C9 , L3 ) = 0, D∗ (L1 , C5 , C7 , C9 , C4 ) = 0, ∗ D∗ (L1 , C5 , C7 , C9 , C6 ) = 0, D (L1 , C5 , C7 , C9 , C8 ) = 0.
Distance Coordinates Used in Geometric Constraint Solving
229
Fig. 4. It was reported also in [3] that, for the 6 circle packing problem, a complete set of constraint equations consisting of 54 equations with 54 unknowns was obtained using Cartesian coordinate system. The author made a short program (in Maple) which implements the algorithm introduced in this paper that automatically produces a complete set of constraint equations. The distance coordinate method usually gives less equations than other ones.
References [1] Blumenthal, L. M., Theory and Applications of Distance Geometry, Clarendon Press, Oxford, 1953. (The second edition, Chelsea, New York, 1970.) 218 [2] Durand, C. & Hoffmann, C. M., A systematic framework for solving geometric constraints analytically, J. of Symbolic Computation, 30: 483-520, 2000. 221 [3] Ge, J.-X., Chou S.-C. & Gao X.-S., Geometric constraint satisfaction using optimization methods, Computer-Aided Design, 31(1999), 867-879. 228, 229 [4] Gao, X.-S., Yang, W.-Q. & Hoffmann C. M., Solving spatial basic configurations with locus intersection, MM Research Prints, 20, 1-22, MMRC, AMSS, Academia Sinica, Bejing, December 2001. 221 [5] Hoffmann, C. M. & Yuan, B., On spatial constraint approaches, Automated Deduction in Geometry, LNAI 2061, J. Richter-Gebert & D. Wang (eds.), 1-15, Springer Verlag, 2001. 221, 225 [6] Michelucci, D., Using Cayley-Menger Determinants, web document available from http://www.emse.fr/ micheluc/MENGER/index.html. 221 [7] Yang, L. & Zhang, J. Z., A class of geometric inequalities on finite points, Acta Math. Sinica, 23(5), 740-749, 1980. (in Chinese) 217, 218 [8] Yang, L. & Zhang, J. Z., The concept of the rank of an abstract distance space, Journal of China University of Science and Technology, 10(4), 52-65, 1980. (in Chinese) 217, 218, 219 [9] Yang, L. & Zhang, J. Z., Metric equations in geometry and their applications, I. C. T. P. Research Report, IC/89/281, International Centre for Theoretical Physics, Trieste, Italy, 1989. 217, 219 [10] Zhang, J. Z., Yang, L. & Yang, X. C., The realization of elementary configurations in Euclidean space, Science in China, A 37(1), 15-26, 1994. 219