 Regular Chains - Maple Help

 Regular Chains

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

$\mathrm{restart};$

$\mathrm{with}\left(\mathrm{RegularChains}\right):$

$\mathrm{with}\left(\mathrm{SemiAlgebraicSetTools}\right):$

$\mathrm{with}\left(\mathrm{AlgebraicGeometryTools}\right):\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}$

$\mathrm{with}\left(\mathrm{ChainTools}\right):$ 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 $\exists$, and "for all", or $\forall$, 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:

This can be encoded as follows.

 ${\mathrm{input}}{≔}{&E}{}\left(\left[{c}\right]\right){,}{&A}{}\left(\left[{b}{,}{a}\right]\right){,}\left(\left(\left({a}{=}{d}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{&and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left({b}{=}{c}\right)\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{&or}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(\left({a}{=}{c}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{&and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left({b}{=}{1}\right)\right)\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{&implies}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left({{a}}^{{2}}{=}{b}\right)$ (1.1)

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

$\mathrm{QuantifierElimination}\left(\mathrm{input}\right)$

 $\left({d}{-}{1}{=}{0}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{&or}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left({d}{+}{1}{=}{0}\right)$ (1.2)

It is easy to see by hand that these are indeed solutions to the given problem (with e.g.  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:



 ${\mathrm{&or}}{}\left(\left({a}{<}{0}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{&and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(\frac{{{b}}^{{2}}}{{4}{}{a}}{\le }{c}\right){,}\left({a}{=}{0}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{&and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left({b}{\ne }{0}\right){,}{\mathrm{&and}}{}\left({a}{=}{0}{,}{b}{=}{0}{,}{c}{=}{0}\right){,}\left({0}{<}{a}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{&and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left({c}{\le }\frac{{{b}}^{{2}}}{{4}{}{a}}\right)\right)$ (1.3) 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:

 ${\mathrm{cad}}{≔}{\mathrm{c_a_d}}$ (2.1)

 $\left[\left\{\begin{array}{cc}{y}{=}{y}& {}\\ {x}{<}{-1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{y}{<}{0}& {}\\ {x}{=}{-1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{y}{=}{0}& {}\\ {x}{=}{-1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{0}{<}{y}& {}\\ {x}{=}{-1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{y}{<}{-}\sqrt{{-}{{x}}^{{2}}{+}{1}}& {}\\ {-1}{<}{x}{\wedge }{x}{<}{1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{y}{=}{-}\sqrt{{-}{{x}}^{{2}}{+}{1}}& {}\\ {-1}{<}{x}{\wedge }{x}{<}{1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{-}\sqrt{{-}{{x}}^{{2}}{+}{1}}{<}{y}{\wedge }{y}{<}\sqrt{{-}{{x}}^{{2}}{+}{1}}& {}\\ {-1}{<}{x}{\wedge }{x}{<}{1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{y}{=}\sqrt{{-}{{x}}^{{2}}{+}{1}}& {}\\ {-1}{<}{x}{\wedge }{x}{<}{1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}\sqrt{{-}{{x}}^{{2}}{+}{1}}{<}{y}& {}\\ {-1}{<}{x}{\wedge }{x}{<}{1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{y}{<}{0}& {}\\ {x}{=}{1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{y}{=}{0}& {}\\ {x}{=}{1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{0}{<}{y}& {}\\ {x}{=}{1}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{y}{=}{y}& {}\\ {1}{<}{x}& {}\end{array}\right\\right]$ (2.2)

A more compact output is given with the option .

 $\left[\left[{-1}{\le }{x}{\wedge }{x}{\le }{1}{,}{-}\sqrt{{-}{{x}}^{{2}}{+}{1}}{\le }{y}{\wedge }{y}{\le }\sqrt{{-}{{x}}^{{2}}{+}{1}}\right]\right]$ (2.3)

The $\mathrm{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.

 ${53}$ (2.4)

 ${9}$ (2.5)

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.

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

 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.

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

 $\left[\left\{\begin{array}{cc}{x}{-}{z}{=}{0}& {}\\ {y}{-}{z}{=}{0}& {}\\ {{z}}^{{2}}{+}{2}{}{z}{-}{1}{=}{0}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{x}{=}{0}& {}\\ {y}{=}{0}& {}\\ {z}{-}{1}{=}{0}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{x}{=}{0}& {}\\ {y}{-}{1}{=}{0}& {}\\ {z}{=}{0}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{x}{-}{1}{=}{0}& {}\\ {y}{=}{0}& {}\\ {z}{=}{0}& {}\end{array}\right\\right]$ (3.1)

By inspection, these solutions correspond to the points  (two points), , , and , 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 $\left[-1+\sqrt{2},-1+\sqrt{2},-1+\sqrt{2}\right]$ and one of the point .   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 $\mathrm{IntersectionMultiplicity}$ command.

 $\left[\left[\left[{1}{,}{\mathrm{regular_chain}}\right]\right]{,}\left[\left[{2}{,}{\mathrm{regular_chain}}\right]\right]{,}\left[\left[{2}{,}{\mathrm{regular_chain}}\right]\right]{,}\left[\left[{2}{,}{\mathrm{regular_chain}}\right]\right]\right]$ (3.2)

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.

$\mathrm{rc}$, defined above, represents the point .

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

 ${\mathrm{solutions}}{≔}\left[\sqrt{{-}{{x}}^{{2}}{-}{{y}}^{{2}}{+}{1}}{,}{-}\sqrt{{-}{{x}}^{{2}}{-}{{y}}^{{2}}{+}{1}}{,}\frac{{1}}{{2}}{+}\frac{\sqrt{{4}{}{{x}}^{{2}}{-}{4}{}{{y}}^{{2}}{+}{1}}}{{2}}{,}\frac{{1}}{{2}}{-}\frac{\sqrt{{4}{}{{x}}^{{2}}{-}{4}{}{{y}}^{{2}}{+}{1}}}{{2}}\right]$ (4.1)

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.

 ${\mathrm{tc}}{≔}\left\{\left[\left[{Z}{-}{1}{,}{3}{}{{X}}^{{2}}{-}{{Y}}^{{2}}\right]{,}{\mathrm{regular_chain}}\right]\right\}$ (4.2)

We see that it corresponds to the lines given by  and . We show this in the same plot.  Limit points of implicitly defined curves

Another new feature of the $\mathrm{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  and . 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 ${z}^{4}$, 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.

 $\left[\left\{\begin{array}{cc}{x}{=}{0}& {}\\ {y}{=}{0}& {}\\ {z}{=}{0}& {}\end{array}\right\{,}\left\{\begin{array}{cc}{x}{=}{0}& {}\\ {y}{-}{1}{=}{0}& {}\\ {z}{=}{0}& {}\end{array}\right\\right]$ (5.1)

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.

 $\left[{0}{,}{0}\right]$ (5.2)

 $\left[{0}{,}{0}\right]$ (5.3)

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:

 $\left[\left\{\begin{array}{cc}{x}{=}{0}& {}\\ {y}{-}{1}{=}{0}& {}\\ {z}{=}{0}& {}\end{array}\right\\right]$ (5.4)

By using the 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.

 $\left[{z}{=}{\mathrm{_T}}{,}{y}{=}{{\mathrm{_T}}}^{{5}}{+}{1}{,}{x}{=}{-}{{\mathrm{_T}}}^{{11}}{-}{2}{}{{\mathrm{_T}}}^{{6}}{-}{\mathrm{_T}}\right]$ (5.5)

The first two results each contain a $\mathrm{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 $\mathrm{RegularChainBranches}$ command can be instructed to return only truncated Puiseux series for real branches, as follows:

 ${\mathrm{real_branch}}{≔}\left[\left[{z}{=}{\mathrm{_T0}}{,}{y}{=}{{\mathrm{_T0}}}^{{5}}{+}{1}{,}{x}{=}{-}{{\mathrm{_T0}}}^{{11}}{-}{2}{}{{\mathrm{_T0}}}^{{6}}{-}{\mathrm{_T0}}\right]\right]$ (5.6)

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 . When we re-parametrize these nonreal branches by the change of variables , we get the following. (The call to $\mathrm{convert}/\mathrm{radical}$ converts the $\mathrm{RootOf}$ function into $I$.)

 $\left[{z}{=}{-}{{T}}^{{2}}{,}{y}{=}{-}\frac{{I}}{{2}}{}{{T}}^{{5}}{}\left({I}{}{{T}}^{{5}}{-}{2}{}{I}\right){,}{x}{=}{-}\frac{{{T}}^{{2}}{}\left({{T}}^{{20}}{-}{6}{}{{T}}^{{15}}{+}{10}{}{{T}}^{{10}}{-}{8}\right)}{{8}}\right]$ (5.7)

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. 