Maple's RegularChains package has received many updates since Maple 2019. Below you will find some improvements for Maple 2020.
Cylindrical Algebraic Decomposition
Computing intersection multiplicities
Limit points of implicitly defined curves
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 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, x:
cad ≔ CylindricalAlgebraicDecomposex2 + y2 ≤ 1, R
A more compact output is given with the option output = rootof.
CylindricalAlgebraicDecomposex2 + y2 ≤ 1, R, output=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 + y2 = 1, y2 = x:
cad_nonopt ≔ CylindricalAlgebraicDecomposeF, R, optimization = false:
cad_opt ≔ CylindricalAlgebraicDecomposeF, R, optimization=true:
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, R, method=recursive:
memory used=14.99MiB, alloc change=0 bytes, cpu time=130.00ms, real time=129.00ms, gc time=0ns
CodeTools:-UsageCylindricalAlgebraicDecomposeF, R, method=incremental:
memory used=1.78MiB, alloc change=0 bytes, cpu time=15.00ms, real time=15.00ms, gc time=0ns
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, y, z:
F ≔ x2+y+z−1, y2+x+z−1, z2+x+y−1:
We consider the points of intersection of all three surfaces. First, we compute these as regular chains.
dec ≔ TriangularizeF, R:
By inspection, these solutions correspond to the points x, y, z = −1, −1, −1±2,2,2 (two points), 0, 0, 1, 0, 1, 0, and 1, 0, 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+2,−1+2,−1+2 and one of the point 0, 0, 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, dec, F, R
This confirms that the intersection multiplicity of all points in the first regular chain is 1, whereas it is 2 for the others.
The new command TangentCone computes a tangent cone to a given space curve at a given set of points. Consider the following example.
rc ≔ Chainz−1, y, x, EmptyR, R:
rc, defined above, represents the point x, y, z = 0, 0, 1.
F ≔ x2+y2+z2−1, x2−y2−z ⋅z−1:
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, F, 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, F, R, output='equations', X, Y, Z
We see that it corresponds to the lines given by z = 1 and y = ±3⋅x. We show this in the same plot.
lines ≔ seqplottools:-line−12 ⋅ 3, −s2,1, 12 ⋅ 3,s2,1, color=green, thickness=3, s ∈ −1, 1:
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+y2+z5 =0 and x z4 + y3 − y2=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=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>y>z, then the leading coefficients of these equations are 1 and z4, respectively. The first coefficient doesn't vanish; the second vanishes at z=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 + y2 +z5:
p2 ≔ x z4 + y3 − y2:
R ≔ PolynomialRingx,y,z:
rc ≔ Chainp1, p2, EmptyR, R:
DisplayLimitPointsrc, R, 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, p2y|xx=0, y=0, z=0
p1, p2y|xx=0, y=1, z=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, R, coefficient=real, R
By using the coefficient=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, R, z:
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, R, z, coefficient=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 = I T, we get the following. (The call to convert/radical converts the RootOf function into I.)
complex_branches ≔ convertevalrbs1..2, _T = I T, radical:
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.
Download Help Document