Contents lists available atScienceDirect
Journal
of
Symbolic
Computation
www.elsevier.com/locate/jsc
Truth
table
invariant
cylindrical
algebraic
decomposition
✩
Russell Bradford
a,
James
H. Davenport
a,
Matthew England
b,
Scott McCallum
c,
David Wilson
aaDepartmentofComputerScience,UniversityofBath,Bath,BA27AY,UK
bSchoolofComputing,ElectronicsandMaths,FacultyofEngineering,EnvironmentandComputing,
Coventry University,Coventry,CV15FB,UK
cDepartmentofComputing,MacquarieUniversity,NSW2109,Australia
a
r
t
i
c
l
e
i
n
f
o
a
b
s
t
r
a
c
t
Articlehistory:
Received 21 December 2014 Accepted 21 October 2015 Available online 4 November 2015 MSC:
68W30 03C10 Keywords:
Cylindrical algebraic decomposition Equational constraint
Whenusingcylindricalalgebraicdecomposition(CAD) tosolve a problemwithrespecttoasetofpolynomials,it islikelynot the signsofthosepolynomialsthatareofparamountimportancebut ratherthetruthvaluesofcertainquantifierfreeformulaeinvolving them.This observation motivates ourarticle and definition ofa TruthTableInvariantCAD(TTICAD).
InISSAC2013thecurrentauthorspresentedanalgorithmthatcan efficiently and directlyconstructa TTICADfora listof formulae inwhicheachhasanequationalconstraint.Thiswasachievedby generalisingMcCallum’stheoryofreducedprojectionoperators.In thispaper wepresent an extended version ofour theorywhich canbeapplied toanarbitrarylistofformulae, achievingsavings ifatleastonehasanequationalconstraint.Wealsoexplainhow thetheory ofreduced projectionoperators canallow for further improvementstotheliftingphaseofCADalgorithms,eveninthe contextofasingleequationalconstraint.
Thealgorithmisimplementedfullyin Maple andwepresentboth promisingresultsfromexperimentationandacomplexityanalysis showingthebenefitsofourcontributions.
©2015TheAuthors.PublishedbyElsevierLtd.Thisisanopen accessarticleundertheCCBYlicense (http://creativecommons.org/licenses/by/4.0/).
✩ This work was supported by EPSRC grant EP/J003247/1.
E-mailaddresses:[email protected](R. Bradford), [email protected](J.H. Davenport),
[email protected](M. England), [email protected](S. McCallum), [email protected] (D. Wilson).
http://dx.doi.org/10.1016/j.jsc.2015.11.002
0747-7171/©2015 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).
1. Introduction
Acylindricalalgebraicdecomposition (CAD)isadecompositionof
R
nintocellsarrangedcylindrically(meaningtheprojectionsofanypairofcellsareeitherequalordisjoint)eachofwhichis (semi-)alge-braic(describableusingpolynomialrelations).CADisakeytoolinrealalgebraicgeometry,offeringa methodforquantifiereliminationinrealclosedfields.Applicationsincludethederivationofoptimal numericalschemes(Erascu and Hong, 2014),parametricoptimisation(Fotiou et al., 2005),robot mo-tionplanning(Schwartz and Sharir, 1983),epidemicmodelling(Brown et al., 2006),theoremproving (Paulson, 2012) andprogrammingwithcomplexfunctions(Davenport et al., 2012).
TraditionallyCADsareproducedsign-invariant toagivensetofpolynomials(thesignsofthe poly-nomials do not vary within each cell). However, this gives farmore information than required for mostapplications.Usually amoreappropriate objectis atruth-invariant CAD(the truth ofalogical formuladoesnotvarywithincells).
In this paper we generalise to define truthtableinvariant CADs (the truth values of a list of quantifier-free formulaedo not varywithin cells) andgive an algorithm to compute thesedirectly. This canbe a toolto efficientlyproducea truth-invariantCADforaparent formula(builtfromthe input list),orindeedtherequiredobjectforsolving aprobleminvolvingtheinputlist.Examplesof both such usesare provided following the formal definition inSection 1.2. We continue the intro-duction with some background on CAD, before defining our object of studyandintroducing some examplestodemonstrateourideaswhichwewillreturntothroughoutthepaper.Wethenconclude theintroductionbyclarifyingthecontributionsandplanofthispaper.
1.1. BackgroundonCAD
ATarskiformula F
(
x1,
. . . ,
xn)isaBooleancombination(∧,
∨,
¬,
→
)ofstatementsaboutthesigns,(
=
0,
>
0,
<
0,buttherefore=
0,
≥
0,
≤
0 aswell),ofcertain polynomials fi(x1,
. . . ,
xn)withintegercoefficients.Suchstatementsmayinvolvetheuniversalorexistentialquantifiers(
∀,
∃
).Wedenoteby QFFaquantifier-freeTarskiformula.GivenaquantifiedTarskiformula
Qk+1xk+1
. . .
QnxnF(
x1, . . . ,
xn)
(1)(where Qi
∈ {∀,
∃}
and F isa QFF)thequantifiereliminationproblem istoproduceψ(
x1,
. . . ,
xk)
,anequivalentQFFto(1).
Collins developedCADasatoolforquantifiereliminationover thereals.He proposedto decom-pose
R
n cylindricallysuch thateach cellwas sign-invariantforallpolynomials fi usedtodefine F .
Then
ψ
wouldbethedisjunctionofthedefining formulaeofthosecells ci inR
k suchthat (1)wastrueoverthewholeofci,whichduetosign-invarianceisthesameassaying that(1)istrueatany
onesamplepoint ofci.
A complete description of Collins’ original algorithm is given by Arnon et al. (1984a). The first phase,projection,appliesaprojectionoperatorrepeatedlytoasetofpolynomials,eachtimeproducing another setinone fewervariables. Togetherthesesets containthe projectionpolynomials. Theseare used in the second phase, lifting, to build theCAD incrementally.First
R
is decomposedinto cells which are points and intervalscorresponding to the real rootsof theunivariate polynomials. ThenR
2 isdecomposedbyrepeatingtheprocess overeachcellinR
usingthebivariatepolynomialsatasamplepoint.Overeachcelltherearesections (whereapolynomialvanishes)andsectors (theregions between)whichtogether formastack.TakingtheunionofthesestacksgivestheCADof
R
2.Thisis repeateduntilaCADofR
n isproduced.Ateachstagethecellsarerepresentedby(atleast)asample pointandanindex:alistofintegerscorrespondingtotheorderedrootsoftheprojectionpolynomials whichlocatesthecellintheCAD.ToconcludethataCADproducedinthiswayissign-invariantweneeddelineability.Apolynomial is delineable in a cellif theportion ofits zero setin thecell consistsof disjointsections.A setof polynomialsaredelineable inacellifeachisdelineableandthesectionsofdifferentpolynomialsin the cell are either identicalordisjoint. The projection operator usedmust be definedso that over
eachcellofasign-invariantCADforprojectionpolynomialsinr variables(thewordover meaningwe arenowtalkingaboutan
(
r+
1)
-dimspace)thepolynomialsinr+
1 variablesaredelineable.The output of thisand subsequent CADalgorithms (including the one presented in thispaper) dependsheavily onthevariableordering.Weusually workwithpolynomialsin
Z[
x]
= Z[
x1,
. . . ,
xn]
withthevariables,x,inascendingorder(sowefirstprojectwithrespecttoxn andcontinuetoreach
univariatepolynomialsinx1).Themainvariable ofapolynomial(mvar)isthegreatestvariablepresent
withrespecttotheordering.
CADhasdoublyexponentialcomplexityinthenumberofvariables(Brown and Davenport, 2007; Davenport and Heintz, 1988). Therenow existalgorithms withbettercomplexity forsomeCAD ap-plications(seeforexampleBasu et al., 1996)butCADimplementationsoftenremainthebestgeneral purposeapproach. There have beenmany developmentsto the theory since Collin’s treatment, in-cludingthefollowing:
•
Improvementstotheprojectionoperator(Hong, 1990;McCallum, 1988, 1998;Brown, 2001; Han et al., 2014),reducingthenumberofprojectionpolynomialscomputed.•
Algorithmstoidentifytheadjacencyofcells ina CAD(Arnon et al., 1984b, 1988)andfollowing fromthistheideaofclustering(Arnon, 1988) tominimisethelifting.•
PartialCAD,introduced byCollins and Hong (1991),wherethestructure ofF isusedtoliftless ofthedecompositionofR
k toR
n,ifitissufficienttodeduceψ
.•
The theory ofequational constraints (McCallum, 1999, 2001; Brown and McCallum, 2005) also aimingtodeduceψ
itself,thistimeusingmoreefficientprojections.•
Theuseofcertifiednumerics intheliftingphasetominimisetheamountofsymbolic computa-tionrequired(Strzebo ´nski, 2006; Iwane et al., 2009).•
New approaches which break with the normal projection and lifting model: local projection (Strzebo ´nski, 2014),thebuildingofsingleCADcells(Brown, 2013; Jovanovic and de Moura, 2012) andCADviatriangular decomposition (Chen et al., 2009b). Thelatteris nowused fortheCAD commandbuilt into Maple,andworksby firstcreatinga cylindricaldecompositionof complex space.1.2. TTICAD
Brown (1998)definedatruth-invariantCAD asoneforwhichaformulahadinvarianttruthvalueon each cell.Givena QFF,asign-invariant CADforthedefining polynomialsistrivially truth-invariant. Brown consideredthe refinement ofsign-invariant CADswhilst maintaining truth-invariance,while some ofthedevelopmentslisted above canbe viewedasmethods toproduce truth-invariantCADs directly.WedefineanewbutrelatedtypeofCAD,thetopicofthispaper.
Definition1.Let
{φ
i}
ti=1 refer toa listofQFFs.Wesaya cylindricalalgebraic decompositionD
isa TruthTableInvariant CADfortheQFFs(TTICAD)iftheBooleanvalueofeachφi
isconstant(eithertrue orfalse)oneachcellofD
.Asign-invariantCADforallpolynomialsoccurringinalistofformulaewouldclearlybeaTTICAD forthelist.However,weaimtoproducesmallerTTICADsformanysuchlists.Wewillachievethisby utilisingthepresenceofequationalconstraints,atechniquefirstsuggestedbyCollins (1998)withkey theorydevelopedbyMcCallum (1999).
Definition2.Supposesomequantifiedformulaisgiven:
φ
∗= (
Qk+1xk+1)
· · · (
Qnxn)φ (
x)
wherethe Qi are quantifiersand
φ
isquantifierfree. Anequation f=
0 is an equationalconstraint(EC)of
φ
∗if f=
0 islogicallyimpliedbyφ
(thequantifier-freepartofφ
∗).Suchaconstraintmaybe eitherexplicit(anatomoftheformula)orotherwiseimplicit.InSections3and4wewilldescribehowTTICADscanbeproducedefficientlywhenthereareECs presentinthelistofformulae.Therearetworeasonstousethistheory.
(1) Asatooltobuildatruth-invariantCADefficiently: Ifaparentformula
φ
∗ isbuiltfromtheformulae{φ
i}
thenanyTTICADfor{φ
i}
isalsotruth-invariantforφ
∗.WenotethatforsuchaformulaaTTICADmayneedtocontainmorecellsthanatruth-invariant CAD. Forexample,consideracell inatruth-invariantCADfor
φ
∗= φ
1∨ φ
2 within whichφ
1 isalways true.If
φ
2 changedtruth value insucha cellthenit wouldneedtobe splitinordertoachieveaTTICAD,butthisisunnecessaryforatruth-invariantCADof
φ
∗.Nevertheless, we find that our TTICAD theory is often able to produce smaller truth-invariant CADsthan anyother availableapproach.We demonstratethesavings offeredvia worked exam-plesintroducedinthenextsubsection.
(2) Whengivenaproblemforwhichtruthtableinvarianceisrequired: That is,aproblemforwhichthe listofformulaearenotderivedfromalargerparentformulaandthusatruth-invariantCADfor theirdisjunctionmaynotsuffice.
For example,decomposing complexspace accordingto aset ofbranch cutsforthe purposeof algebraicsimplification(Bradford and Davenport, 2002; Phisanbut et al., 2010).Heretheideaisto representeachbranchcutasasemi-algebraicsettogiveinputadmissibletoCAD(recentprogress onthishasbeendescribedbyEngland et al., 2013).ThenaTTICADforthelistofformulaethese setsdefineprovidesthenecessarydecomposition.Example 33isfromthisclass.
1.3. Workedexamples
To demonstrate our ideas we will provide details for two worked examples. Assume we have the variable ordering x
≺
y (meaning 1-dimensionalCADs are with respectto x) andconsider the followingpolynomials,graphedinFig. 1.f1
:=
x2+
y2−
1 g1:=
xy−
14f2
:= (
x−
4)2+ (
y−
1)2−
1 g2:= (
x−
4)(y−
1)−
14Supposewewishtofindtheregionsof
R
2 wherethefollowingformulaistrue::= (
f1=
0∧
g1<
0)∨ (
f2=
0∧
g2<
0) . (2)Both Qepcad (Brown, 2003) and Maple 16(Chen et al., 2009b) produceasign-invariantCADforthe polynomialswith317cells.Thenbytestingthesamplepointfromeachregionwecansystematically identifywheretheformulaistrue.
AtfirstglanceitseemsthatthetheoryofECsisnotapplicableto
asneither f1
=
0 nor f2=
0is logically implied by
. However, while there is no explicit EC we can observe that f1f2
=
0 isan implicit constraintof
.Using Qepcad withthisdeclared(animplementationofMcCallum, 1999) givesaCADwith249cells.Later,inSection3.3wedemonstratehowaTTICADwith105cellscanbe produced.
Wealsoconsidertherelatedproblemofidentifyingwhere
:= (
f1=
0∧
g1<
0)∨ (
f2>
0∧
g2<
0) (3)istrue.Asabove,wecoulduseasign-invariantCADwith317cells,butthistimethereisnoimplicit EC.InSection3.3weproduceaTTICADwith183cells.
1.4. Contributionsandplanofthepaper
We reviewtheprojection operatorsofMcCallum (1998, 1999)inSection2.Theformerproduces sign-invariantCADs1andthelatterCADstruth-invariantforaformulawithanEC.Thereviewis
nec-essarysinceweusesomeofthistheorytoverifyournewalgorithm.Italsoallowsustocompareour
Fig. 1. The
polynomials from the worked examples of Section
1.3. The solid curves are f1and g1while the dashed curves aref2and g2.
newcontributiontotheseexistingapproaches.Forthispurposeweprovidenewcomplexityanalyses oftheseexistingtheoriesinSection2.3.
Sections3and4presentournewTTICADprojectionoperatorandverifiedalgorithm.Theyfollow Sections2and3ofourISSAC2013paper(Bradford et al., 2013a),butinsteadofrequiringallQFFsto haveanECthetheoryhereisapplicabletoallQFFs(producingsavingssolongasonehasanEC).The strengtheningofthetheory meansthataTTICADcannowbeproducedfor
inSection1.3aswell as
.This extension isimportantsince it means TTICADtheory nowapplied to caseswhere there can beno overall implicitECfora parent formula. Inthesecases theexisting theory ofECs isnot applicableandsothecomparativebenefitsofferedbyTTICADareevenhigher.
InSection5we discusshowthetheory ofreducedprojection operatorsalsoallowsfor improve-mentsintheliftingphase.Thisistruefortheexistingtheoryalsobutthediscovery wasonlymade duringthedevelopmentofTTICAD.InSection6wepresentacomplexity analysisofournew contri-butions fromSections3–5,demonstratingtheir benefitoverthe existingtheory fromSection2.We haveimplementedthenewideasina Maple package,discussedinSection7.Inparticular,Section7.3
summarises (Bradford et al., 2013b) on the choicesrequired when using TTICADand heuristicsto help. Experimental results forour implementation (extending those in our ISSAC 2013 paper) are giveninSection8,beforewefinishinSection9withconclusionsandfuturework.
Dataaccessstatement: Data directlysupporting this paper(code, Maple and Qepcad input)are openlyavailablefromhttp :/ /dx .doi .org /10 .15125 /BATH-00076.
2. ExistingCADprojectionoperators 2.1. Review:sign-invariantCAD
Throughoutthe paperwe let cont, prim,disc,coeff and ldcf denote thecontent, primitivepart, discriminant,coefficientsandleadingcoefficientofpolynomialsrespectively(ineachcasetakenwith respecttoagivenmainvariable).Similarly,weletres denote theresultant ofa pairofpolynomials. When applied to a set of polynomials we interpret theseas producing sets of polynomials, so for example
res(A
)
=
res(fi,
fj)
|
fi∈
A,
fj∈
A,
fj=
fi.
ThefirstimprovementstoCollinsoriginalprojectionoperatorweregivenbyMcCallum (1988)and
Hong (1990).TheywerebothsubsetsofCollinsoperator,meaningfewerprojectionpolynomials,fewer cells inthe CADsproduced andquickercomputation time. McCallum’sisactually a strict subset of Hong’s,however,itcannotbeguaranteedcorrect(incorrectnessisdetectedintheliftingprocess)for acertainclassof(statisticallyrare)inputpolynomials,whereHong’scan.
Additional improvements havebeen suggested by Brown (2001)and Lazard (1994).The former required changes to the lifting phase while the latterhad a flawedproof ofvalidity (withcurrent unpublishedworksuggestingitcanstillbesafelyusedinmanycases).Inthispaperwewillfocuson McCallum’soperators,notingthatthealternativescouldlikelybeextendedtoTTICADtheoriestooif desired.McCallum’stheoryisbasedaroundthefollowingcondition,whichimpliessign-invariance. Definition3. A CADis order-invariant with respect to a set of polynomialsif each polynomial has constantorderofvanishingwithineachcell.
Recall that a set A
⊂ Z[
x]
is an irreduciblebasis if the elements of A are of positive degree in themainvariable,irreducibleandpairwise relativelyprime.Let A bea setofpolynomialsandB an irreduciblebasisoftheprimitivepartof A.ThenP
(
A)
:=
cont(A)
∪
coeff(B)
∪
disc(B)
∪
res(B)
(4)defines the operator of McCallum (1988). We can assume some trivial simplifications such as the removalof constantsandexclusionof entriesidenticalto aprevious one (uptoconstant multiple). Themaintheoremunderlyingtheuseof P follows.
Theorem4.(See
McCallum,
1998.)LetA beanirreduciblebasisinZ[
x]
andletS beaconnectedsubmanifold ofR
n−1.SupposeeachelementofP(
A)
isorder-invariantinS.TheneachelementofA eithervanishesidenticallyonS orisanalyticdelineableonS,(aslightvarianton traditionaldelineability,see
McCallum,
1998).Further,thesectionsofA notidenticallyvanishingarepairwise disjoint,andeachelementofA notidenticallyvanishingisorder-invariantinsuchsections.Theorem 4 means that we can use P in place of Collins’ projection operator to produce sign-invariantCADssolongasnoneoftheprojectionpolynomialswithmainvariablexkvanishesonacell
oftheCADof
R
k−1;aconditionthatcanbecheckedwhenlifting.Inputwiththispropertyisknownas well-oriented. Notethat although McCallum’s operator produces order-invariant CADs,a stronger property thansign-invariance,itisactuallymoreefficientthatthepre-existingsign-invariant opera-tors.WeexaminethecomplexityofCADusingthisoperatorinSection2.3.
2.2. Review:CADinvariantwithrespecttoanequationalconstraint
ThemainresultunderlyingCADsimplificationinthepresenceofanECfollows.
Theorem5.(See
McCallum,
1999.) Let f(
x),
g(
x)
beintegral polynomialswithpositivedegreein xn,letr
(
x1,
. . . ,
xn−1)
betheirresultant,andsupposer=
0.LetS beaconnectedsubsetofR
n−1suchthat f is delineableonS andr isorder-invariantinS.Theng is sign-invariantineverysectionoff overS.
Fig. 2givesagraphicalrepresentationofthequestionansweredbyTheorem 5.Hereweconsider polynomials f
(
x,
y,
z)
and g(
x,
y,
z)
of positive degree in z whose resultant r is non-zero, and a connected subset S⊂ R
2 inwhichr is order-invariant.We furthersuppose that f isdelineableon S (noting that Theorem 4with n=
3 and A= {
f}
provides sufficient conditions forthis). We ask whetherg issign-invariantinthesectionsof f overS.Theorem 5answersthisquestionaffirmatively: therealvarietyofg eitheralignswithagivensectionof f exactly(asforthebottomsectionof f inFig. 2),orhasnointersectionwithsuchasection(asforthetop).Thesituationatthemiddlesection of f cannothappen.
Theorem 5 thus suggestsa reduction oftheprojection operator P relativeto an EC f
=
0: take only P(
f)
together withtheresultantsof f withthenon-ECs.Let A beasetofpolynomials, E⊂
A containonlythepolynomialdefiningtheEC,F beasquarefreebasisof A,andB bethesubsetof F whichisasquare-freebasisforE.TheoperatorFig. 2. Graphical representation ofTheorem 5.
waspresentedbyMcCallum (1999)alongwithanalgorithmtoproduceaCADtruth-invariantforthe ECandsign-invariantfortheotherpolynomialswhentheECwassatisfied.Itworkedbyapplyingfirst PE
(
A)
andthenbuildingan order-invariantCADofR
n−1 using P .Wecallsuch CADsinvariantwithrespecttoanequationalconstraint.Note that aswithMcCallum (1999) thealgorithm only worksfor inputsatisfyinga well-orientednesscondition.Full detailsoftheverificationaregivenby McCallum (1999)andacomplexityanalysisisgiveninthenextsubsection.
2.3. Newcomplexityanalyses
We provide complexity analyses of the algorithms fromMcCallum (1998, 1999) forcomparison withournewcontributionslater.Ananalysisforthelatterhasnotbeenpublishedbefore,whilethe analysisfor the former differs substantially from the one in McCallum (1985): instead offocusing on computation time, we examine the numberof cells in theCAD of
R
n produced: the cellcount. Wecomparethedominanttermsinacellcountboundforeachalgorithmstudied.Thisfocusavoids calculationswithlessrelevantparameters, identicalforallthealgorithms. Wenotethat allCAD ex-perimentationshowsastrongcorrelationbetweenthenumberofcellsproducedandthecomputation time.Ourkeyparametersarethenumberofvariablesn,thenumberofpolynomialsm andtheir maxi-mumdegreed (inanyonevariable).Notethattheseareallrestrictedtopositiveintegervalues.We makemuchuseofthefollowingconcepts.
Definition6. Consider a set of polynomials pj. The combineddegree ofthe set is the maximum
degree (taken with respect to each variable) of the product of all the polynomials in the set: maxi
degxi
jpj .Soforexample,theset
{
x2+
1,
x2+
y3}
hascombineddegree 4 (sincetheproduct hasdegree 4inx anddegree3 in y).
Definition7.(SeeMcCallum, 1985.)Asetofpolynomialshasthe
(m,
d)-property ifit canbe parti-tionedintom sets,suchthateachsethasmaximumcombineddegreed.Soforexample,thesetofpolynomials
{
xy3−
x,
x4−
xy,
x4−
y4+
1}
hascombineddegree9 andthusthe
(
1,
9)
-property.However,bypartitioningitintothreesetsofonepolynomialeach,italsohas the(
3,
4)
-property.Partitioninginto2setswillshowittohavethe(
2,
5)
,(
2,
7)
and(
2,
8)
-properties also.Thefollowingresultfollowsfromthedefinitions.Thiscontrastswiththefactsthattakingasquare-freebasismaynotreducethecombineddegree, butmaycauseexponentialblow-upinthenumberofpolynomials.
Proposition9.Supposeasethasthe
(
m,
d)
-property.Then,bytakingtheunionofgroupsofsetsfromthe partition,italsohasthem
,
d-property.Notethatinthecase
=
2 wehavem2=
m+1 2
.Example10. Let S
= {
x2y4−
x3,
x2y4+
x3}
be a set of polynomials. Then S has the(
2,
4)
and(
1,
8)
-properties. A squarefree basis of S isgiven by S= {
x2,
y4−
x,
y4+
x}
which hasthe(
3,
4)
and
(
1,
8)
-properties.Proposition 9statesthat Smustalsohavethe
(
2,
8)
-property,whichcanbecheckedby partition-ing Ssothatx2 isinasetofitsown.However,fromProposition 8wealsoknowthat Smusthave the(
2,
4)
-property,whichisobtainedfromeitheroftheotherpartitionsintotwosets.S demonstratesthestrengthofthe
(
m,
d)
-property.Thetrivialpartitionintosetsofone polyno-mial isequivalent tothesimpleapproachofjusttrackingthenumberofpolynomialsandmaximum degree.Inthisexamplesuchanapproachwouldleadusto3polynomialsofdegree4,contributinga possible12realroots.However,byusingmoresophisticatedpartitionswereplacethisby2sets,for eachofwhichtheproductofpolynomialentrieshasdegree4,andsoatmost8realrootscontributed. Thoughnotusedinthispaper,wenoteanadvantageofthe(
m,
d)
-propertyoverthe(
1,
md)
-prop-ertyisabetterboundonrootseparation:anytworootsrequireO(
2d)
subdivisionstoisolate,rather thanthe O(
md)
impliedbyconsideringtheproductofallpolynomials.Wealsorecallthefollowingclassicidentitiesforpolynomials f
,
g,
h:res(f g
,
h)
=
res(f,
h)
res(g,
h)
;
(6)disc(f g
)
=
disc(f)
disc(g)
res(f,
g)
2;
(7)disc(f
)
= (−
1)12d(d−1)1adres(f
,
f)
(8)whered isthedegree of f , f itsderivative andad itsleading coefficient(alltakenwithrespectto
thegivenmainvariable).
Lemma11.Suppose A isasetofpolynomialsinn variableswiththe
(
m,
d)
property.Then P(
A)
hasthe(
M,
2d2)
propertywith M=
(
m+
1)2 2.
(9)Proof. Partition A as S1
∪ · · · ∪
Sm accordingtoits(
m,
d)
-property. LetB be asquare-freebasis forprim
(
A)
, T1 thesetofelementsof B whichdividesomeelementofS1,andTi bethoseelementsofB whichdividesomeelementofSi butwhichhavenotalreadyoccurredinsomeTj
:
j<
i.(1) Wefirstclaimthateachset
cont(Si
)
∪
ldcf(Ti)
∪
disc(Ti)
∪
res(Ti)
(10)fori
=
1,
. . . ,
m hasthe(
1,
2d2)
property.Letc betheproductoftheelementsofcont(
Si),Ti=
{
F1,
. . . ,
Ft} forsomet
and F:=
c F1,
. . .
Ft. Then F dividesthe product of the elements of Siand so hasdegree atmostd. Thus res
(
F,
F)
musthave degree at most2d2 because it isthe determinant ofa(
2d−
1×
2d−
1)
matrix inwhich each element hasdegree atmost d. Thenby (8) and repeated applicationof (6) and (7) we see res
(
F,
F)
is a (non-trivial) power of c multipliedby tj=1ldcf(Fj
)
tj=1disc(Fj)
tj<kres(Fj,
Fk)
2.
Sincethisincludesalltheelementsof(10)theclaimisproved.
(2) WearestillmissingfromP
(
A)
theres(
f,
g)
where f∈
Ti,g∈
Tjandi=
j.Forfixedi,
j considerres
f∈Ti f,
g∈Tjg,whichby(6)istheproductofthemissingresultants.Thisistheresultant oftwo polynomialsofdegreeatmostd andhencewillhavedegree atmost2d2.Thus forfixed i
,
j thesetofmissingresultantshasthe(
1,
2d2)
-property,andsotheunionofallsuchsets the1
2m
(
m−
1),
2d2
-property.(3) Weare now missingfrom P
(
A)
onlythe non-leadingcoefficientsof B.The polynomialsin the set Ti havedegree atmostd whenmultipliedtogether,andso,separately or together,haveatmostd non-leading coefficients,eachofwhichhasdegreeatmostd.Hencethissetofnon-leading coefficientshas the
(
1,
d2)
property. This is thecase for i from1 to m and thus together thenon-leadingcoefficientsofB havethe
(
m,
d2)
-property.Wecan thenpairupthesesetstogetapartitionwiththe
(
m/
2,
2d2)
-property(Proposition 9). Hence P(
A)
canbepartitionedintom
+
m(
m−
1) 2+
m 2=
m(
m+
1) 2+
m
+
1 2=
(
m+
1)2 2sets (where the final equality follows fromm
(
m+
1)
always beingeven) each withcombined de-gree 2d2.2
This concerns a single projection, and we must apply it recursively to consider the full set of projectionpolynomials.Weakeningtheboundasinthefollowingallowsforaclosedformsolution. Corollary 12. If A is a setof polynomials with the
(
m,
d)
property where m>
1,then P(
A)
has the(
m2,
2d2)
-property. Remark13.(1) NotethatifA hasthe
(
1,
d)
-propertythen P(
A)
hasthe(
2,
2d2)
propertyandhencetheneedfor m>
1 to applyCorollary 12.Asourpapercontinueswe presentnewtheory thatappliesto the firstprojectiononly.HenceforafairandaccuratecomplexitycomparisonwewilluseLemma 11forthefirst projection andthenCorollary 12 forsubsequentones, (applicablesince evenifwe startwithm
=
1 polynomialforthefirstprojection,wecanassumem≥
2 thereafter).(2) Theanalysis sofar resemblesSection 6.1of McCallum (1985).However, that thesisleads usto the
(
m2d,
2d2)
-propertyinplaceofCorollary 12.Theextradependencyond was avoidedbyan improvedanalysisintheproofofLemma 11part(3).Weconsiderthegrowthinprojectionpolynomialsandtheirdegreewhenusingtheoperator P in
Table 1.Herethecolumnheadingsrefernottothenumberofpolynomialsandtheirdegree,buttothe numberofsetsandtheircombineddegreewhenapplyingDefinition 7.Westartwithm polynomials ofdegreed andafteroneprojectionhaveasetwiththe
(
M,
2d2)
property,usingM fromLemma 11.WethenuseCorollary 12tomodelthegrowthinsubsequentprojections,andasimpleinductionto fillinthetable.
ThesizeoftheCADproduceddependsonthenumberofrealrootsoftheprojectionpolynomials. Wecanhenceboundthenumberofrealrootsinasetofpolynomialswiththe
(
m,
d)
-propertywith md (in practicemanyofthemwillbestrictlycomplex).Wecan thereforeboundthenumberofreal rootsoftheunivariateprojectionpolynomialsbytheproductofthetwoentriesintherowofTable 1Table 1
Expression growth for CAD projection where: after the first projection we have polynomials with the (M,2d2)-property and
thereafter we measure growth using Corollary 12. The value of M could
be (9), (13), (18), (24)
or (29)depending on which projection scheme we are analysing.Variables Number Degree Product
n m d md n−1 M 2d2 2Md2 n−2 M2 8d4 23M2d4 n−3 M4 128d8 27M4d8 . . . . . . . . . . . . n−r M2r−1 22r−1d2r 22r−1d2r M2r−1 . . . . . . . . . . . . 1 M2n−2 22n−1−1 d2n−1 22n−1−1 d2n−1 M2n−2 Product M2n−1−1 m 22n−1−n d2n−1 22n−n−1 d2n−1 M2n−1−1 m
for1variable.The numberofcells intheCADof
R
1 isboundedbytwice thisplus1.Similarly,thetotalnumberofcellsintheCADof
R
n isboundedbytheproductof2K+
1 where K variesthrough theProductcolumnofTable 1,i.e.by(2Md
+
1) n−1 r=1 2 22r−1d2rM2r−1
+
1.
Omittingthe
+
1 willleaveuswiththedominanttermofthebound,whichcanbecalculated explic-itlyas22n−1d2n−1M2n−1−1m (11)
≤
22n−1d2n−112(
m+
1)22
n−1−1
m
=
22n−1d2n−1(
m+
1)2n−2m,
(12)where the inequality was introduced by omitting thefloor function in (9).This may be compared with the bound inTheorem 6.1.5 of McCallum (1985), withthe main differencesexplained by Re-mark 13(2).
WenowturnourfocustoCADinvariantwithrespecttoanEC.Recallthatweuseoperator PE(A
)
for the first projection only and P
(
A)
thereafter. Hence we use Corollary 12 for the bulk of the analysis,andthenextlemmawhenconsideringthefirstprojection.Lemma14.SupposeA isasetofm polynomialsinn variableseachwithmaximumdegreed,andthatE
⊆
A containsasinglepolynomial.ThenthereducedprojectionPE(A)
hasthe(
M,
2d2)
-propertywithM
=
1 2(3m
+
1).
(13)Proof. Since E containsasinglepolynomialitssquarefreebasis F hasthe
(
1,
d)
-property.(1) Thecontents,leadingcoefficientsanddiscriminantsfromF formaset R1 withcombineddegree
2d2 (seeproofofLemma 11step1)andtheothercoefficientsaset R2 withcombineddegreed2
(seeproofofLemma 11step3).
(2) The set of remaining contents R3
=
cont(
A)
\
cont(
E)
has the(
m−
1,
d)
-property and thustrivially, the
(
m−
1,
d2)
-property. Then R2∪
R3 has the(
m,
d2)
-property and thus also the m 2,
2d2-property(Proposition 9).
(3) Itremainstoconsiderthefinalsetofresultantsin(5).Followingtheapproachfromtheproofof
Lemma 11step2,we concludethatforeachofm
−
1 polynomialsin A\
E therecontributesa setwiththe(
1,
2d2)
-property.Sotogethertheyformaset RHence PE
(
A)
iscontainedinR1∪ (
R2∪
R3)
∪
R4 whichmaybepartitionedinto 1+
m2+ (
m−
1)=
1 2(
m+
1)+
m=
1 2(3m
+
1)setsofcombineddegree2d2.
2
WecanuseTable 1tomodelthegrowthinprojectionpolynomialsforthealgorithminMcCallum (1999) as well, since the only difference will be the numberof polynomialsproduced by thefirst projection,andthusthevalue ofM.Hence thedominanttermintheboundonthetotalnumberof cellsisgivenagainby(11),whichinthiscasebecomes(uponomittingthefloor)
22n−1d2n−1
(
12(3m
+
1))2n−1−1m=
22n−1d2n−1(3m
+
1)2n−1−1m.
(14)SincePE(A
)
isasubsetofP(
A)
aCADinvariantwithrespecttoanECshouldcertainlybesimpler thanasign-invariantCADforthepolynomialsinvolved.Indeed,comparingthedifferentvaluesof M weseethat1 2
(
m+
1)2
>
12
(3m
+
1)(strictly so for m
>
1).Comparingthe dominanttermsinthecell countbounds,(14) and(12),weseethemaineffectisa decreaseinoneofthedoubleexponentsby1.
3. AprojectionoperatorforTTICAD 3.1. Newprojectionoperator
InMcCallum (1999)thecentralconceptisthereducedprojectionofasetofpolynomialsA relative toasubset E (definingthe EC).Thefull projectionoperatorisapplied to E andthen supplemented bytheresultantsofpolynomialsinE withthosein E
\
A,sincethelattergrouponlyeffectthetruth oftheformulawhen theysharea rootwiththeformer.We extendthisideato define aprojection foralist ofsetsof polynomials(derivedfromalist offormulae),some ofwhich mayhavesubsets (derivedfromECs).ForsimplicityinMcCallum (1999)theconceptisfirstdefinedforthecasewhenA isanirreducible basis.Weemulatethisapproach,generalisingforothercasesbyconsideringcontentsandirreducible factorsofpositive degreewhen verifyingthealgorithm inSection4. Solet
A
= {
Ai}
ti=1 bea listofirreduciblebases Ai andlet
E = {
Ei}
it=1bealistofsubsetsEi⊆
Ai.Put A=
ti=1AiandE=
ti=1Ei.Notethat weusetheconventionofuppercaseRoman lettersforsetsofpolynomialsandcalligraphic lettersforlistsofthese.
Definition15.Withthenotationabovethereducedprojectionof
A
withrespecttoE
isPE
(
A
)
:=
ti=1PEi(
Ai)
∪
RES×(
E
)
(15)whereRES×
(E)
isthecrossresultantsetRES×
(
E
)
= {
resxn(
f, ˆ
f)
| ∃
i,
j such that f∈
Ei, ˆ
f∈
Ej,
i<
j,
f= ˆ
f}
(16)and PE
(
A)
=
P(
E)
∪
resxn(
f,
g)
|
f∈
E,
g∈
A,
g∈
/
E,
P
(
A)
= {
coeffs(f),
disc(f),
resxn(
f,
g)
|
f,
g∈
A,
f=
g}.
Theorem16.LetS beaconnectedsubmanifoldof
R
n−1.SupposeeachelementofPE
(A)
isorderinvariant inS.Theneach f∈
E eithervanishesidenticallyonS orisanalyticallydelineableonS;thesectionsoverS of thef∈
E whichdonotvanishidenticallyarepairwisedisjoint;andeachelementf∈
E whichdoesnotvanish identicallyisorder-invariantinsuchsections.Moreover,foreachi,in1
≤
i≤
t everyg∈
Ai\
Eiissign-invariantineachsectionoverS ofevery f∈
EiProof. ThecrucialobservationforthefirstpartisthatP
(
E)
⊆
PE(
A)
.Toseethis,recallequation(15)andnotethatwecanwrite
P
(
E)
=
iP(
Ei)
∪
RES×(
E
).
We canthereforeapply Theorem 4 totheset E andobtain thefirstthree conclusionsimmediately, leavingonlythefinalconclusiontoprove.
Let i be in the range1
≤
i≤
t, let g∈
Ai\
Ei and let f∈
Ei. Suppose that f does not vanishidenticallyon S.Nowresxn
(
f,
g)
∈
PE(A)
,andsoisorder-invariant in S byhypothesis. Further,wealreadyconcludedthat f isdelineable.ThereforebyTheorem 5, g issign-invariantineachsectionof f overS.
2
Theorem 16isthekeytoolfortheverificationofourTTICADalgorithminSection4.Itallowsus to concludetheoutputiscorrectsolongasno f
∈
E vanishesidenticallyonthelowerdimensional manifold, S.Apolynomial f inr variables thatvanishesidenticallyatapointα
∈ R
r−1issaidtobe nullified atα
.The theory ofthis subsectionappears identical to the work in Bradford et al. (2013a). The dif-ference isintheapplicationofthetheory inSection4.We supposethatthe inputisa listofQFFs,
{φ
i}
,witheach Ai definedfromthepolynomialsineachφi
.InBradford et al. (2013a)therewas anassumption(nolongermade)thateachoftheseformulaehadadesignatedEC fi
=
0 fromwhichthesubsets Ei are defined. Instead,we define Ei to bea basis for
{
fi}
ifthereis sucha designatedECanddefine Ei
=
Ai otherwise.Thatis,we needtotreatallthepolynomialsinQFFswithnoECwiththeimportanceusuallyreservedforECs.
3.2. Comparisonwithusingasingleimplicitequationalconstraint
It isclearthat ingeneralthe reducedprojection PE
(
A)
willlead tofewer projection polynomi-als than usingthe full projection P . However, a comparisonwiththe existing theory ofequational constraintsrequiresalittlemorecare.First,wenotethattheTTICADtheoryisapplicabletoasequenceofformulaewhilethetheoryof
McCallum (1999)isapplicableonlytoasingleformula.HenceifthetruthvalueofeachQFFisneeded thenTTICADistheonlyoption;atruth-invariantCADforaparentformulawillnotnecessarilysuffice. Second wenote thateven ifthesequencedoforma parentformulathen thismusthavean overall ECtouseMcCallum (1999)whiletheTTICADtheoryisapplicableevenifthisisnotthecase.
Letusconsider thesituationwhereboth theoriesare applicable, i.e.we havea sequenceof for-mulae (formingaparentformula)forwhicheach hasanECandthustheparentformulaanimplicit EC (theirproduct). Inthe contextof Section1.2thiscorresponds to using
ifi astheEC.Theim-plicitECapproachwouldcorrespondtousingthereducedprojection PE(A
)
ofMcCallum (1999),with E= ∪
iEiandA= ∪
iAi.Wemakethesimplifyingassumptionthat A isanirreduciblebasis.IngeneralPE
(A)
willstillcontain fewerpolynomialsthan PE(A)
since PE(
A)
contains allresultantsres(
f,
g)
where f
∈
Ei,g∈
Aj(andg∈
/
E),whilePE(A)
containsonlythosewithi=
j (andg∈
/
Ei).Thuseveninsituationswheretheprevious theoryappliesthereisan advantageinusingthenewTTICAD the-ory.Thesesavingsarehighlightedbytheworkedexamplesinthenextsubsectionandthecomplexity analysislater.
3.3. Workedexamples
InSection4wedefineanalgorithmforproducingTTICADs.Firstweillustratethesavingswithour workedexamplesfromSection1.3,whichsatisfythesimplifyingassumptionsfromSection3.1.
Westartbyconsidering
fromequation(2).Inthenotationabovewehave:
A1
:= {
f1,
g1}, E1:= {
f1}; A2:= {
f2,
g2}, E2:= {
f2}.Fig. 3. The
polynomials from
in equation (2)along with the roots of PE(A)(solid lines), PE(A)(dashed lines) and P(A) (dotted lines).Fig. 4. Magnified region ofFig. 3.
PE1
(
A1)
=
x2−
1,x4−
x2+
161,
PE2(
A2)
=
x2−
8x+
15,x4−
16x3+
95x2−
248x+
384116,
andthecross-resultantset
Res×
(
E
)
= {
resy(
f1,
f2)
} = {
68x2−
272x+
285}.
PE
(
A)
is then the union ofthese three sets. InFig. 3 we plot the polynomials(solid curves) and identifythe12realsolutionsof PE(
A)
(solidverticallines).Wecanseethesolutionsalignwiththe asymptotesofthe fi’sandtheimportantintersections(thoseof f1 withg1and f2 withg2).If we were to instead use a projection operator based on an implicitEC f1f2
=
0 then in thenotationabovewewouldconstructPE(A
)
fromA= {
f1,
f2,
g1,
g2}
andE= {
f1,
f2}
.Thissetprovidesanextra4solutions(thedashedverticallines)whichalignwiththeintersectionsof f1 with g2 and f2withg1.Finally,ifweweretoconsiderP
(
A)
thenwegainafurther4solutions(thedottedverticallines) whichalign withthe intersectionsof g1 and g2 andtheasymptotes ofthe gi’s.In Fig. 4we
magnifyaregiontoshowexplicitlythatthepointofintersectionbetween f1 andg1 isidentifiedby PE
(A)
,whiletheintersectionsof g2 withboth f1andg1 areignored.The 1-dimensionalCADproduced using PE
(A)
has 25cells compared to 33when using PE(
A)
and41whenusingP
(
A)
.However,itisimportanttonotethatthisreductionisamplifiedafterlifting (usingTheorem 16andAlgorithm 1).The2-dimensionalTTICADhas105cells andthesign-invariant CADhas317.Using Qepcad tobuildaCADinvariantwithrespecttotheimplicitECgivesus249cells.Fig. 5. The polynomials fromin equation(3)along with the roots of PE(A).
Fig. 6. Magnified region ofFig. 5.
Nextweconsiderdeterminingthetruthof
fromequation(3).Thistime
A1
:= {
f1,
g1}, E1:= {
f1}, A2:= {
f2,
g2}, E2:= {
f2,
g2},andsoPE1
(
A1)
isasabovebutPE2(
A2)
containsanextrapolynomialx−
4 (thecoefficientofy in g2). Thecross-resultantsetRES×(E)
alsocontainsanextrapolynomial,resy
(
f1,
g2)
=
x4−
8x3+
16x2+
12x−
3116.
These two extra polynomialsprovidethree extra realroots andhencethe 1-dimensionalCAD pro-ducedusing PE
(
A)
thistimehas31cells.In Fig. 5 we againgraphthe fourcurvesthistime withsolid vertical lineshighlighting the real solutions of PE
(
A)
.BycomparingwithFig. 3weseethat morepointsintheCADofR
1 havebeen identifiedfortheTTICADofthantheTTICADof
(15insteadof12)butthatthereisstillasaving over the sign-invariant CAD(which had20,the five extrasolutions indicated by dotted lines). The lackofanECinthesecond clausehasmeant thattheasymptoteof g2 anditsintersectionswith f1
havebeenidentified.However, notethat theintersectionsof g1 with f2 and g2 andhavenot been. Fig. 6magnifiesaregionofFig. 5.ComparewithFig. 4toseethedashedlinehasbecomesolid,while thedottedlineremainsunidentifiedbytheTTICAD.
Notethat weare unabletouseMcCallum (1999) tostudy
asthereisnopolynomial equation logicallyimplied(eitherexplicitlyorimplicitly)bythisformula.Hencetherearenodashedlinesand the choiceisbetweenthe sign-invariantCADwith317 cellsorthe TTICAD,whichforthisexample has183cells.
Algorithm 1: TTICADalgorithm.
Input : A
list of quantifier-free formulae
{φi}ti=1in variables x1,. . . ,xn. Each φihas at most one designated EC fi=0.Output: Either• D: A CAD of Rn(described by lists I andS of
cell indices and sample points) which is truth table
invariant for the list of input formulae; or •FAIL:If
Ais not well-oriented with respect to E(Definition 18).1 for i=1 . . .t do
2 If there is no designated EC then set Ei:=Aiand otherwise set Ei:= {fi};
3 Compute the finest squarefree basis Fifor prim(Ei);
4 Set F← ∪t i=1Fi; 5 if n=1 then
6 Isolate the real roots of the polynomials in F and
thus form cell indices and sample points for a CAD of
R;7 return I andS forD;
8 else
9 for i=1 . . .t do
10 Extract the set Aiof polynomials in φi;
11 Compute the set Ciof contents of the elements of Ai;
12 Compute the set Bi, the finest squarefree basis for prim(Ai);
13 Set C:= ∪t
i=1Ci, B:= (Bi)ti=1and F:= (Fi)ti=1; 14 Construct the projection set P:=C∪PF(B);
15 Attempt to construct a lower-dimensional CAD: w,I,S:= CADW(n−1,P);
16 if w=false then
17 return FAIL (sincePis not well oriented) ; 18 I← ∅; S← ∅;
19 for eachcellc∈ Ddo
20 Lc← {};
21 for i=1,. . .t do
22 if anyf∈Eiisnullifiedonc then
23 if dim(c)>0 then
24 return FAIL (since{φi}ti=1is not well oriented) ;
25 else
26 Lc←Lc∪Bi;
27 else
28 Lc←Lc∪Fi;
29 Generate a stack over c usingLc: construct cell indices and sample points for the stack over c of
the
polynomials in Lc, adding them to I andS ;30 return I andS forD;
4. Algorithm
4.1. Descriptionandproof
We describe carefullyAlgorithm 1. Thiswill createa TTICAD of
R
n fora listof QFFs{φ
i}
ti=1 invariables x
=
x1≺
x2≺ · · · ≺
xn, where eachφi
has at mostone designated EC fi=
0 of positivedegree(theremaybeothernon-designatedECs).
Itusesasubalgorithm
CADW
,whichwasvalidatedby McCallum (1998).TheinputofCADW
is:r, apositiveintegerand A,asetofr-variateintegralpolynomials.The outputisabooleanw whichif trueisaccompanied byan order-invariant CADfor A (representedasa listofindices I andsample points S).Let Ai bethesetofall polynomialsoccurringin
φi
.Ifφi
hasadesignatedECthenput Ei= {
fi}
andifnotputEi
=
Ai.LetA
andE
bethelistsoftheAiandEirespectively.Ouralgorithmeffectivelydefinesthereducedprojectionof
A
withrespecttoE
intermsofthespecialcaseofthisdefinition fromtheprevioussection.ThedefinitionamountstoHereC isthesetofcontentsofalltheelementsofall Ai;
B
thelist{
Bi}
ti=1suchthatBiisthefinest2squarefreebasisforthesetprim
(
Ai)ofprimitivepartsofelementsofAi whichhavepositivedegree;and
F
is thelist{
Fi}
ti=1,such that Fi is thefinest squarefreebasis for prim(
Ei).(Thereader maynotice thatthisnotation andthe definitionof PE
(
A)
hereisanalogoustothework inSection5 ofMcCallum, 1999.)
We shallprovethat,providedtheinputsatisfiesthecondition ofwell-orientedness givenin Def-inition 18, theoutput ofAlgorithm 1 is indeeda TTICADfor
{φ
i}
. Wefirst recall themore generalnotionofwell-orientednessfromMcCallum (1998).Thebooleanoutputof
CADW
isfalseiftheinput setwasnotwell-orientedinthissense.Definition17.A set A of n-variate polynomialsissaid tobe welloriented ifwhenever n
>
1,every f∈
prim(
A)
is nullified by at most a finite number of points inR
n−1, and (recursively) P(
A)
is well-oriented.Thisconditionisrequiredfor
CADW
sincethevalidityofthisalgorithmreliesonTheorem 4which holdsonlywhenpolynomialsdonotvanishidentically.Theconditionsallowsfora finitenumberof thesenullificationssincethisindicates aproblemonazerocell,thatisasinglepoint.Insuchcases it is possible to replacethe nullified polynomial by a so called delineatingpolynomial whichis not nullifiedandcanbeusedinplacetoensurethedelineabilityoftheother.Theuseoftheseispartof theverifiedalgorithmCADW
(McCallum, 1998) andtheyarestudiedindetailbyBrown (2005).Wenowdefineournewnotionofwell-orientednessforthelistsofsets
A
andE
.Definition18.Wesay that
A
iswellorientedwithrespecttoE
if,whenevern>
1,every polynomial f∈
E isnullifiedby atmosta finitenumberofpoints inR
n−1,and PF(
B)
is well-orientedinthe senseofDefinition 17.ItisclearthanAlgorithm 1terminates.Wenowprovethatitiscorrectusingthetheorydeveloped inSection3.
Theorem19.Theoutputof
Algorithm 1
isasspecified.Proof. We must show that when the input is well-oriented the output is a TTICAD, (each
φi
has constanttruthvalueineachcellofD
),and FAIL otherwise.Iftheinputwasunivariatethenitistriviallywell-oriented.ThealgorithmwillconstructaCAD
D
ofR
1 usingtherootsoftheirreduciblefactorsofthepolynomialsin E (steps6to7).Ateach0-cellall the polynomialsin each
φi
trivially haveconstant signs,and henceeveryφi
hasconstant truth value. Ineach 1-cellno EC can change signand so everyφi
hasconstant truth value false,unless therearenoECsinanyclause.InthiscasethealgorithmwouldhaveconstructedaCADusingallthe polynomials andhence oneach 1-cellno polynomialchanges signandsoeach clause hasconstant truthvalue.From nowonsupposen
>
1.IfP
=
C∪
PF(B)
isnotwell-orientedinthesense ofDefinition 17then
CADW
returnswasfalse.InthiscasetheinputisnotwellorientedinthesenseofDefinition 18and Algorithm 1 correctly returns FAIL in step 17. Otherwise, we have w
=
true with I and S specifying a CAD,D
, which is order-invariant withrespect toP
(by the correctness ofCADW
, as proved in McCallum, 1998). Letc, a submanifoldofR
n−1,be a cell ofD
andletα
be its sample point.We supposefirstthatthedimensionofc ispositive.Ifanypolynomial f
∈
E vanishesidentically on c then the input is not well orientedin thesense ofDefinition 18 andthe algorithm correctly returns FAIL atstep24.Otherwise,weknowthattheinputlistwascertainlywell-oriented.Sinceno polynomial f∈
E vanishesthennoelementofthebasis F vanishesidenticallyonc either.Hence,byTheorem 16,appliedwith
A
=
B
andE = F
,eachelementof F isdelineableonc,andthesections overc oftheelementsofF arepairwisedisjoint.Thusthesectionsandsectorsoverc oftheelements of F compriseastackoverc.Furthermore,thelast conclusionofTheorem 16assures usthat,for each i,every element of Bi
\
Fi is sign-invariantineach section over c ofevery element of Fi.Let1
≤
i≤
t.Weshallshowthateachφi
hasconstanttruthvalueinboththesectionsandsectorsof. If
φi
hasadesignatedECthenlet fi denotetheconstraintpolynomial;otherwiselet fi denoteanarbitraryelementofAi.
Consider firsta section
σ
of. Now fi is aproduct ofits content cont
(
fi)andsome elementsofthebasis Fi.Butcont
(
fi),anelementofP
,issign-invariant(indeedorder-invariant)inthewholecylinderc
× R
andhence,inparticular, inσ
.Moreover all oftheelements of Fi are sign-invariantin
σ
,as was noted previously. Therefore fi issign-invariant inσ
. Ifφi
has no constraint (andsofi denotesan arbitraryelement of Ai) then thisimpliesthat
φi
hasconstant truth value inσ
. Soconsiderfromnowonthecaseinwhich fi
=
0 isthedesignatedconstraintpolynomialofφi
.If fiispositiveornegativein
σ
thenφi
hasconstanttruthvaluefalse inσ
.Sosupposethat fi=
0throughout
σ
.Itfollowsthatσ
mustbeasectionofsomeelementofthebasis Fi.Letg∈
Ai\
Eibeanon-constraintpolynomialinAi.Now,bythedefinitionofBi,wesee g canbewrittenas g
=
cont(g)
hp11
· · ·
h pk kwherehj
∈
Bi,pj∈ N
.Butcont(
g)
,inP
,issign-invariant(indeedorder-invariant)inthewholecylin-der c
× R
, and hence in particular inσ
. Moreover each hj is sign-invariant inσ
, as was notedpreviously.Hence g issign-invariantin
σ
.(Notethat inthecasewhere g doesnothavemain vari-ablexn then g=
cont(
g)
andtheconclusionstillholds.) Since g wasanarbitraryelementof Ai\
Ei,itfollowsthat allpolynomialsin Ai are sign-invariantin
σ
,hencethatφi
hasconstant truthvaluein
σ
.Nextconsider asector
σ
ofthestack,andnotice that atleastone such sector exists.As ob-servedabove,cont
(
fi)issign-invariantinc,and fidoesnotvanishidenticallyonc.Hencecont(
fi)isnon-zerothroughoutc.Moreovereachelementofthebasis Fiisdelineableonc.Hence fiisnullified
bynopointofc.Itfollowsfromthisthatthealgorithmdoesnotreturn FAIL duringtheliftingphase. Itfollowsalsothat fi
=
0 throughoutσ
.Henceφi
hasconstanttruthvaluefalse inσ
.It remains to consider the casein which the dimension ofc is 0. In thiscasethe roots of the polynomialsinthe liftingset Lc constructed by thealgorithm determinea stack
overc. Each
φi
triviallyhasconstanttruthvalueineachsection(0-cell)ofthisstack,andthesamecanroutinelybe shownforeachsector(1-cell)ofthisstack.
2
4.2. TTICADviatheResCADset
When no f
∈
E is nullified there is an alternative implementation of TTICAD which would be simpletointroduceintoexistingCADimplementations.DefineR
(
{φ
i}) =
E∪
ti=1resxn
(
f,
g)
|
f∈
Ei,
g∈
Ai,
g∈
/
EitobetheResCADset of
{φ
i}
.Theorem20.Let
A
= (
Ai)ti=1bealistofirreduciblebases AiandletE = (
Ei)ti=1bealistofnon-emptysubsetsEi
⊆
Ai.Thenwehave P(
R
(
{φ
i})) =
PE(
A
).
Theproofisstraightforwardandsoomittedhere.
Corollary21.Ifno f
∈
E isnullifiedbyapointinR
n−1theninputtingR({φi
})
intoanyalgorithmwhich pro-ducesasign-invariantCADusingMcCallum’sprojectionoperatorP willresultintheTTICADfor{φ
i}
producedby
Algorithm 1
.Corollary 21givesasimple waytocompute TTICADsusingexisting CADimplementationsbased onMcCallum’sapproach,suchas Qepcad.