HAL Id: hal-00961981
https://hal.archives-ouvertes.fr/hal-00961981
Submitted on 25 Mar 2014
HAL is a multi-disciplinary open access
archive for the deposit and dissemination of
sci-entific research documents, whether they are
pub-lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d’enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
Theorems in Geometry
Denis Bouhineau, Laurent Trilling, Jacques Cohen
To cite this version:
Denis Bouhineau, Laurent Trilling, Jacques Cohen. An Application of CLP: Checking the Correctness
of Theorems in Geometry. Constraints, Springer Verlag, 1999, 4 (4), pp.383–405. �hal-00961981�
An Appli ation of CLP:
Che king the Corre tness of Theorems
in Geometry
DENISBOUHINEAU denis.bouhineauirin.univ-nantes.fr IRIN,UniversityofNantes,Fran e
LAURENTTRILLING laurent.trillingimag.fr
LSR-IMAGUniversityof Grenoble,Fran e
ANDJACQUESCOHEN j s.brandeis.edu
BrandeisUniversity,Waltham,Massa husetts,USA
Keywords: onstraints,planarEu lideangeometry,theoremveri ation,symboli representation ofradi alsusingrationals,uni ation.
Abstra t. ConstraintLogi Programming anbeadvantageouslyusedto dealwithquadrati onstraints stemming fromthe veri ation of planar geometry theorems. Ahybrid symboli { numeri representationinvolvingradi als andmultiplepre isionrationalsisusedto denotethe resultsofquadrati equations. Auni ation{likealgorithmtestsfortheequalityoftwo expres-sionsusingthatrepresentation.Theproposedapproa halsoutilizesgeometri transformationsto redu ethenumberofquadrati equationsdeninggeometri onstru tionsinvolving ir lesand straightlines. Alargenumber(512)ofgeometrytheoremshasbeenveriedusingtheproposed approa h.Thosetheoremshadbeenproven orre tusingasigni antmore omplex(exponential) approa hinatreatiseauthoredbyChouin1988. Eventhoughthe proposedapproa hisbased onveri ation-ratherthanstri t orre tnessutilizedbyChou-theeÆ ien yattainedis polyno-mialthusmakingtheapproa husefulin lassroomsituationswherea onstru tionattemptedby studenthastobequi klyvalidatedorrefuted.
1. Introdu tion
Thispaperdes ribesanovelappli ationof ConstraintLogi Programming(CLP) languages: verifying the orre tness of theoremsin two dimensionalgeometry in-volvingstraightlines and ir les. Thewell known ConstraintLogi Programming Languages (e.g., Prolog III and IV, CLP(R), Chip) an handle the test of sati-abilityof systemsof linear equationsdes ribing straightlines. However, the ase of ir les an only be handled in parti ular aseswhere linearizationof quadrati equationsbe omesfeasiblebyresortingto lazyevaluation te hniques (freeze.)
Furthermore, in the ase of theorem veri ation, it is essential to utilize multi-ple pre isionto avoid oating point representationsfor whi h equality annot be resolvedwithoutspe ifying approximations. From theabovementionedCLP lan-guages,PrologIIIandIVfeaturemultiplepre isionrationalsolutionsofsystemsof
However,inhandlingquadrati equationsgeneratedbythespe i ationof ir les, generalsolutions anonlybeexpressedin termsofsquareroots,andthatmodeof expression is unavailable in PrologIII or IV. InProlog IVone may resortto the useofnumeri intervalsbutagaintheproblemofequalityofexpressions annot,in general,beresolvedusingintervalswithoutapproximations.
FromaCLPpointofview,oneofthe ontributionsofthispaperistoextendthe apabilities ofa onstraintlanguageusingmultiple pre isionand linearequations tothe aseofthenumeri determinationofequalitybetweenexpressions ontaining radi als(square roots.) Notethat theradi als may themselves ontainembedded radi als.
Whatisneededisa\uni ation-like"algorithm apableofsolvingquadrati equa-tionsand determiningiftwoexpressions ontainingradi alsare exa tlyequal. In thiswork thisisa omplishedusingahybridnumeri al-symboli formby express-ingradi alsintermsofsquarerootsof ertainintegers. Auni ation-likere ursive algorithmisthenusedtosolvequadrati equationsand he kpre iselytheequality ofexpressions.
Another ontribution ofthis paperis thereformulationofthe he kingof satis-ability of mixed systems of linearand quadrati equations. Byreformulationit is meant the areful generation of quadrati equations and linear equations rep-resenting a given theorem. It is shown that { in the ase of geometry theorem veri ation{the he kingof orre tnessusingtheproposedapproa hisappli able to all the 512theorems onsidered in a lassi treatise authored by Shang-Ching Chou [Chou-88℄and the vast majority anbe handled using only linearequation solving.
Those theorems had been proved \valid" using stri tly symboli manipulation, whi h is mu h ostlier time-wise than the approa h des ribed in this paper. It should be remarked that the purely-symboli approa h used by Chou may yield resultsthatareonlyvalidina omplexdomain;ontheotherhandtheapproa hin thispaperonly he ksthe orre tnessoftheoremsthatarespe iedusingarbitrary numeri alvaluesrepresentingthepositionsoflinesand ir les.
Presently, there are three approa hes for solving problems involving quadrati onstraints. These approa hes are onsidered below in de reasingorder of om-plexityandgenerality.
a. The Grobnerbases method [Kutzler-88℄. This approa h isthe most general,andthemost ostly omputationally. It anhandleany poly-nomial onstraints. Itsin onvenientisthatitmayrespondaÆrmatively tothevalidityofatheoremwhosegeometri al onstru tionisonly
well-b. G. Pesant'smethod [Pesant-95℄. This approa h is themost general forpro essingquadrati onstraints. It lassiesasystemofquadrati onstraintsintoseveral lassesin ludingthoseforwhi hthereexistonly omplex solutions. Nevertheless, there are ases in whi h one has to resorttotheuseofapproximationsandspe ifyasmallvalue establish-ing theallowabledieren e betweentworeal numbersthat should be equal. Inthose ases,theequalityoftwoexpressionsinvolvingradi als anonlybedoneapproximately.
. Theproposedmethod. It andealwithafairlylarge lassofproblems involvingamixtureofquadrati and linear onstraints. Itsu eeds in pra ti allyall asesinwhi hthelazyevaluationmethod(usedinCLP languages)leadstoafailureduetoitsinabilitytoexpressradi als. The method'sonlyin onvenientisthat,in ertain(rare) ases,itmayresult inanexponentialexplosion ofthenumberofnestedradi alsneededto representarealnumber.
It isanoftenthe asethat oneshould notuseapowerfulbut ostly general algo-rithmtosolveinstan esofaparti ularproblemforwhi hsimpleralgorithmsexist. That premise is satised by adopting approa hes b. and . However, Pesant's method annotavoidhandlingapproximations. Furthermore,theexisten eofCLP languages,and theeaseofimplementation toverify theoremsin geometry, amply justiesadoptingtheproposedapproa h.
Alsonoti ethat,inprovingtheoremsingeometry,itisoftenassumedthatsome oftheobje ts anbepla edatxedpositions withoutlossofgenerality. (Say,one ofthe ir leshasits enterat oordinates(0,0))Su hpro edureisvalidevenwhen usingtheGrobnerbasisapproa h.
Thepresentauthors alsowanttomakeitvery learthat, theveri ationofthe validityofatheorem{bypassingana tualformalproof{isanimportanttopi that is often informally used in a lassroom setting. Assume that a student proposes a new onstru tion aiming to prove a given theorem. A qui k ounter-example usuallysuÆ estoredire tthestudenttowardstryinganother onstru tion. Itisin that ontextthattheproposedapproa hisofgreatestvalue. Also,inthat ontext, itis appropriatetoverifyageometri propertyonagurebeforepro eeding toa formalproofofthatproperty.
2. Comparisonwith Existing Approa hes
In [Chou-88℄, a treatise on the automati proofs of planar geometry theorems, Shang-ChingChouused exponentialalgorithmi methodsto assertthevalidityof 512theoremsin thatareaofgeometry.
Chou'sapproa hisbasedonWu'smethods[Wu-94℄thatareappli ableto ombi-nationsofquadrati andlinearequationswithsymboli oeÆ ients. Chou'smethod insuresthat thegeometri onstru tionsexpressedbythoseequationsresultinan equation expressing the property that one wishes to prove. In other words, the
equationsspe ifyingthe onstru tionsneededtostatethetheorem. Basi ally,the proof orrespondstodeterminingtheequalityoftwoformulas ontainingthe vari-ablesoftheproblem. Equivalently,one anrepla e thatproblem byonein whi h thedieren eoftwoformulas(apolynomial)isshownto bealwaysequaltozero.
ThealgorithmsusedbyChouarepurelysymboli (i.e.,basedonWu'salgorithm) andverylikelyhaveworst- aseexponential omplexity. Thisisnotunusualin alge-brai theorem proving,wherealgorithmsmayhavedoublyexponential omplexity [Dube,Yap-94℄.
The onstraints expressing ir les and lines are based on those obje ts being pla edinarbitrarypositions. Therefore,evenstraightlinesareexpressedby quad-rati onstraintssin ethevariablesaandxintheequationy=ax+bareunknown. Theseequationsarereferredtoaspseudo-linear. Notehoweverthatquadrati on-straintsrepresenting ir lesdonotresultin ubi equationsbe ausethe oeÆ ients ofsquaresareequalto one.
Arststepinredu ingthe omplexityoftheproofistoassumethat ir lesand straightlineswhi hareusedinthe onstru tionarepla edinpositionsdenedby numeri oordinates. We allthisapproa hgeometri theorem he king. Itimplies that, in some ases, the arbitrary hoi e of numeri oeÆ ients might result in provingspe ialinsteadofgeneral asesofatheorem. Inother asestheveri ation ofatheorem usinga arefullysele tednumeri example anyield ageneralproof [Hong-86℄,and[Deng,Zhang,Yang-90℄.
Notealsothateveninthe aseofusingarbitrarynumeri oeÆ ients,aresulting failure in provinga theorem orresponds to determining a ontradi tionwhi h is always usefulin dete ting the falsity ofa onje tured theorem. Su h approa h is parti ularlyadvantageouswhenusingCLP (Intervals)[Benhamou-94℄.
In the tea hing of geometry one an also onveniently use numeri {instead of symboli {valuesforthepositionsof obje tsinaproof[Allen,Idt,Trilling-93℄. In that ontext both student and tea herare entitled to use numeri oeÆ ients in outlining the onstru tions pertaining to a proof. The tea her has to insure the orre tnessofthe onstru tionsutilizedbystudentswhomayusedierent numeri- alvalues. Thisimpliessolvingnumeroussetsofpossiblyredundantquadrati and linearequationswithsome(butnotall)numeri oeÆ ients.
Thegoalofthispaperistoshowthat,byusing arefullydesignedhybrid numeri -symboli algorithms, one anes apethe urse ofexponentialityin he king quad-rati onstraintsof most geometri problems. Of the 512 problems suggestedby Chou,thevastmajority(487problems) anbehandledusing stri tlylinear equa-tionsolvingintherealmofrationals. Thatpro essing byGauss-likemethodshas polynomial omplexity. Theremaining25problems anbesolvedusingthe repre-sentationdetailed inthenextse tion.
posed algorithm whi h was implemented using Prolog III as the CLP language of hoi e, and (4) thestrategies forgenerating the onstraints. Examples are in-terspersed among the various se tions. Thenal se tions present theresults and in ludethenalremarks.
Thereaderisreferredto theAppendi esthat ontaintwoillustrativeexamples. Appendix A illustrates the inadequa y of using a symboli pa kage, like Maple, in testing for the equality of two expressions ontaining radi als. Appendix B illustrates the approa h utilized by Chou in proving a theorem that is veried usingtheproposed approa h(Se tion6.4)
3. NumberRepresentation
3.1. Anexample
The following exampleillustrates the problems of using oating point operations to omputevaluesofvariables. Considertheexpression,[Dube,Yap-94℄:
f =333:75b 6 +a 2 (11a 2 b 2 b 6 121b 4 2)+5:5b 8 +a=2b wherea=77617andb=33096
Thevalueoff is omputedtobe:
1.172603inthe aseofanIBM370,
-1.18059e+21usingIEEEdoublepre ision,
-.99999...999998827e+17usingMaplewith20signi ant dig-its,
-0.83usingMathemati awitha2digitsa ura y,while oper-ationsareperformedwith40digits
Thetruevalueoff usingtherst20signi antdigitsis:
0:827396059946821368141165095479816291999
Obviously,therearegreatdis repan iesamongtheaboverepresentations. There-fore,theproblemof he kingtheequalityoftwoarithmeti terms annotbedone a uratelywithoutusingsomeapproximationthatmaywelldistortthemeaningof equality.
Theaboveexamplesshowtheinadequa yof oatingpointrepresentationsin a - uratelytestingtheequalityoftwoexpressions. Thisproblemisparti ularlya ute whenattemptingtorefuteaproofofatheoremingeometry. Iftheequalityoftwo expressions an only be madewitha ertain degreeofpre ision, thena onstru -tion annotbeprovedfalse,espe iallyinthe asewheresubstantialroundingerrors
Inthis work weareinterestedin representationsfor arithmeti expressions on-tainingradi alssothattheequalitybetweenexpressions anbedeterminedexa tly withabooleananswer\yes",or\no".
3.2. Number representation
Theaboveproblem ofdetermining theequalityand disequalityof square roots of rationalnumbersisbynomeanstrivial[Landau-92℄. Itamountsto he king,using a omputer,iftwonumbersareidenti al. Equalityonrationals anbe he kedif thenumbersareexpressedwithmultiplepre ision. However,whensquarerootsare performed, theresulting oatingpointrepresentationsprevent he king forexa t equality. Therefore, animportant problemto bedealt with is nding representa-tionsofrealnumbersinvolvingsquarerootsthatinsurea orre ttestingforequality ordisequality.
Real numbers belonging to the algebrai extension of the rationals Q using a singlesquareroot anbeexpressedby:
p+q p
r
wherepandqarerationalsandrisnotasquare. Theequalityoftherealnumbers whoserepresentationshavethesamesquareroots anthereforebeexpressedby:
p+q p r=p 0 +q 0 p r implyingthatp=p 0 , q=q 0 .
Unfortunately, one annot fully es apeexponentiality using this notation. For example,thereal numberwithdoublesquarerootswillbeexpressedby:
(p+q p r)+(p 0 +q 0 p r) p r 0
ontainingthefournumeri rational oeÆ ientsp,q,p 0
,q 0
. Ifnestedmultiplesquare rootsarerequired,the omplexityforstoringandpro essingequalityordisequality be omesexponentialwith thenumberofsquarerootoperations[Bouhineau-97℄.
So, wehaveto omputein the quadrati extension K 0 =Q, K 1 =Q[ p a 0 ℄, ..., K n =K n 1 [ p a n 1 ℄where K n
isan algebrai extension overK n 1 and a n 1 isa positiveelementofK n 1
andhasnosquarerootinK n 1
. LetusdenotebySR-var avariableofK
n
,i.e.,oftheform: p+q p
rwherep,q,andrareeither rationalsor SR-var's. Thea ronymSRstandsforSquarerootsinvolvingRationals.
NotethatSR-variablesareboundtoreal onstantnumbersexpressedinahybrid formofsumsandprodu tsofrationalswhi h anbe\symboli ally"multipliedby thesquarerootofanSRnumber. Therefore,SR-variablesarebound to onstants, i.e.,hybridrepresentationsofrationalnumbersdened bythefollowingsyntax:
<SR-number> ::=<SR-number><op><SR-number> p
<SR-number> <SR-number> ::=rational number
3.3. Arithmeti OperationsInvolving SR-variables
Operations onK n
are dened re ursivelyfrom operationsin K n 1 (proofs appear in[Bouhineau-97℄.) 3.3.1. Addition (p+q p r)+(p 0 +q 0 p r)=(p+p 0 )+(q+q 0 ) p r 3.3.2. Multipli ation (p+q p r)(p 0 +q 0 p r)=(pp 0 +qq 0 r)+(pq 0 +p 0 q) p r 3.3.3. Negation (p+q p r)=( p)+( q) p r 3.3.4. Inverse 1 p+q p r = p p 2 rq 2 q p 2 rq 2 p r 3.3.5. Sign Sign(p+q p r)=Sign(p)when(pq>0) orelse =Sign(p(p 2 rq 2 ))when(pq<0) 3.3.6. SquareRoot q p+q p r=x+y p r when=p 2 rq 2
hasasquareroot Æin K n 1
andY =(p+Æ)=2rhasasquare rooty inK
n 1
andthen x=q=2y, orelse q p+q p r=0+1 p r 0 withr 0 =p+q p rinK n+1 =K n [ p r 0 ℄ p p p
a+b=8+5 p 5 ab=42+22 p 5 a= 2 3 p 5 1=a= 2=41+3=41 p 5 Sign(a)=positive Sign(b)=positive p a = p 2+3 p 5 in Q[ p 5; p 2+3 p 5℄ be ause a is not a squareinQ[ p 5℄ p b=1+ p 5
Note that when multiplying twoSR-vars onehas to perform 5 multipli ations. Thatintrodu esa5
m
omponentwheremisthenumberofnestedsquareroots;m shouldbesmall,otherwisethe omputationisbe omestoo ostly. Thisimpliesthat it is possible to onstru t unusual examples that require exponential omplexity. It will beseenin Se tion 7and 8that these asesdonoto urin any ofthe 512 examples onsideredbyChou,whenpro esseda ordingtothestrategiesdes ribed inthis work.
4. Natureof Geometri Problems
Thegeometri problems onsideredinthispaper anbe lassieda ordingtothe nature of the obje tsinvolvedin geometri onstru tions. Among thetwo dozen onstru tionsutilizedbyChou,therearevethatyieldquadrati onstraintswhose number an be redu edby transformations. These ve asesare subdivided into two lasses.
4.1. Interse tion of obje ts
a. A pointbelongsto theinterse tion ofalineS anda ir leC.
b. Apointbelongstotheinterse tionoftwo ir lesC 1
andC 2
.
Noti e that ase(4.1.b) of the interse tion of two ir les anbe redu edto the aseoftheinterse tionofalineanda ir le(4.1.a)by onsideringthelinepassing
4.2. Other onstru tions
a. Consideranarbitrarypointbelongingtoa ir leC.
b. Constru t the bise trix of an angle spe ied by the interse tion of twolinesS
1 andS
2 .
. GivenapointP and a ir leC, onstru ttheso alled inversepoint P
0
(thenotionofinversewillbedetailedin Se tion6).
Many of Chou's problems an be spe ied using the above lasses and result in algebrai representations having a signi antly redu ed number of quadrati onstraints. Theabove ases ould bes rutinized by atransformation algorithm whosegoalistoredu ethenumberofquadrati onstraintsbyrepla ing,asmu h aspossible,thequadrati onstraintsbylinearones.
Inviewoftheabove,one andes ribeageometri problemin termsof atriplet <Q;L;V >whereQisaset ofquadrati onstraintsonmanyvariablesin luding those that represent arbitrary positions of obje ts(i.e., points, lines and ir les); Lisaset ofpseudo-linearequationsin thesensethat someofthe oeÆ ientsofa linearequationdening astraightline may stillbeunknown;nally, V is aset of numeri values hosenbytheusertospe ifya tualvaluesforthevariablesdening theposition ofarbitraryvaluesfortheobje ts onsideredintheproblem.
Inthenextse tions,weusethefollowingabbreviationsindealingwiththeabove sub ases:
Sub ase1a. Interse tionline- ir le.
Sub ase1b. Interse tion ir le- ir le.
Sub ase2a. Arbitrarypointona ir le.
Sub ase2b. Bise trix.
Sub ase2 . Inversepoint.
5. The AlgorithmforConstraintSolving
Note that it is important to use a strategy that postpones (freezes) as mu h as possiblethepro essingofthequadrati onstraintswiththehopethattheirnumber is redu ed by assignments of variables to numeri values using the numeri data suppliedbytheuserandthelinear onstraints.
This strategy is similar to that used in languageswith linear onstraints solver su hasProlog III and CLP(R) [Colmerauer-93℄,[Jaar,Mi haylov, Stu key, and Yap-92℄. However, there isan importantdieren e: thepro essorsfor those lan-guages will not be able to handle stri tly quadrati onstraints that annot be
The algorithm proper onsists of two juxtaposed while statements embedded withinanexternalwhile statementthatstopstheiterationifanalsolutionhas beenobtained. Therstembedded whiledealswithpseudo-linearequations,the se ondwithquadrati onstraints. Thealgorithm anbedes ribedby:
1. whileasolutionisnotfounddo
2. beginloop0
3. repla ethevaluesofV inQandL
4. (thisstepmaymodifyQandLdynami ally)
5. whilethereareelementsin Ldo
6. beginloop1
7. he kifanelementlofLisoftheformofalinear onstraint
8. P n i=1 m i x i
+p=0where pandthem i
'sareSR-vars
9. ifthat isthe asethen
10. repla ex 1 by( p P n i=2 m i x i )=m 1 in QandL 11. (Gaussianelimination)
12. update Lbyremovingl,and
13. postponeaddingx 1 toV 14. untilallx i 's(2in)areinV;
15. exit bygoingba ktoloop0
16. endif
17. endloop1;
18. while thereareelementsinQdo
19. beginloop2
20. he kifanelementqofQisoftheformn 1 X 2 +n 2 X+n 3 =0 21. where then i 'sareSR-vars
22. if that isthe asethen
23. begin
24. solveforX omputingX =p
x +q
x p
r;
25. (X nowbe omesanSR-var)
26. updateQbyremovingq,andaddingX toV;
27. exit bygoingba ktoloop0
28. endif
29. endloop2
30. endloop0
Noti ethatinthe aseof he kingredundant onstraints,terminationtakespla e withthelast onstraintinQorLbeingofthetypeU =U inwhi hU isanSR-var. Theproofsof orre tnessfortheveri ationoftheequalityappearin
[Bouhineau-initialized, be ause at least one element of Q orL is found within the exe ution of loop0. An additional test anbein orporatedto stopthe omputation if an SR-varhasalargespe iednumberofsquare-rootembeddings.
Alsonoti ethata ru ial\lteringalgorithm",detailedinSe tion6,isneededto obtainthetriplet<Q;L;V >usingthetwo ases(andsub ases)des ribedinthe previousse tion. Re allthatthes reeningisneededtoredu easmu haspossible thenumberofelementsin Q.
Aroughestimateofthe omplexitydisregardingthemultiplepre ision omponent is asfollows. Letm be thenumberof elementsin Q, pthe numberof elements in L. Sothe omplexitywouldberoughlyoftheorder of(m
2 p
3
)assumingthata singleSR-varisdeterminedinea hexe utionofloop0. Thefa torm
2
orresponds to the elimination of quadrati onstraints in loop2. This term orresponds to theworst- ases enario in whi h asingle quadrati equation is thelast one to be eliminatedea htimetheloop2isexe uted. Inthat asethe omplexity onsistsof exe utingtheloop: m+(m 1)+:::1=O(m
2
)times. Thefa torp 3
orresponds toGaussianelimination.
Inwhat followsweprovidethepra ti aldetailsofusingaCLPlanguage(Prolog III)toverifyagiventheorem. Theinitial triplet<Q;L;V >isinputin theform of alist ontainingsublists that spe ifythesymboli equationsfor thequadrati , linear and bound variables pertaining to a given theorem. The above des ribed algorithmisthenexe utedby\asserting"thevaluesofLandV sothatthebuilt-in Gaussian eliminationalgorithm of PrologIII an ompute theupdatedvaluesfor V (lines7to 14inloop1.)
The loop2 is exe uted by inspe ting the ontents of the sublist Q and adding wheneverfeasiblethenewsemi-symboli valuesfortheX's(lines24to26.)
Intheremainderofthisse tionwepresentanexampleoftheinputandoutputof thealgorithmin pro essingasimpletheorem. Thatexampleisfollowedbyashort subse tionprovidingtheargumentsforaproofof orre tnessofthealgorithm.
5.1. AnExample
Considerthefollowingtheorem: LetM andM 0
bepointsona ir leCof enterI andradiusR . ShowthatD, theperpendi ularbise torof [M;M
0
℄passes through I.
5.1.1. Dire t translation A dire t translation of the theorem statement yields thefollowingequations:
C:I =(0;0);R=1 M=(X m ;1=3)where (1)X 2 m +(1=3) 2 =1 M 0 =(X m 0;3=4)where(2)X 2 m 0 +(3=4) 2 =1 D:Y =M X+P where(3)M =(X X 0 )=(3=4 1=3)
C
M
M’
I
D
Figure1: Perpendi ularbise tor
and(4)P d =1=2(1=3+3=4 M d (X m +X m 0 ))
Onewishestoinsure that: (5)P d
=0
Thetriplet<Q;L;V >be omes: <f(1);(2)g;f(3);(4)g;f(5)g>
Notethat the oeÆ ients0;1;1=3;3=4.. werearbitrarily hosentofa ilitatethe reader'sunderstandingoftheformulas.
5.1.2. Reformulation Theproposedreformulation(see6.1)oftheabovetheorem resultsinthetriplet:
C:I =(1;0);R=1 M=(X m ;Y m )where(1)Y m =4=5X m and(2)25=4=Y m +5=4X m M 0 =(X m 0 ;Y m 0) where(3) Y m 0 =3=2X m 0 and(4)22=3=Y m 0 +2=3X m 0 D:Y =M d X+P d where(5)M d =(X m X m 0 )=(Y m 0 Y m ) and(6)P d =1=2(Y m +Y m 0 M d (X m +X m 0))
Onewishestoinsure that: (7)M d
= P d
<Q;L;V >: <fg;f(1);(2);(3);(4);(5);(6);(7)g;fg>
Thesu essivevaluesforthetripletsa ordingtotheproposedalgorithm are: <Q;L;V >!<fg;f(2);(3);(4);(5);(6);(7)g;fg> <Q;L;V >!<fg;f(3);(4);(5);(6);(7)g;fX m = 50 41 ;Y m = 40 41 g> <Q;L;V >!<fg;f(4);(5);(6);(7)g;fX m = 50 41 ;Y m = 40 41 g> <Q;L;V >!<fg;f(5);(6);(7)g;fX m = 50 ;Y m = 40 ;X m 0 = 8 ;Y m 0 = 12 g>
<Q;L;V >!<fg;f(6);(7)g;fX m = 50 41 ;Y m = 40 41 ;X m 0 = 8 13 ;Y m 0 = 12 13 ;M d = 23 2 g> < Q;L;V > ! < fg;f(7)g;fX m = 50 41 ;Y m = 40 41 ;X m 0 = 8 13 ;Y m 0 = 12 13 ;M d = 23 2 ;P d = 23 2 g>
and (7)be omestheidentity23=2=23=2thus he kingthat noin onsisten ies arefound.
5.2. AnInformal Proof of Corre tness
Thefollowingargumentssummarizetheproofprovidedin[Bouhineau-97℄:
1. The number of onstraints pro essed within the main loop always de reases.
2. Themeaningofthetransformedequationsisalwayspreserved.
3. The twobasi geometri al onstru tions(interse tion line-line, line- ir le)are orre tlysolved.
Asa onsequen e,ifthereexistsageometri al onstru tionappli abletoagiven theoremstatementthat anbedire tlyestablishedusingthetwobasi onstru tions fromthat statement,theproposed theorem he kerisguaranteedtondit.
6. Strategies forGenerating the Constraints
As mentionedabove,the strategyis to obtainthesmallestnumberof onstraints in Q. As seen in Se tion 4, the statement of a geometri problem may ontain the onstru tions 1a, 1b, 2a, 2b, 2 that introdu e quadrati onstraints. This se tionpresentsgeometri guretransformationsallowingto stati allyredu e the numberofquadrati onstraints. LetjSjindi atethenumberofelementsinasetS. ThetransformationsallowjQjtobefurtherredu eddynami allybythealgorithm in Se tion5. Itwill beseeninSe tion 7that thenumberofquadrati onstraints introdu ingsquarerootsissigni antlyredu edinthe aseofChou's512problems. The strategies orrespondingto the ases and sub ases of Se tion 4 an be de-s ribed by showing the transformation of an original triplet < Q;L;V > into <Q 0 ;L 0 ;V 0
>thelatterbeingtheoneused bythealgorithm ofSe tion5. There-fore,jQ
0
jjQj and there areno onstraintson thesizes ofthe otherelementsof thetriplets. Ingeneralthough,itislikelythatjL
0
jjLj,andjV 0
jjVj.
Four transformationsare presented in thesequel. Therst twoare alled lo al andthelasttwoglobal. Lo altransformationsareeasilyautomatedwhereasglobal are not. Lo al transformations are those whi h follow the original order of the statementofaproblemforgeneratingtheelementsinQ,LandV.In ontrast,global transformationsarethose whi hhavetoaltertheorderofgenerationtofullllthe
requireashuingoftheorderin whi hstatementsin Chou'stextare onsidered. Theywillbedes ribedbyspe i examples.
Awordaboutthepotentialforautomatingtheglobaltransformationsisinorder. In that ontext, oneshould re all Daniel Bobrow'sseminal thesis[Bobrow-68℄ in whi haprogramreadsthestatementsofsimplealgebraproblems{usinganatural languagepre-pro essor{andthentranslatesthemintoasystemofequations. The transformationsproposedherein ould,inprin iple,bedete tedbyapre-pro essor of naturallanguagewhi h would then generate the orresponding versions of the equations minimizing thenumber of quadrati omponents. This, however,is in itselfasizableproje tbeyondtheobje tivesofthepresentpaper.
There isof ourse arelationship betweenagiven geometri gure F generating thetriplet<Q;L;V >andits ounterpartF
0 generating <Q 0 ;L 0 ;V 0 >. Inthis presentationwehave hosentodepi ttheguresandthetriplets orrespondingto the ase2aofSe tion 4: arbitrarypointona ir le. For thesub ase2 : inverse point, only F and F
0
are presented; for the remaining ases onlyF is presented. Thereadershould havenodiÆ ultyin re onstru tingthe orrespondingtriplets.
6.1. ArbitraryPointon aCir le
TheguresrepresentingF andF 0
forthesub ase2anamely,{\Consideran arbi-trarypointMona ir leC"{arepresentedbelowwiththeir orrespondingtriplets. Intheguredepi tingF, apointhavinganarbitraryab issax is onsidered and the orrespondingvalueofy isexpressedintermsofsquarerootsofx. In ontrast, the onstru tioninthegurerepresentingF
0
onsidersanarbitrarylineDpassing throughthe point R . R
0
is the symmetri of R with respe t to the enter of the ir le. The proje tionof R
0
on D denes the point M on the ir le that an be representedbyrationalnumbers.
6.1.1. FigureF for the Sub ase2a : Arbitrary pointonaCir le Coordinatesoftheobje ts:
C:(X C ;Y C ), R:(X R ;Y R ), M:(X;Y) Triplet<Q;L;V >: Q: (X C X) 2 +(Y C Y) 2 =(X C X R ) 2 +(Y C Y R ) 2 L: empty V : X C =:::;Y C =:::;X R =:::;Y R =:::;X=:::
wheretheellipsesdenotearationalnumber,oringeneral,anSR-number
6.1.2. FigureF 0
Arbitrary pointonaCir le Coordinatesoftheobje ts:
M
C
x
Figure2: Arbitrarypointona ir leR:(X R ;Y R ), R 0 :(X R 0 ;Y R 0 ), M:(X;Y), D:(M D ;P D ), D 0 :(M D 0;P D 0) Triplet<Q 0 ;L 0 ;V 0 >: Q 0 : empty L 0 :X R +X R 0 =2X C Y R +Y R 0 =2Y C Y R =X R M D +P D M D M D 0 = 1(perpendi ular) Y R 0 =X R 0M D 0+P D 0 Y =XM D +P D Y =XM D 0 +P D 0 V 0 : X C = :::;Y C = :::;X R = :::;Y R = :::;P D
= ::: where the ellipses are SR-numbers.
Inthis asethepreviousquadrati onstraintissimplyeliminated.
Remarkthatintwo ases(2band1a)the onstru tions ontainthesameobje ts but those in F
0
are onsidered in an ordering that is guaranteed to de rease jQ 0
D’
C
M
R
R’
D
Figure 3: Arbitrarypointona ir leusing rationalnumbers
6.2. Inversepoints
This ase involvesthe onstru tion of the inverse of a point N with respe t to a ir leC. That pointis denoted byM and isobtainedasfollows(Figure 4.) IfN isinsidethe ir leC, onstru tthelineDpassingthroughN andthe enterofthe ir le. Theperpendi ular to D from N interse ts the ir le at thepointP. The tangentT tothe ir lefromP interse tsD atthedesiredinversepointM. It an beshownthatthis onstru tioninvolvespro essingsquareroots.
D
C
M
N
P
The alternate onstru tionrepresenting F 0
is asfollows (Figure 5): onsider a horizontalaxisH passingthroughthe enterofthe ir le. TheinversepointM is obtainedbyanalgebrai omputationdened by:
X M =X C +(X N X C ) R 2 CN 2 (1)
whereR istheradiusofthe ir leandCN isthelengthofthesegmentCN. This omputation involvesonlyrationals. Y
M
isdeterminedasthepointonthe lineCN havingX
M
asab issa. Proof:
Letusintrodu eahorizontallineH passingthroughthe enterofthe ir leand onsider the angle = (NCH), os() =
XN XC CN , CN = XN XC os() and CM = X M X C os() (seeFigure5.)
N andM areinversewithrespe tto Cwhen:
CNCM =R 2 thatis X N X C os() X M X C os() =R 2 sin e os()= X N X C CN , (X N X C )(X M X C )( CN X N X C ) 2 =R 2
thenN andM areinversewithrespe t toCwhen
X M X C =(X N X C ) R 2 CN 2 whi h isequivalentto(1) 6.3. Bise tri es
Thissub aseappears,forexample,inthefollowingtheorem[Chou-88℄:
Theorem 111: LetD bethe interse tion ofthe bise trix ofthe angleA in the triangle ABC with the side BC; let E be the interse tion of the ir le passing through A,B, and C and the line passing through AD. Show that AB.AC = AD.AE (i.e., theratioof the lenghtsAB and AD equalstheratioof thelengths AE andAC)
H
C
M
N
Figure5: Constru tionoftheinverseof apointwithrespe ttoa ir leusing rationalnumbers
followsthe onstru tionsenun iated in the theorem. A linearrational versionof thetheoremisasfollows:
LetA, B, and E bethreearbitrary points. Constru ttheline AC symmetri al to AB withrespe t to AE. Oneshould pointout thatC isat theinterse tion of the ir le passing throughthe points A, B, and E, and the line symmetri al to AB withrespe ttoAE. Distheinterse tionofthelinespassingthroughBCand AE. Allthese onstru tionsinvolvelinearequations. Remarkthatthe onstru tion assigns, asdesired, rational oordinates to C provided that those of the initially givenpointsA,B andE arerational.
B
E
C
D
A
6.4. Interse tion line- ir le
Thissub aseappears,forexample,inthefollowingtheorem(seeFigure7): Theorem 108: LetC bethemiddle ofthear ABofa ir lewith enterO. D isapointonthe ir le. (AB)meets(CD)at E. ShowthatCA
2
=CE . CD.
Sub ase 1a orrespondsto the onstru tion of C whi h is the interse tion of a ir lewith enterO andtheperpendi ularbise torofAB. Thequadrati solution proposed by Chou onsists of onsidering two arbitrarypoints A and B, and de-terminingthe midpointM of AB. Theperpendi ulartoAB throughM ontains asele tedpointO whi histhe enterofthe ir le. ThepointCistheinterse tion ofthe ir lewiththeperpendi ular.
Thelinearsolutionis:
LetAandB bearbitrarypointsanddetermineasbeforethemiddlepointM of AB. Sele t apointC in theperpendi ularto AB passingthroughM. Thepoint O anthenbedeterminedbytheinterse tionoftheperpendi ularbise torsofthe segmentsAC andCB.
O
E
A
M
C
B
D
Figure7: Constru tingthemiddleofanar (Theorem108)
7. Results
Theresultsofapplyingtheprepro essing{basedonthe lassi ationgivenin Se -tion4{andthedes ribedalgorithmareshowninTableA.The ontentsofthetable indi ate thenature andthenumberof problems onsideredbyChou. Thevarious olumns(atotalof12)inthattable orrespondtothea tualnumberofembeddings inthemultiplesquarerootrepresentationofrationalnumbers.Themaximumvalue 12is diÆ ultto pro ess in reasonabletime due tothe spa eand time omplexity
n 0 1 2 3 4 5 6 7 8 9 10 11 12 Q(n) 202 28 80 80 55 35 11 2 8 5 5 0 1 Max(n) 354 96 42 15 2 2 1 Lo (n) 441 57 11 3 Glob+Lo (n) 487 25 Table A Notation:
Q(n) the number of ases (among the 512 problems) that re-quirethesolutionofnquadrati onstraintswithoutusingthe transformationsin Se tion6.
Max(n) thenumberof asesthatrequiretheintrodu tionofn nestedsquarerootswithoutusing thetransformationsin Se -tion6.
Lo (n) the numberof asesthat require theintrodu tionof n nested square roots using lo al transformation for ases 2a: arbitrarypointon a ir le and 2 : inverse point des ribed in Se tion6.
Glob(n) thenumberof asesthatrequiretheintrodu tionofn nestedsquare roots and that benet from global transforma-tionsdes ribedin Se tion6.
The redu tion in omplexity due to the prepro essing using the subsets of the asesin Se tion 4are shownin therowsof table A.Thenal rowshowsthat the ombined usage of all ases in Se tion 6 results in redu ing the vast majority of theproblems proposedby Chouto solvinglinearequations where the omplexity is ubi . The remaining problems are handled using the un-nested square root representationwhi halsoresultsinapolynomial omplexity. In10oftheabove25 problems, p rturnsouttobe p 3. 8. Final Remarks
One should rst noti e that the proposed method has two advantages over the method used by Chou. The rst is eÆ ien y, and the se ond isthe apability of the present approa h to dete t omplex solutions when square roots of negative rationals are en ountered. Chou's solution he ks for the existen e of solutions disregarding the fa t that some of them are only truein the domain of omplex numbers. OntheotherhanditshouldberemarkedthatChousolvesaharder lass ofproblemsby onsideringthatobje tsarepla edinarbitrarypositions.
arefully applied lassi ationrules, des ribed in Se tion 4, that an be used to redu ethe omplexityofanexponentialproblem.
Finally, it should be mentioned that Chou's theorems were originally proposed byhumanswho anmakeuseof lever onstru tionsto\manually"provediÆ ult theorems. This may explain why non-exponential solutions are possible. This situation parallels the one that happens when using the simplex method. Even thoughtheworst- ase omplexityofthatmethodisexponential,mostrealpra ti al problemsaresolvedinalmost lineartime.
Appendi es
Appendix A presentsa short a ount of an intera tion with the Maple symboli pa kagein tryingtoestablishthevalidityofanequalityinvolvingexpressions on-taining radi als. The results learly indi ate that Maple even provides in orre t results(false)whenaskedto he kfortheequalityoftwosymboli formulas. Nev-ertheless,whenaskedtoevaluatethetwoformulasinthe asewhereallthevariables areboundtonumbers,Mapleindi atesthatthe orrespondingvaluesarevery lose toea hother. Thesetests learlyindi atetheneedforrepresentationsliketheone proposed inthiswork.
Appendix BillustratesanexampleofChou'sapproa hforthetheoremthathas beenveriedusing theproposed approa h (Se tion 6.4.) We reiteratethat these twoapproa hesare essentially dierent in the sense that theformer attempts to symboli allyprovethevalidity ofatheorem, whereasthe latterveriesifagiven representationof thetheorem, using onstraints,issatisable ornot. Theformer is omplex and time onsuming, whereas the latter an qui kly indi ate, for a vast majority of ases, if the onstraints are unsatisable, thus revealing a false hypothesis or onstru tionbyhumans {typi allystudents{ inattemptingto prove atheorem.
AppendixA
The following examplesillustrate the in onsisten ies of using Maple to he kthe equalityoftwosymboli formulas ontainingradi als(from[Zippel-85℄),namely:
p 22+2 p 5+ p 5and p 11+2 p 29+ q 16 2 p 29+2 p 55 10 p 29
The purpose of the built-in fun tion evalb is to for e evaluation of expressions involvingrelationaloperators, using athree-valuedlogi system. The returnsare true, false, and FAIL. If evaluation is not possible, an unevaluated expression is returned.
Thequery:
evalb(0=sqrt(22+2*sqrt(5))+sqrt(5) -sqrt(11+2*sqrt(29))
yieldsthe erroneousvalue false. The orre tresultwould be trueormaybeeven FAIL,thelatteradmittingthein apa ityofMapletomakeade ision.
Nevertheless, an attempt to evaluate the dieren e between the two formulas utilizingpurelynumeri alvalues(Maple'sevalf)yields averysmallnumber:
evalf(sqrt(22+2*sqrt(5))+sqrt(5) -sqrt(11+2*sqrt(29))
-sqrt(16-2*sqrt(29)+2*sqrt(55-10*sqrt(29))),20);
-18 Result .1*10
Evenifahighera ura yisrequested,Maplestillndsthatthetwoexpressions dierbyaminus ulequantity.
evalf(sqrt(22+2*sqrt(5))+sqrt(5) -sqrt(11+2*sqrt(29))
-sqrt(16-2*sqrt(29)+2*sqrt(55-10*sqrt(29))),146);
-144 Result -.1*10
(ItshouldberemarkedthatourversionofMaplebehavederrati allywhenasked tofurtherin reasethea ura yofthequantityrepresentingthedieren ebetween the two given expressions, whose variables were bound to numeri values. We noti ed that, in ertain ases, an in reased spe ied a ura y would sometimes -butnotalways-yieldthevaluezero.)
AppendixB
Oneofthetheorems onsideredbyChouis trans ribedbelowwiththegeneration ofthepolynomialequationsneededtoassertitsvalidity.
Theorem108: LetCbethemidpointofthear ABof ir le enterO(seeFigure 7.) D isapointonthe ir le. E=AB interCD. ShowthatCA
2
=CE:CD
PointsA;Barearbitrarily hosen. PointsO;M;C ;D;Eare onstru ted(inorder) asfollows: OA=OB;MisthemidpointofAandB;CO=OA;CisonlineOM; DO=OA;EisonlineAB;E isonlineCD. The on lusionisCA:CA=CE:CD
LetA=(0;0),B=(u 1 ;0),O=(x 1 ;u 2 ),M=(x 2 ;0),C=(x 4 ;x 3 ),D=(x 5 ;u 3 ), E=(x 6 ;0)
Therefore, Chou introdu es the minimal number of symboli parameters needed to des ribeageneralinitial ongurationneeded togeneratetheequations whose satisability onstitutestheproof.
Thisisalsothe aseoftheproposedapproa h,ex eptthat thoseparametersare given numeri alvalues. This is onsistentwith ourobje tivesofqui kly verifying thevalidityof onstru tionsproposedbystudentsattemptingtoprovetheoremsin geometry.
The ir lehasto satisfy:
x 2 1 +u 2 2 =(x 1 u 1 ) 2 +u 2 2 ; (1)
ThepointM hastosatisfy:
x 2 = u 1 2 ; (2)
ThepointChastosatisfy:
(x 1 x 4 ) 2 +(x 3 u 2 ) 2 =x 2 1 +u 2 2 ; (3) x 2 x 3 +x 4 u 2 =x 1 x 3 +x 2 u 2 ; (4)
ThepointDhastosatisfy:
(x 1 x 5 ) 2 +(u 2 u 3 ) 2 =x 2 1 +u 2 2 ; (5)
ThepointE hasto satisfy:
x 4 u 3 +x 4 x 6 =x 5 x 3 +x 6 u 3 ; (6)
Thetheoremisgivenbytheequation:
(x 2 3 +x 2 4 ) 2 =((x 3 u 3 ) 2 +(x 4 x 5 ) 2 )((x 4 x 6 ) 2 +x 2 3 ); (7)
And theproof orrespondsto theelimination of variables x 6
;:::;x 1
in equation (7)using theequations(6);:::;(1). If theresultingexpression of(7)isof theform 0=0thenthetheoremisvalid.
Referen es
[Allen,Idt, Trilling-93℄Ri hard Allen,Jeanne Idt and Laurent Trilling, Constrained based au-tomati onstru tion and manipulation of geometri gures, Pro eedings of the 13th IJCAI Conferen e,Chambery,MorganKaufmannPublishers,LosAltos,August1993.
Program-[Bobrow-68℄DanielG.BobrowNaturalLanguageInputforaComputerProblemSolvingSystem, Semanti InformationPro essing,MarvinMinsky,ed.,MITPress,Cambridge,MA,1968. [Bobrow-68℄DanielG.BobrowAQuestion-Answerer forAlgebra Word Problems,Semanti
In-formationPro essing,MarvinMinsky,ed.,MITPress,Cambridge,MA,1968.
[Bouhineau-97℄DenisBouhineau,Constru tionautomatiquede guresgeometriques& Program-mation Logiqueave Contraintes, These del'UniversiteJ.FourierdeGrenoble, Fran e, Juin 1997.
[Chou-88℄S hang-ChingChou,LargeMe hani alGeometryTheoremProving,ReidelPublishing, Norwell,1988.
[Colmerauer-93℄Alain Colmerauer, NaveSolving of Non-linear Constraints, ConstraintLogi Programming: Sele tedResear h, TheMIT Press, Frederi Benhamouet Alain Colmerauer editors,pp89-112,1993.
[Deng,Zhang,Yang-90℄MikeDeng,JingzhongZhangandLuYang,Theparallelnumeri almethod ofme hani altheoremprovingTheoreti alComputerS ien eNo.74pp.253{271,1990. [Dube, Yap-94℄ Thomas Dubeand Chee Yap, Computing in Eu lidean Geometry, The exa t
omputationparadigm,WorldS ienti Press,editorsD.Z.Du,F.K.Hwang,7[Jaar,Mi haylov, Stu key,Yap-92℄J.Jaar,S.Mi haylov,P-J.Stu key,andR.Yap,TheCLP(R)Languageand System,ACMTrans. on ProgrammingLanguages andSystems,Vol. 14,No. 3,pp339{395, 1992.
[Kutzler-88℄Kutzler, Bernhard,Algebrai approa hes to automated geometry theorem proving, Ph. Dthesis,RISC-LINZ,JohannesKeplerUniv.,Austria,1988.
[Landau-92℄Susan Landau, Simpli ation of nested radi als, SIAMJournalof Computing Vol 21,No1pp85-110,Feb1992.
[Hong-86℄JiaweiHong,ProvingbyExampleandGapTheorems,107{116,27thAnnualSymposium onFoundationsofComputerS ien e,Toronto,Ontario,Canada,IEEE,O t.1986.
[Pesant,Boyer-94℄GillesPesantandMi helBoyer,Quad-Clp(R):AddingthePowerofQuadrati Constraints, Pro eedings of the Se ond Workshop on Prin iples and Pra ti e of Constraint Programming(PPCP'94),1994.
[Pesant-95℄GillesPesant,Uneappro he geometrique aux ontraintesarithmetiquesquadratiques enprogrammationlogiqueave ontraintes,Thesedel'UniversitedeMontreal,1995.
[Wu-94℄Wen-TsunWu,Me hani alTheoremProvinginGeometries,Springer-VerlagWien New-York,1994.
[Zippel-85℄Ri hardZippel,Simpli ationofExpressionsInvolvingRadi als,J.Symboli Compu-tation1,1985.