Regular Chains - Maple Programming Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : What's New and Release Notes : updates/Maple2020/RegularChains

Regular Chains

Maple's RegularChains package has received many updates since Maple 2019. Below you will find some improvements for Maple 2020.







Quantifier Elimination

Cylindrical Algebraic Decomposition

Computing intersection multiplicities

Tangent cones

Limit points of implicitly defined curves

Quantifier Elimination

Quantifier elimination is the process of taking a formula that involves statements of the form "there exists a value for variable x such that..." or "for all values of variable x, we have..." (represented with the quantifiers "there exists", or , and "for all", or , respectively), where the rest of the statement typically involves logical connectives such as "and" or "not" and polynomial formulas, and expressing this as an equivalent statement that does not include such quantifiers but depends only on the other variables that are not quantified over. These formulas are all interpreted over the real domain.

An example is probably in order. The following is known as the Davenport-Heintz problem:

c:  b, a: a = d  b = c  a=c b=1  a2=b

This can be encoded as follows.

input  &Ec, &Ab, a, a=d &and b = c &or a = c &and b = 1 &implies a2 = b



The solution is very simple. The QuantifierElimination command is in the SemiAlgebraicSetTools subpackage of RegularChains.




It is easy to see by hand that these are indeed solutions to the given problem (with e.g. c = 1 in both cases), but it is not obvious that there are no other solutions.


We can use this functionality to find all cases where the quadratic formula has roots. We get a more legible answer by using some optional arguments to the command:

R  PolynomialRingx, c, b, a:

QuantifierElimination&Ex, a x2 + b x + c = 0, R, output=rootof



Cylindrical Algebraic Decomposition

Cylindrical Algebraic Decomposition is a partition of the real, n-dimensional space into finitely many connected semi-algebraic subsets, called cells, such that any two cells are cylindrically arranged, that is, their projection onto a lower-dimensional space is either identical or disjoint. Here, a semi-algebraic set is a set given by polynomial equations, inequations, and inequalities.

The CylindricalAlgebraicDecompose command finds such a decomposition where the number of solutions for a given semi-algebraic system stays constant on each cell. A simple example is given as follows:

R  PolynomialRingy&comma; x&colon;

cad  CylindricalAlgebraicDecomposex2 &plus; y2  1&comma; R



Displaycad&comma; R



A more compact output is given with the option output &equals; rootof.

CylindricalAlgebraicDecomposex2 &plus; y2  1&comma; R&comma; output&equals;rootof



The CylindricalAlgebraicDecompose command has been available for a long time. In Maple 2020, it has some new options. One of them is the optimization option. In the simplest form, it is simply a true/false option (with default value true). With this option, Maple tries to reduce the number of cells returned. This example uses the Info command, which returns a list with some information about each cell found; the number of elements of this list is the number of cells.

F  x2 &plus; y2 &equals; 1&comma; y2 &equals; x&colon;

cad_nonopt  CylindricalAlgebraicDecomposeF&comma; R&comma; optimization &equals; false&colon;

numelemsInfocad_nonopt&comma; R&semi;



cad_opt  CylindricalAlgebraicDecomposeF&comma; R&comma; optimization&equals;true&colon;

numelemsInfocad_opt&comma; R&semi;



Another change is that the default algorithm used under the hood has changed. The previous algorithm can still be selected using the method option. The default value for the method option is incremental; the other possible value is recursive. For large systems, the incremental method is typically substantially faster. In this small example, the same difference in speed occurs.

CodeTools:-UsageCylindricalAlgebraicDecomposeF&comma; R&comma; method&equals;recursive&colon;

memory used=14.99MiB, alloc change=0 bytes, cpu time=130.00ms, real time=129.00ms, gc time=0ns

CodeTools:-UsageCylindricalAlgebraicDecomposeF&comma; R&comma; method&equals;incremental&colon;

memory used=1.78MiB, alloc change=0 bytes, cpu time=15.00ms, real time=15.00ms, gc time=0ns

Computing intersection multiplicities

The new command IntersectionMultiplicity returns the intersection multiplicity of a space curve at every point of that curve defined by a regular chain. This is shown in the following example.

R  PolynomialRingx&comma; y&comma; z&colon;

F  x2&plus;y&plus;z1&comma; y2&plus;x&plus;z1&comma; z2&plus;x&plus;y1&colon;

We consider the points of intersection of all three surfaces. First, we compute these as regular chains.

dec  TriangularizeF&comma; R&colon;

Displaydec&comma; R&semi;



By inspection, these solutions correspond to the points x&comma; y&comma; z &equals; 1&comma; 1&comma; 1±2&comma;2&comma;2 (two points), 0&comma; 0&comma; 1, 0&comma; 1&comma; 0, and 1&comma; 0&comma; 0, respectively.

The three surfaces look as follows. We show a larger plot that includes all intersection points of all three surfaces, and two close ups: one of the point 1&plus;2&comma;1&plus;2&comma;1&plus;2 and one of the point 0&comma; 0&comma; 1.

We see that in the second close up, the pairwise intersection curves appear to be locally tangent, which is not the case in the first close up. This is confirmed by the IntersectionMultiplicity command.

mapIntersectionMultiplicity&comma; dec&comma; F&comma; R



This confirms that the intersection multiplicity of all points in the first regular chain is 1, whereas it is 2 for the others.

Tangent cones

The new command TangentCone computes a tangent cone to a given space curve at a given set of points. Consider the following example.

R  PolynomialRingx&comma; y&comma; z&colon;

rc  Chainz1&comma; y&comma; x&comma; EmptyR&comma; R&colon;

rc, defined above, represents the point x&comma; y&comma; z &equals; 0&comma; 0&comma; 1.

F  x2&plus;y2&plus;z21&comma; x2y2z z1&colon;

We will find the tangent cone to the intersection of the surfaces defined in F at the point defined in rc. First let us examine these surfaces visually.

solutions  mapsolve&comma; F&comma; z



We are interested in the first and third solution. We create a plot of these two surfaces, call it p, and display it.

We now compute the tangent cone.

tc  TangentConerc&comma; F&comma; R&comma; output&equals;&apos;equations&apos;&comma; X&comma; Y&comma; Z



We see that it corresponds to the lines given by z &equals; 1 and y &equals; ±3x. We show this in the same plot.

lines  seqplottools:-line12  3&comma; s2&comma;1&comma; 12  3&comma;s2&comma;1&comma; color&equals;green&comma; thickness&equals;3&comma; s  1&comma; 1&colon;

Limit points of implicitly defined curves

Another new feature of the RegularChains library is its ability to determine the geometry of curves specified as the solution set of some equations. In particular, the library can find where the leading coefficients of these equations vanish, and whether the curve is locally real at those points or not. An example follows.

Consider the equations y3&plus;y2&plus;z5 &equals;0 and x z4 &plus; y3  y2&equals;0. The surfaces defined by them look as follows; this is purely for illustration and the method of drawing it won't be explained here. The first equation's surface is rendered in red, the second in blue, and the curve that is their intersection in green. You can also see a transparent black plane at z&equals;0, and the two intersection points of the curve with this plane in black; these are explained below.

If we view the variables as having the order x&gt;y&gt;z, then the leading coefficients of these equations are 1 and z4, respectively. The first coefficient doesn't vanish; the second vanishes at z&equals;0. The LimitPoints command can find the intersections of the curve, that is, the intersection of the red and blue surfaces. By default, this computation is done over the complex numbers.

p1  y3 &plus; y2 &plus;z5&colon; 

p2  x z4 &plus; y3  y2&colon; 

R  PolynomialRingx&comma;y&comma;z&colon;

rc  Chainp1&comma; p2&comma; EmptyR&comma; R&colon;

DisplayLimitPointsrc&comma; R&comma; R



We see that there are two such limit points. Indeed, if we evaluate the polynomials defining the equations at these points, they vanish. These are the two points shown in the graph above.

p1&comma; p2y|xx&equals;0&comma; y&equals;0&comma; z&equals;0



p1&comma; p2y|xx&equals;0&comma; y&equals;1&comma; z&equals;0



It looks like there is a cusp at the origin: the curve is not smooth there. We can confirm that this is indeed the case:

DisplayLimitPointsrc&comma; R&comma; coefficient&equals;real&comma; R



By using the coefficient&equals;real option, we include only points where the curve is locally smooth in real space: where it locally has a Puiseux series with real coefficients. This computation uses the underlying command RegularChainBranches, which returns a truncated Puiseux series at each of these points for all branches.

rbs  RegularChainBranchesrc&comma; R&comma; z&colon;

mapprint&comma; rbs&colon;



The first two results each contain a RootOf function which represents I (or I). We see that they have nonreal coefficients.

The last result is a truncated Puiseux series with only real coefficients. One might wonder if there are later terms of this series that have nonreal coefficients; but the algorithm used guarantees that this is not the case. The RegularChainBranches command can be instructed to return only truncated Puiseux series for real branches, as follows:

real_branch  RegularChainBranchesrc&comma; R&comma; z&comma; coefficient&equals;real



When we examine it in the plot, we can see that this is locally a good approximation to the intersection curve for real values of the parameter, but the other two branches are not. Indeed, the z-component of the curve is nonnegative, whereas the curve is present only for z  0. When we re-parametrize these nonreal branches by the change of variables _T &equals; I T, we get the following. (The call to convert&sol;radical converts the RootOf function into I.)

complex_branches  convertevalrbs1..2&comma; _T &equals; I T&comma; radical&colon;

mapprint&comma; complex_branches&colon;



Now the leading coefficient for each of the coordinates is real. Of course the (truncated) series itself can still not be embedded in real space, but we will be able to examine its real part, which should approximate the series well for small values of T. Below, this real part of the truncated Puiseux series is shown in purple and the real truncated Puiseux series in pink.