====================================================================
WuWenTsunTriangularSet examples
====================================================================

The WuWenTsunTriangularSet domain constructor implements the
characteristic set method of Wu Wen Tsun.  This algorithm computes a
list of triangular sets from a list of polynomials such that the
algebraic variety defined by the given list of polynomials decomposes
into the union of the regular-zero sets of the computed triangular
sets.  The constructor takes four arguments.  The first one, R, is the
coefficient ring of the polynomials; it must belong to the category
IntegralDomain. The second one, E, is the exponent monoid of the
polynomials; it must belong to the category OrderedAbelianMonoidSup.
The third one, V, is the ordered set of variables; it must belong to
the category OrderedSet.  The last one is the polynomial ring; it must
belong to the category RecursivePolynomialCategory(R,E,V).  The
abbreviation for WuWenTsunTriangularSet is WUTSET.

Let us illustrate the facilities by an example.

Define the coefficient ring.

  R := Integer
    Integer
                               Type: Domain

Define the list of variables,

  ls : List Symbol := [x,y,z,t]
    [x,y,z,t]
                               Type: List Symbol

and make it an ordered set;

  V := OVAR(ls)
    OrderedVariableList [x,y,z,t]
                               Type: Domain

then define the exponent monoid.

  E := IndexedExponents V
    IndexedExponents OrderedVariableList [x,y,z,t]
                               Type: Domain

Define the polynomial ring.

  P := NSMP(R, V)
    NewSparseMultivariatePolynomial(Integer,OrderedVariableList [x,y,z,t])
                               Type: Domain

Let the variables be polynomial.

  x: P := 'x
    x
       Type: NewSparseMultivariatePolynomial(Integer,
               OrderedVariableList [x,y,z,t])

  y: P := 'y
    y
       Type: NewSparseMultivariatePolynomial(Integer,
               OrderedVariableList [x,y,z,t])

  z: P := 'z
    z
       Type: NewSparseMultivariatePolynomial(Integer,
               OrderedVariableList [x,y,z,t])

  t: P := 't
    t
       Type: NewSparseMultivariatePolynomial(Integer,
               OrderedVariableList [x,y,z,t])

Now call the WuWenTsunTriangularSet domain constructor.

  T := WUTSET(R,E,V,P)
  WuWenTsunTriangularSet(Integer,IndexedExponents OrderedVariableList [x,y,z,t]
  ,OrderedVariableList [x,y,z,t],NewSparseMultivariatePolynomial(Integer,Ordere
  dVariableList [x,y,z,t]))
                               Type: Domain

Define a polynomial system.

  p1 := x ** 31 - x ** 6 - x - y
      31    6
     x   - x  - x - y
               Type: NewSparseMultivariatePolynomial(Integer,
                       OrderedVariableList [x,y,z,t])

  p2 := x ** 8  - z
      8
     x  - z
               Type: NewSparseMultivariatePolynomial(Integer,
                       OrderedVariableList [x,y,z,t])

  p3 := x ** 10 - t
      10
     x   - t
               Type: NewSparseMultivariatePolynomial(Integer,
                       OrderedVariableList [x,y,z,t])

  lp := [p1, p2, p3]
      31    6          8      10
    [x   - x  - x - y,x  - z,x   - t]
         Type: List NewSparseMultivariatePolynomial(Integer,
                      OrderedVariableList [x,y,z,t])

Compute a characteristic set of the system.

  characteristicSet(lp)$T
     5    4  4 2 2     3 4        7     4      6    6    3      3     3     3
   {z  - t ,t z y  + 2t z y + (- t  + 2t  - t)z  + t z,(t  - 1)z x - z y - t }
            Type: Union(WuWenTsunTriangularSet(Integer,
                          IndexedExponents OrderedVariableList [x,y,z,t],
                          OrderedVariableList [x,y,z,t],
                          NewSparseMultivariatePolynomial(Integer,
                            OrderedVariableList [x,y,z,t])),...)

Solve the system.

  zeroSetSplit(lp)$T
                3      5    4  3     3    2
  [{t,z,y,x}, {t  - 1,z  - t ,z y + t ,z x  - t},
     5    4  4 2 2     3 4        7     4      6    6    3      3     3     3
   {z  - t ,t z y  + 2t z y + (- t  + 2t  - t)z  + t z,(t  - 1)z x - z y - t }]
         Type: List WuWenTsunTriangularSet(Integer,
                      IndexedExponents OrderedVariableList [x,y,z,t],
                      OrderedVariableList [x,y,z,t],
                      NewSparseMultivariatePolynomial(Integer,
                         OrderedVariableList [x,y,z,t]))

The RegularTriangularSet and SquareFreeRegularTriangularSet domain 
constructors, the LazardSetSolvingPackage package constructors as well as, 
SquareFreeRegularTriangularSet and ZeroDimensionalSolvePackage package 
constructors also provide operations to compute triangular decompositions 
of algebraic varieties.  These five constructor use a special kind of
characteristic sets, called regular triangular sets.  These special
characteristic sets have better properties than the general ones.
Regular triangular sets and their related concepts are presented in
the paper "On the Theories of Triangular sets" By P. Aubry, D. Lazard
and M. Moreno Maza (to appear in the Journal of Symbolic Computation).
The decomposition algorithm (due to the third author) available in the
four above constructors provide generally better timings than the
characteristic set method.  In fact, the WUTSET constructor
remains interesting for the purpose of manipulating characteristic
sets whereas the other constructors are more convenient for solving
polynomial systems.

Note that the way of understanding triangular decompositions is detailed 
in the example of the RegularTriangularSet constructor.

See Also:
o )help RecursivePolynomialCategory
o )help RegularTriangularSet
o )help SquareFreeRegularTriangularSet
o )help LazardSetSolvingPackage
o )help ZeroDimensionalSolvePackage
o )show WuWenTsunTriangularSet

