Overview - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Overview of the RegularChains Package

 

Calling Sequence

Description

List of the RegularChains Package Commands

List of RegularChains Subpackages

Mathematical Definitions

Examples

References

Calling Sequence

RegularChains:-command(arguments)

command(arguments)

Description

• 

The RegularChains package is a collection of commands for solving systems of algebraic equations, inequations and inequalities symbolically. This package also allows the user to manipulate and study the solutions of such systems.

• 

The main two commands are Triangularize and RealTriangularize. Each of them computes from a system of polynomials S a list of simpler systems S1,...,Sn such that a point is a solution of S if and only if it is a solution of one of the systems S1,...,Sn. Each of these simpler systems S1,...,Sn is called a regular chain in the case of Triangularize and a regular semi-algebraic system in the case of RealTriangularize. In both cases, each of these simpler systems has a special shape and remarkable properties. We describe below the notion of a regular chain and refer to the page SemiAlgebraicSetTools for that of a regular semi-algebraic system.

• 

To understand what a regular chain is, one first needs to define the input system S of Triangularize. It is assumed to be a list (or a set) of polynomials with coefficients in a field K and with variables from a set X. Typically, the field K is the set of the rational numbers. Call R the set of the polynomials with coefficients in K and variables in X. The set X is assumed to be totally ordered. Hence, when looking at a non-constant polynomial p of R, one can talk about its main (or greatest) variable, say v, and the leading coefficient of p with respect to v, called the initial of p.

• 

Now we can describe the shape of a regular chain by defining a more general concept, sometimes called an ascending chain or a triangular set. A finite set T of non-constant polynomials of R is a triangular set if two different polynomials of T have different main variables. For example, if X consists of the two variables x and y such that y<x holds, then xy+1&comma;y2+1 is a triangular set, whereas xy+1&comma;y2x is not. In broad words, a triangular set is a system of algebraic equations that is ready to be solved by evaluating the unknowns one after the other, just like a triangular linear system. However, there is a difference with the linear case: the back solving process may lead to some degenerated situation, or even to no solutions. Consider for example, for y<x, the triangular set yx1&comma;y2y. The value y=1 leads to x=1, but the value y=0 does not lead to a value of x. In broad words, regular chains are a particular kind of triangular sets for which the back solving process succeeds in every case. A precise definition of a regular chain is given below, just before the examples.

• 

Regular chains have many interesting computational properties. One property is that it is very convenient to perform computations modulo a set of relations given by a regular chain. The set of relations that is naturally associated with a regular chain is called its saturated ideal. This concept is defined precisely below, just before the examples. When the regular chain T has as many polynomials as variables in X, then its saturated ideal is simply the ideal generated by T.  The operations NormalForm and SparsePseudoRemainder are used intensively for computing modulo regular chains: they are used to simplify a polynomial with respect to a regular chain.

• 

In addition to its main functions Triangularize and RealTriangularize, and its subpackages ChainTools, MatrixTools, ConstructibleSetTools, ParametricSystemTools, SemiAlgebraicSetTools, FastArithmeticTools, and AlgebraicGeometryTools, the RegularChains package provides basic commands for computing with polynomials and regular chains. The commands PolynomialRing, DisplayPolynomialRing, MainVariable, Initial, MainDegree, Rank, Tail, and Separant allow the user to manipulate polynomials in the context of regular chains. The commands Equations and Inequations allow the user to inspect a regular chain. The commands RegularGcd, ExtendedRegularGcd, Inverse, IsRegular, RegularizeInitial, NormalForm, SparsePseudoRemainder, and MatrixCombine provide computations modulo regular chains.  SuggestVariableOrder attempts to provide an optimal order of variables for speeding up the decomposition of polynomial systems.

• 

The commands Display and Info allow the user to print the different types of objects that the RegularChains package. The former is a raw printer which gives direct access to the object encoding. The latter is a pretty printer.

• 

In addition to RealTriangularize, the commands LazyRealTriangularize and SamplePoints are alternative ways to obtain information on the real solutions of polynomial systems. These two commands solve partially their input system and can return their result much faster than RealTriangularize. In addition, LazyRealTriangularize can be used as an interactive solver, which can be helpful with difficult problems.

• 

Similarly, the command Intersect can be used to solve systems of polynomial equations incrementally (that is, one equation after another) and thus interactively. Therefore, it is also a useful command in complement to Triangularize.

List of the RegularChains Package Commands

  

The following is a list of available top-level commands.

AlgebraicGeometryTools

ChainTools

ConstructibleSetTools

Display

DisplayPolynomialRing

Equations

ExtendedRegularGcd

FastArithmeticTools

Inequations

Info

Initial

Intersect

Inverse

IsRegular

LazyRealTriangularize

MainDegree

MainVariable

MatrixCombine

MatrixTools

NormalForm

ParametricSystemTools

PolynomialRing

Rank

RealTriangularize

RegularGcd

RegularizeInitial

SamplePoints

SemiAlgebraicSetTools

Separant

SparsePseudoRemainder

SuggestVariableOrder

Tail

Triangularize

 

 

 

  

To display the help page for a particular RegularChains command, see Getting Help with a Command in a Package.

  

See the appropriate subpackage help page for a list of commands in the ChainTools, ConstructibleSetTools, FastArithmeticTools, MatrixTools, ParametricSystemTools, SemiAlgebraicSetTools, and AlgebraicGeometryTools subpackages.

  

The RegularChains example worksheet provides an overview of each of the subpackages.

List of RegularChains Subpackages

• 

The MatrixTools subpackage provides commands for solving linear systems of equations modulo the saturated ideal of a regular chain. Among other operations are computations of matrix inverses and lower echelon forms. These commands are considered here in a non-standard context. Indeed, the coefficients of these matrices are polynomials and the computations are performed modulo (the saturated ideal of) a regular chain. Since this latter is not required to be a prime ideal, the commands of this subpackage allow you to do linear algebra computations over non-integral domains.

• 

The ConstructibleSetTools subpackage provides a large set of commands for manipulating constructible sets. Constructible sets are the fundamental objects of Algebraic Geometry, and they play there the role that ideals play in Polynomial Algebra. In broad terms, a constructible set is the solution set of a system of polynomial equations and inequations. Constructible sets appear naturally in many questions, from high-school problems to advanced research topics.

• 

The SemiAlgebraicSetTools subpackage contains a collection of commands for isolating and counting real roots of zero-dimensional semi-algebraic systems or regular chains (that is regular chains with a finite number of complex solutions). It also offers various commands for studying the real solutions of polynomial systems of positive dimension or with parameters. In particular, commands for real root classification, cylindrical algebraic decomposition and partial cylindrical algebraic decomposition sampling are available. Several inspection functions on semi-algebraic systems and their solution sets (namely, semi-algebraic sets) are also provided. They are intended to support the commands RealRootClassification, RealTriangularize and LazyRealTriangularize.

• 

The ParametricSystemTools subpackage provides commands for solving systems of equations that depend on parameters. Given a parametric polynomial system F, this subpackage can be used to answer questions such as: for which values of the parameters does F have solutions? finitely many solutions? N  real solutions, for a given N?

• 

The ChainTools subpackage provides advanced operations on regular chains. Most of these commands allow you to inspect, construct and transform regular chains, or to check the properties of a polynomial with respect to a regular chain. Some commands operate transformations on a set of regular chains; they can be used to analyze the results computed by the command Triangularize.

• 

The FastArithmeticTools subpackage contains a collection of commands for computing with regular chains in prime characteristic using asymptotically fast algorithms. Most of the underlying polynomial arithmetic is performed at C level and relies on (multi-dimensional) Fast Fourier Transform (FFT). This imposes some constraints on the characteristic. One of the main purposes of this subpackage is to offer efficient basic routines in order to support the implementation of modular algorithms for computing with regular chains and algebraic numbers.

• 

The AlgebraicGeometryTools subpackage contains a collection of commands for manipulating algebraic curves, surfaces and algebraic sets of higher dimension. The commands currently available mainly focus on computing the limit of a family of sets like limits of a family of secants in the case of tangent cone computation.

Mathematical Definitions

  

Here is a precise definition of a regular chain and its saturated ideal.

  

First, recall that a non-zero element h of a ring R is called regular if h is not a zero-divisor; that is, for every f of R, if the product f*h is null, then f is null.

  

Now, let T be a triangular set. We define by induction what it means for T to be a regular chain. Also, we define the saturated ideal of T. If T is empty, then it is a regular chain and its saturated ideal is the trivial ideal (the ideal consisting only of zero). Assume now that T is not empty. Let p be the polynomial of T with greatest main variable and let C be the set of the other polynomials in T. If C is a regular chain with saturated ideal I, and if the initial h of p is regular with respect to I, then T is a regular chain. In addition, the saturated ideal of T is the set of the polynomials g such that there exists a power h^e of h such that h^e * g belongs to the ideal generated by I and p. An important property of a regular chain T is that a polynomial f belongs to the saturated ideal of T if and only if f reduces to zero by pseudo-division with respect to T. The pseudo-division of a polynomial with respect to a regular chain is implemented by the command SparsePseudoRemainder.

  

It follows from the previous definition that a set consisting of a single polynomial p is a regular chain whose saturated ideal is the ideal generated by the primitive part of p regarded as a univariate polynomial in its main variable.

  

Let T be a triangular set consisting of two polynomials p and q such that q is univariate in y and p is bivariate in x and y. Let h be the initial of p. Then T is a regular chain if the GCD of q and h is 1. This second example generalizes to regular chains with more than two variables or more than two polynomials. Verifying that a triangular set is a regular chain can be made by means of GCD computations.

  

These GCD computations take as input two polynomials p1 and p2 with the same main variable v and a regular chain T. Since these GCD computations rely on division (or pseudo-division), the initial of the intermediate remainders (or pseudo-remainders) must be regular modulo the saturated ideal of T. As a consequence, the input polynomials p1 and p2 are required to have regular initials, and the output polynomial, if it has main variable v, also has an initial regular with respect to T. This explains the name of the command RegularGcd. You can check that the input polynomials are valid input by calling IsRegular on their initials. If one of the initials of the input polynomials p1 and p2 is not regular with respect to (the saturated ideal of) T, then you can split T into several regular chains T1,...,Ts such that RegularGcd can be called on p1 and p2 for each of T1,...,Ts. This splitting is obtained by using the RegularizeInitial command on p1 and p2.

  

Let K be a field and let R a polynomial ring over K obtained by the command PolynomialRing. When R has no parameters, the field K can be Q, the field of rational numbers, or a prime field. When R has parameters, the field K is a field of rational functions. For a set (or a list) F of polynomials of R, the command Triangularize computes the common roots of F in an algebraically closed field L containing K. If K is Q, then one can think of L as the field of the complex numbers. The command Triangularize returns a list of regular chains C1,...,Cs, which is called a triangular decomposition of the common roots of F.

  

There are two possible relations between the common roots of F and the regular chains C1, ...,Cs, leading to two notions of a triangular decomposition.

  

We say that C1, ...,Cs is a triangular decomposition of F in the sense of Kalkbrener if the following holds: a point is a root of F if and only if it is a root of one of the saturated ideals of C1,...,Cs.

  

To introduce the other notion of a triangular decomposition, we need a definition. A point P is a root of a regular chain T if P cancels every polynomial of T but does not cancel any of the initials of the polynomials of T. The commands Equations and Inequations applied to T return the list of its polynomials and the list of their initials, respectively.

  

We say that C1,...,Cs is a triangular decomposition of F in the sense of Lazard if the following holds: a point is a root of F if and only if it is a root of one of the regular chains C1,...,Cs. A triangular decomposition in the sense of Lazard is in particular a triangular decomposition in the sense of Kalkbrener. But the converse is false.

  

The command Triangularize is capable of computing both kinds of triangular decompositions. This is achieved by means of options. By default, the sense of Kalkbrener is used. The command Triangularize admits other options that allow the user to control the properties of the computed regular chains. One important property is that of being strongly normalized; see ChainTools for the definition of this notion. Indeed, if T is a strongly normalized regular chain, then you can compute the NormalForm of a polynomial with respect to T.

  

An irreducible univariate polynomial over K defines both a field extension of K and a regular chain. More generally, let L1 be a direct product of fields, and let p be a univariate polynomial over L1 that generates a radical ideal; then p defines an extension L2 of L1 which is another direct product of fields. It turns out that regular chains are a way to encode extensions of fields or extensions of direct products of fields. This idea is central to the algorithms that the commands IsRegular, Inverse, RegularizeInitial, RegularGcd, and ExtendedRegularGcd implement. The fact that direct products of fields admit zero-divisors is handled by the celebrated D5 principle, which allows us to extend algorithms working fields to direct products of fields.

  

The theory of regular chains is based on a recursive and univariate vision of polynomials which reduces computations with multivariate polynomials to series of computations with univariate polynomials. The commands MainVariable, Initial, MainDegree, Rank, Tail, and Separant are the basic operations in this recursive and univariate vision of multivariate polynomials.

Examples

Presented here is an overview of the RegularChains library by means of a series of examples. The first ones are for non-experts in symbolic computations, whereas the last ones require some familiarity with this area.

Solving polynomial systems by means of regular chains

  

The first example shows how the RegularChains library can solve systems of algebraic equations symbolically. Start by loading the library.

withRegularChains&colon;withChainTools&colon;withMatrixTools&colon;

  

First, define the ring of the polynomials of the system to be solved. Indeed, most operations of the RegularChains library require such a polynomial ring as a parameter. This is how to specify the variable ordering. See PolynomialRing for more details.

RPolynomialRingx&comma;y&comma;z

Rpolynomial_ring

(1)
  

Define a set of polynomials of R.

sysx+y+z21&comma;x+y2+z1&comma;x2+y+z1

sysz2+x+y1&comma;y2+x+z1&comma;x2+y+z1

(2)
  

Ideally, we would like to decompose the solutions of this system into a list of points. In broad terms, this is what the command Triangularize does. However, some of these points are grouped because they share some properties. These groups are described by regular chains.

decTriangularizesys&comma;R

decregular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain

(3)
  

Because these points may involve large expressions, you need to ask to see them! The command Equations displays the list of polynomials of a regular chain.

mapEquations&comma;dec&comma;R

xz&comma;yz&comma;z2+2z1&comma;x&comma;y&comma;z1&comma;x&comma;y1&comma;z&comma;x1&comma;y&comma;z

(4)
  

The last three regular chains are very simple: each of them clearly corresponds to a point in the space. Have a closer look at the first one. The polynomial in z has two solutions. To each of them corresponds a point in the space. You can retrieve these five points by using the solve command.

solvesys

x=0&comma;y=0&comma;z=1&comma;x=0&comma;y=1&comma;z=0&comma;x=1&comma;y=0&comma;z=0&comma;x=RootOf_Z2+2_Z1&comma;y=RootOf_Z2+2_Z1&comma;z=RootOf_Z2+2_Z1

(5)
  

Consider again the regular chain above that corresponds to two points. Since these two points are grouped together, you can check whether each of them is a solution of the input system. This can be achieved by means of the command IsInRadical from the ChainTools subpackage by using the following fact: a regular chain T encodes a subset of the solution set of the input system S if and only if every polynomial of S belongs to the radical of the saturated ideal of T.

seqIsInSaturatesysi&comma;dec1&comma;R&comma;i=1..nopssys

true,true,true

(6)
  

Note that Triangularize can also take inequations among its input. Below, impose the condition that x must be different from z.

decnTriangularizesys&comma;xz&comma;R&semi;mapEquations&comma;decn&comma;R

decnregular_chain&comma;regular_chain

x1&comma;y&comma;z&comma;x&comma;y&comma;z1

(7)
  

Observe that two points from the original decomposition have been removed.

  

If you are solving with the lazard option, then the output is a constructible set, rather than a list of regular chains. Such a distinction matters, if the input system is in positive dimension.

csTriangularizeop1..2&comma;sys&comma;xz&comma;R&comma;output=lazard&semi;Infocs&comma;R

csconstructible_set

x+z2+z1&comma;yz&comma;z2+2z1,x+z2z&comma;y+z1&comma;z

(8)

decnTriangularizeop1..2&comma;sys&comma;xz&comma;R&semi;mapEquations&comma;decn&comma;R

decnregular_chain&comma;regular_chain

x+z2+z1&comma;yz&comma;x+z2z&comma;y+z1

(9)
  

By default, Triangularize gives generic solutions. With the lazard option, it outputs all solutions, which generally form a constructible set.

Computing inverses modulo a regular chain

  

The second example illustrates an important feature of the RegularChains library: computations modulo a regular chain. To do so, consider a second system.

sysx2y+3x+2&comma;x8+yx2+x+z&comma;x2yx+z

sysx2y+3x+2&comma;x2xy+z&comma;x8+x2y+x+z

(10)

decTriangularizesys&comma;R

decregular_chain

(11)
  

The solution computed by the Triangularize command consists of a single regular chain. In this polynomial ring, the variable ordering makes x&gt;y&gt;z. This means that the x-coordinate of each point must be expressed in terms of y and z, and the y-coordinate as a function of z.

rcdec1

rcregular_chain

(12)

pzPolynomialz&comma;rc&comma;R

pzz9+22z8+208z7+1126z6+3834z5+8136z4+9053z3224z214055z13302

(13)

pyPolynomialy&comma;rc&comma;R

py4yz63z7+16yz5+6z6+42yz4+426z5+742yz3+3177z4+4056yz2+11093z3+9416yz+21282z2+10056y+21096z+5832

(14)

pxPolynomialx&comma;rc&comma;R

pxxy2yz+3x+2

(15)
  

The polynomial py gives y as a rational function in z. You may ask if you could express y as a polynomial function in z. In other words, can we replace py by a polynomial with 1 as its Initial? Indeed, the polynomial in z defines a field extension K of the field Q of the rational numbers. In the field K, you can compute the Inverse of the initial of py.

newrcUndery&comma;rc&comma;R&semi;Equationsnewrc&comma;R

newrcregular_chain

z9+22z8+208z7+1126z6+3834z5+8136z4+9053z3224z214055z13302

(16)

lcyInitialpy&comma;R&semi;ilcyInverselcy&comma;newrc&comma;R

lcy4z6+16z5+42z4+742z3+4056z2+9416z+10056

ilcy43056952878224602831649z8+851556715329089933233928z7+6829798380079214157184280z6+28121353959653668128495638z5+58395516864169985401373466z4+31177496499998617409832000z3118245600582993390444999143z2157661907907876621441394914z+143594593667712002746022313&comma;100270485333918213150443394312&comma;regular_chain&comma;

(17)

nilcyilcy111&semi;dilcyilcy112

nilcy43056952878224602831649z8+851556715329089933233928z7+6829798380079214157184280z6+28121353959653668128495638z5+58395516864169985401373466z4+31177496499998617409832000z3118245600582993390444999143z2157661907907876621441394914z+143594593667712002746022313

dilcy100270485333918213150443394312

(18)
  

The help page for Inverse explains how to read the output of this command. In this example, this output means that the inverse of lcy is a fraction with numerator nilcy and denominator dilcy. To check that ilcy is the inverse of lcy modulo newrc, use the command NormalForm to simplify the product nilcy*lcy. Regular chains have a notion of normal form attached to them, just like Groebner bases.

NormalFormnilcylcy&comma;newrc&comma;R

100270485333918213150443394312

(19)
  

You obtain dilcy as expected. Now you can make the polynomial py look better by multiplying it by ilcy and removing its content.

newpyNormalFormnilcypy&comma;newrc&comma;R&colon;cnewpycontentnewpy

cnewpy8391661701681509748

(20)

newpynewpycnewpy

newpy31071832z8+559158565z7+4309096681z6+19396993429z5+54553636695z4+88747638462z3+54918900470z2+11948823594y78024336215z156442784340

(21)
  

The same treatment can be applied to the polynomial px.

newrcChainnewpy&comma;newrc&comma;R&semi;Equationsnewrc&comma;R

newrcregular_chain

11948823594y+31071832z8+559158565z7+4309096681z6+19396993429z5+54553636695z4+88747638462z3+54918900470z278024336215z156442784340&comma;z9+22z8+208z7+1126z6+3834z5+8136z4+9053z3224z214055z13302

(22)

lcxInitialpx&comma;R&semi;ilcxInverselcx&comma;newrc&comma;R

lcxy2+3

ilcx336484613006303z86472881536029244z752074812760151232z6233680431492813710z5628167256520883558z4914048962864580664z3280077377390474863z2+1137261498645304126z+1492395674188006257&comma;822063553694174988&comma;regular_chain&comma;

(23)

nilcxilcx111&semi;dilcxilcx112

nilcx336484613006303z86472881536029244z752074812760151232z6233680431492813710z5628167256520883558z4914048962864580664z3280077377390474863z2+1137261498645304126z+1492395674188006257

dilcx822063553694174988

(24)

newpxNormalFormnilcxpx&comma;newrc&comma;R&semi;cnewpxcontentnewpx

newpx1173512875760890z823382929946795160z7192607789095942472z6872326306307566684z52350486446974102010z43377744504245671336z3867887371605727550z2+822063553694174988x+4280831462806439198z+5386815096525691500

cnewpx68798702

(25)

newpxnewpxcnewpx

newpx17057195z8339874580z72799584636z612679400642z534164691755z449096049868z312614880025z2+11948823594x+62222561449z+78298208250

(26)
  

Then you obtain a new regular newrc chain which encodes the same solution set as rc.

newrcChainnewpx&comma;newrc&comma;R

newrcregular_chain

(27)

polysEquationsrc&comma;R

polysy2+3xyz+2&comma;4z6+16z5+42z4+742z3+4056z2+9416z+10056y3z7+6z6+426z5+3177z4+11093z3+21282z2+21096z+5832&comma;z9+22z8+208z7+1126z6+3834z5+8136z4+9053z3224z214055z13302

(28)

newpolysEquationsnewrc&comma;R

newpolys11948823594x17057195z8339874580z72799584636z612679400642z534164691755z449096049868z312614880025z2+62222561449z+78298208250&comma;11948823594y+31071832z8+559158565z7+4309096681z6+19396993429z5+54553636695z4+88747638462z3+54918900470z278024336215z156442784340&comma;z9+22z8+208z7+1126z6+3834z5+8136z4+9053z3224z214055z13302

(29)

seqIsInSaturatepolysi&comma;newrc&comma;R&comma;i=1..nopspolys

true,true,true

(30)

seqIsInSaturatenewpolysi&comma;rc&comma;R&comma;i=1..nopsnewpolys

true,true,true

(31)
  

This new regular newrc has an additional property with respect to rc: it is strongly normalized. See IsStronglyNormalized for the definition of strongly normalized. Being strongly normalized is a requirement in order to use the command NormalForm.

  

You could have obtained this regular chain from the input system by using an option of Triangularize.

decnTriangularizesys&comma;R&comma;normalized=yes

decnregular_chain

(32)

mapEquations&comma;decn&comma;R

11948823594x17057195z8339874580z72799584636z612679400642z534164691755z449096049868z312614880025z2+62222561449z+78298208250&comma;11948823594y+31071832z8+559158565z7+4309096681z6+19396993429z5+54553636695z4+88747638462z3+54918900470z278024336215z156442784340&comma;z9+22z8+208z7+1126z6+3834z5+8136z4+9053z3224z214055z13302

(33)
  

The Triangularize command does not always return the normalized decomposition so that it can handle the most general cases, including very large examples. Indeed, observe that the first regular chain rc has smaller coefficients than the strongly normalized regular chain newrc.

Automatic case discussion

  

The next example shows that RegularChains can handle automatic case discussion. Start by trying to answer the following question. Why does the above output of Inverse look complicated? Because RegularChains can handle automatic case discussion! To illustrate this, consider two variables y and z; assume that they are solutions of the regular chain below.

RPolynomialRingy&comma;z

Rpolynomial_ring

(34)

rcEmptyR

rcregular_chain

(35)

rcChainz4+1&comma;y2z2&comma;rc&comma;R&colon;

Equationsrc&comma;R

y2z2&comma;z4+1

(36)
  

Compute the inverse of the following matrix modulo the relations of the regular chain rc.

mMatrix1&comma;y+z&comma;0&comma;yz

m1y+z0yz

(37)
  

Clearly, the result depends on whether y and z are equal or not.

mimMatrixInversem&comma;rc&comma;R

mim100z32&comma;regular_chain&comma;noInv&comma;1y+z0yz&comma;regular_chain

(38)
  

Check the first result.

m1mim111

m1100z32

(39)

rc1mim112

rc1regular_chain

(40)

Equationsrc1&comma;R

y+z&comma;z4+1

(41)

MatrixMultiplym1&comma;m&comma;rc1&comma;R

1001

(42)
  

Consider now the other matrix.

mMatrix1&comma;y+z&comma;2&comma;yz

m1y+z2yz

(43)

mimMatrixInversem&comma;rc&comma;R

mim10z3z32&comma;regular_chain&comma;012z32z34&comma;regular_chain&comma;

(44)
  

Double check.

m1mim111

m110z3z32

(45)

rc1mim112

rc1regular_chain

(46)

m2mim121

m2012z32z34

(47)

rc2mim122

rc2regular_chain

(48)

MatrixMultiplym2&comma;m&comma;rc2&comma;R

1001

(49)

MatrixMultiplym2&comma;m&comma;rc2&comma;R

1001

(50)
  

Can you get a "generic" answer that would hold both cases? Yes, you can.

clrMatrixCombinerc1&comma;rc2&comma;R&comma;m1&comma;m2

clryz32+12yz34+1414yz234z318yz2+38z3&comma;regular_chain

(51)
  

Check.

MatrixMultiplyclr11&comma;m&comma;clr12&comma;R

1001

(52)

Recombining the results from a case discussion

  

The overview of the RegularChains library continues with more advanced examples, extending on the topic of automatic case discussion.

  

Can you have several cases in the output of MatrixCombine? Yes, this can happen. Reuse the first polynomial system above.

RPolynomialRingx&comma;y&comma;z

Rpolynomial_ring

(53)

sysx+y+z21&comma;x+y2+z1&comma;x2+y+z1

sysz2+x+y1&comma;y2+x+z1&comma;x2+y+z1

(54)

lrcTriangularizesys&comma;R&comma;normalized=yes&semi;mapEquations&comma;lrc&comma;R

lrcregular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain

xz&comma;yz&comma;z2+2z1&comma;x&comma;y&comma;z1&comma;x&comma;y1&comma;z&comma;x1&comma;y&comma;z

(55)
  

Generate four random matrices.

randomize4869257127&colon;

lmseqMatrixseqseqrandpolyx&comma;y&comma;z&comma;degree=1&comma;j=1..2&comma;i=1..2&comma;k=1..4

lm40x+17y+49z+759x+71y+22z+6879x+26y35z+2148x80y32z85&comma;78x35y+50z2632x+47y+32z+6934x+58y8z6398x+84y71z+38&comma;49x56y+36z+498x+46y43z+7980xy+49z1452x+5y46z+1&comma;29x+65y+7z2229x12y31z+2550x5y+28z+334x+82y96z48

(56)
  

Now ask for the re-combination of the four cases.

clrMatrixCombinelrc&comma;R&comma;lm

clr59y+771y+5468y+5388y82&comma;regular_chain&comma;1572z251z+3072512z2+33z+187281z292z+102106z2+52z191&comma;regular_chain

(57)
  

It turns out that you cannot obtain a unique case. This is surprising, since the saturated ideals of the four regular chains are pairwise relatively prime.

  

Check why the re-combination into a single regular chain is not possible.

rc1clr12

rc1regular_chain

(58)

Equationsrc1&comma;R

x+y1&comma;y2y&comma;z

(59)

rc2clr22

rc2regular_chain

(60)

Equationsrc2&comma;R

2x+z21&comma;2y+z21&comma;z3+z23z+1

(61)
  

The two ideals generated by rc1 and rc2 are obviously relatively prime (no common roots in z). But if you try to recombine them, you create a polynomial qy in y with a zero-divisor as initial; this is forbidden by the properties of a regular chain. Construct the polynomial qy and check if its initial is a zero-divisor.

RzPolynomialRingz

Rzpolynomial_ring

(62)

rcEmptyRz

rcregular_chain

(63)

rc1Chainz&comma;rc&comma;Rz

rc1regular_chain

(64)

rc2Chainz3+z23z+1&comma;rc&comma;Rz

rc2regular_chain

(65)

m1Matrixy2y

m1y2y

(66)

m2Matrix2y+z21

m22y+z21

(67)

clrMatrixCombinerc1&comma;rc2&comma;Rz&comma;m1&comma;m2&semi;mclr11

clry2z3+y2z23yz33y2z3yz2+z3+y2+9yz+2z2y3z&comma;regular_chain

my2z3+y2z23yz33y2z3yz2+z3+y2+9yz+2z2y3z

(68)

rcclr12&semi;qym1,1

rcregular_chain

qyy2z3+y2z23yz33y2z3yz2+z3+y2+9yz+2z2y3z

(69)

InverseInitialqy&comma;R&comma;rc&comma;Rz

1&comma;1&comma;regular_chain&comma;regular_chain&comma;regular_chain

(70)

Solving systems with an infinite number of solutions

  

The next example in the overview of RegularChains is a second round for experts. All previous automatic case discussions involve discussions with algebraic numbers only. Can the RegularChains library handle automatic case discussion with parameters? Yes, this is possible.  Consider the following system.

RPolynomialRingx&comma;y&comma;a&comma;b&comma;c&comma;d&comma;g&comma;h

Rpolynomial_ring

(71)

sysax+byg&comma;cx+dyh

sysax+byg&comma;cx+dyh

(72)
  

This new system has a property that the previous examples do not have. Clearly, this new system has an infinite number of solutions, if we view its 8 variables as unknowns. There are two ways of solving such systems. First, by describing its generic solutions, which is done by computing a triangular decomposition in the sense of Kalkbrener.

decTriangularizesys&comma;R&semi;mapEquations&comma;dec&comma;R

decregular_chain

cx+ydh&comma;adbcyah+cg

(73)
  

Computing triangular decompositions in the sense of Kalkbrener is the default mode of Triangularize. Observe that the output does not provide explicitly the solutions of the system that cancel the determinant adbc. Now compute all the solutions (generic or not); that is, find a triangular decomposition in the sense of Lazard.

decTriangularizesys&comma;R&comma;output=lazard

decregular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain

(74)

mapEquations&comma;dec&comma;R&semi;mapInequations&comma;dec&comma;R

cx+dyh&comma;dabcyha+cg&comma;cx+dyh&comma;dabc&comma;hbdg&comma;ax+byg&comma;dyh&comma;c&comma;dyh&comma;a&comma;hbdg&comma;c&comma;cxh&comma;hacg&comma;b&comma;d&comma;ax+byg&comma;c&comma;d&comma;h&comma;cx+dy&comma;dabc&comma;g&comma;h&comma;byg&comma;a&comma;c&comma;d&comma;h&comma;y&comma;a&comma;c&comma;g&comma;h&comma;x&comma;b&comma;d&comma;g&comma;h&comma;a&comma;b&comma;c&comma;d&comma;g&comma;h

c&comma;dabc&comma;c&comma;d&comma;h&comma;a&comma;d&comma;d&comma;h&comma;c&comma;h&comma;a&comma;c&comma;d&comma;b&comma;&comma;&comma;

(75)

seqeq=Equationsdeci&comma;R&comma;ineq=Inequationsdeci&comma;R&comma;i=1..nopsdec

eq=cx+dyh&comma;dabcyha+cg&comma;ineq=c&comma;dabc&comma;eq=cx+dyh&comma;dabc&comma;hbdg&comma;ineq=c&comma;d&comma;h&comma;eq=ax+byg&comma;dyh&comma;c&comma;ineq=a&comma;d&comma;eq=dyh&comma;a&comma;hbdg&comma;c&comma;ineq=d&comma;h&comma;eq=cxh&comma;hacg&comma;b&comma;d&comma;ineq=c&comma;h&comma;eq=ax+byg&comma;c&comma;d&comma;h&comma;ineq=a&comma;eq=cx+dy&comma;dabc&comma;g&comma;h&comma;ineq=c&comma;d&comma;eq=byg&comma;a&comma;c&comma;d&comma;h&comma;ineq=b&comma;eq=y&comma;a&comma;c&comma;g&comma;h&comma;ineq=&comma;eq=x&comma;b&comma;d&comma;g&comma;h&comma;ineq=&comma;eq=a&comma;b&comma;c&comma;d&comma;g&comma;h&comma;ineq=

(76)
  

By defining the PolynomialRing correctly, you find that Triangularize can solve polynomial systems with parameters.

R2PolynomialRingx&comma;y&comma;a&comma;b&comma;c&comma;d&comma;g&comma;h

R2polynomial_ring

(77)

decTriangularizesys&comma;R2&comma;output=lazard

decregular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain

(78)

seqeq=Equationsdeci&comma;R2&comma;ineq=Inequationsdeci&comma;R2&comma;i=1..nopsdec

eq=cx+dyh&comma;dabcyha+cg&comma;ineq=c&comma;dabc&comma;eq=cx+dyh&comma;dabc&comma;hbdg&comma;ineq=c&comma;d&comma;eq=ax+ybg&comma;dyh&comma;c&comma;ineq=a&comma;d&comma;eq=dyh&comma;a&comma;hbdg&comma;c&comma;ineq=d&comma;eq=cxh&comma;hacg&comma;b&comma;d&comma;ineq=c

(79)
  

Similarly, Triangularize can solve polynomial systems in prime characteristic.

R2PolynomialRingx&comma;y&comma;a&comma;b&comma;c&comma;d&comma;g&comma;h&comma;3

R2polynomial_ring

(80)

decTriangularizesys&comma;R2&comma;output=lazard

decregular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain&comma;regular_chain

(81)

seqeq=Equationsdeci&comma;R2&comma;ineq=Inequationsdeci&comma;R2&comma;i=1..nopsdec

eq=cx+dy+2h&comma;da+2bcy+2ha+cg&comma;ineq=c&comma;da+2bc&comma;eq=cx+dy+2h&comma;da+2bc&comma;hb+2dg&comma;ineq=c&comma;d&comma;eq=ax+yb+2g&comma;dy+2h&comma;c&comma;ineq=a&comma;d&comma;eq=dy+2h&comma;a&comma;hb+2dg&comma;c&comma;ineq=d&comma;eq=cx+2h&comma;ha+2cg&comma;b&comma;d&comma;ineq=c

(82)

Controlling the size of the coefficients

  

Solving systems of equations by means of regular chains can help reduce the size of the coefficients, even when no splitting arises.

  

In the example below, compare the size of the output of Triangularize with the lexicographical Groebner basis for the same variable ordering. Do not print this Groebner basis since it is quite large; print its size (number of characters) only.

RPolynomialRingx&comma;y&comma;z

Rpolynomial_ring

(83)

sys5y43&comma;20x+yz&comma;x5+y53y1

sys20x+yz&comma;5y43&comma;x5+y53y1

(84)

decTriangularizesys&comma;R&semi;mapEquations&comma;dec&comma;R&semi;nopsdec

decregular_chain

20xy+z&comma;4375z12+52800011625z8+32000000000z7+110591902080002925z4+61439980800000000z3+12800000000000000z2+56623117271041036800027y1875z139600010125z9+2000000000z87372714752004545z5+30720002400000000z4+12800000000000000z322118403456000135z+23592963686400144000000&comma;3125z209375z1640000000000z152015999988750z121560000000000z11+192000000000000000z1012165125356800006750z814745602232000000000z76528000000000000000z6409600000000000000000000z516986908639233347839997975z414155767152640302400000000z35898238732800000000000000z21228800000000000000000000z6195303619231982878732441600243

1

(85)

lengthconvertmapEquations&comma;dec&comma;R&comma;string

654

(86)

withGroebner&colon;

gbBasissys&comma;plexx&comma;y&comma;z&colon;lengthconvertgb&comma;string

8674

(87)
  

The commands below illustrate the fact that the RegularChains library provides tools to reduce the size of the coefficients of an output. To see this, use the previous system again, starting from a large output. Indeed, it turns out that for the above system, the lexicographical Groebner basis can be obtained also by using Triangularize with the option normalize=yes. This is because every strongly normalized regular chain T is a lexicographical Groebner basis over the field of the rational functions in the variables that are not algebraic in T. In this example, each variable IsAlgebraic in the output regular chain.

decTriangularizesys&comma;R&comma;normalized=yes

decregular_chain

(88)

lengthconvertmapEquations&comma;dec&comma;R&comma;string

8674

(89)
  

Then, the command DahanSchostTransform can be applied to reduce this large regular chain (which is also a lexicographical Groebner basis) into a smaller one.

dstDahanSchostTransformdec1&comma;R

dstregular_chain

(90)

lengthconvertEquationsdst&comma;R&comma;string

1533

(91)
  

Check that the two regular chains define the same (saturated) ideal by means of the command EqualSaturatedIdeals.

EqualSaturatedIdealsdec1&comma;dst&comma;R

true

(92)

Splitting for solving

  

In this library, almost every operation takes a regular chain as a parameter. A regular chain encodes a tower of simple extensions of the underlying field. This tower is a direct product of fields and may contain zero-divisors, so splitting may be needed.

RPolynomialRingx&comma;y&comma;z

Rpolynomial_ring

(93)

rcEmptyR

rcregular_chain

(94)

rcChainzz1&comma;rc&comma;R

rcregular_chain

(95)

p1zxx+1z1xx+2

p1zxx+1z1xx+2

(96)

p2zx1x+1z1x+3x+2

p2zx1x+1z1x+3x+2

(97)

expandp1

x2xz+2x

(98)

expandp2

x25xz+5x7z+6

(99)

RegularGcdp1&comma;p2&comma;x&comma;rc&comma;R

4z+3x7z+6&comma;regular_chain

(100)
  

As a consequence, every operation (taking a regular chain as a parameter) needs to manage tasks, where a task is [something-to-compute, a-regular-chain].

Manipulating Constructible Sets

  

This example demonstrates how to manipulate constructible sets, which usually encode the solution set of a polynomial system with both equations and inequations.

withConstructibleSetTools&colon;

RPolynomialRingx&comma;y&comma;s

Rpolynomial_ring

(101)
  

Define a polynomial system with equations F and inequations H.

Fsy+1x&comma;sx+1y&semi;Hs1

Fsy+1x&comma;sx+1y

Hs1

(102)
  

Use the GeneralConstruct command to create a constructible set cs to encode its solutions.

csGeneralConstructF&comma;H&comma;R

csconstructible_set

(103)
  

In the RegularChains library, cs is represented by a list of regular systems.

lrsRepresentingRegularSystemscs&comma;R

lrsregular_system&comma;regular_system

(104)
  

Each regular system is a pair consisting of a regular chain and an inequation given by one or more polynomials.

rslrs1

rsregular_system

(105)

rcRepresentingChainrs&comma;R

rcregular_chain

(106)

hRepresentingInequationsrs&comma;R

hs1

(107)
  

The library provides the basic set-theoretic operations on constructible sets, including complementation, union, intersection, difference, inclusion test, and more.

F2sy2+1x&comma;sx2+1y&semi;Hs1

F2sy2+1x&comma;sx2+1y

Hs1

(108)

cs2GeneralConstructF2&comma;H&comma;R

cs2constructible_set

(109)

Complementcs&comma;R

constructible_set

(110)

Unioncs&comma;cs2&comma;R

constructible_set

(111)

Intersectioncs&comma;cs2&comma;R

constructible_set

(112)

Differencecs&comma;cs2&comma;R

constructible_set

(113)

IsContainedcs&comma;cs2&comma;R

false

(114)
  

Besides these, some advanced operations are also provided. See ConstructibleSetTools for details.

Solving Parametric Polynomial Systems

  

This tour d'horizon concludes with an illustration of how to solve parametric polynomial systems with comprehensive triangular decomposition.

  

Let U be the last d variables of R, which are regarded as parameters. The output of ComprehensiveTriangularize(sys, d, R) consists of two parts. The first part is a pre-comprehensive triangular decomposition S of sys with respect to the last d variables of R.  The second part is a list L of pairs; the first item of each pair is a constructible set and the second item is a list of indices (positive integers) such that the union of these constructible sets forms a partition of the projection of Vsys onto the parameter space. Moreover, for each part (or cell) C, the list of positive integers associated with it gives the positions of the regular chains in S satisfying the following property: for each parameter value u in C, the associated regular chains specialized at u form a triangular decomposition of the input system sys specialized at u.

RPolynomialRingx&comma;y&comma;s

Rpolynomial_ring

(115)

Fsy+1x&comma;sx+1y