% from 30.6.1992 hk
% user packages gb, dim, decomp, roots

\section{Gr\"obner Bases} %----------------------

Let $\R = \K\lbrack X_1, \ldots, X_n \rbrack$
be a commutative polynomial ring in $n \geq 0$ variables 
$X_1, \ldots, X_n$ over a field $\K$. 
Let $I$ be an ideal of $\R$ 
(a subset of $\R$ closed under addition and multiplication by 
arbitrary elements of $\R$). 
Ideals arise in the algebraic methods used for solving 
systems of multivariate non-linear (but polynomial) equations.

The first important problem in computational ideal theory 
is the {\em ideal membership problem}: 
\begin{quote}
       given $I \subseteq \R$ and $f \in \R$, is $f \in I$ $?$
\end{quote}
It is known by Hilbert's basis theorem, that any ideal $I$ in a 
polynomial ring over a field is finitely generated. 
So let $I$ be generated by $m \in \N$ polynomals $p_1, \ldots, p_m \in \R$,
notation $I = \ideal(p_1, \ldots, p_m)$. 
Then $f \in I$ means, that there exist polynomials 
$h_1, \ldots, h_m \in \R$, such that 
$$
  f = \sum_{i=1}^{m} h_i p_i.
$$
Then $f \in I$ can be decided, iff one can find the 
polynomials $h_1, \ldots, h_m$. 
In case $\R$ is a univariate polynomial ring or 
in case the generating polynomials of the ideal are all linear, 
the solution to this problem has been known since several 
hundered years and the methods are named after 
Euclid and Gauss. In the general case the solution method 
is named after Gr\"obner and an algorithm by Buchberger.
The solutions are as follows:
\begin{enumerate}
\item {\em univariate case}: 
      $\R = \K\lbrack X \rbrack$ is a so called euclidean domain, 
      i.e.\ there exists a division with remainder and 
      as a consequence every ideal is generated by exactly one element. 
      This element $p$ can be computed by means of the 
      euclidean algorithm, then $I = \ideal(p_1, \ldots, p_m) = \ideal(p)$.
      Then $f \in I$ iff $f = h p$ for some $h \in \R$, i.e.\ 
      $f \in I$ iff $p$ divides $f$, which solves the problem.
\item {\em linear case}: 
      If $f$ is linear and the $p_1, \ldots, p_m$ are linear too, 
      then by gaussian elimination it can be checked if 
      $f$ is a $\K$-linear combination of the $p_1, \ldots, p_m$.
      So the problem is again solved. 
\item {\em general case}: 
      The method is in some sense similar to the above two: 
      \begin{description}
      \item {\em first} transform the generating set for the 
            ideal to a suitable form, called Gr\"obner base, 
            by Buchberger's algorithm,
      \item {\em second} check if $f$ can be written as 
            polynomial combination of the elements 
            from the Gr\"obner base.
      \end{description}
      The second step can be computed by a form 
      of multi-polynomial division with remainder called 
      polynomial reduction and if $f$ reduces to zero, then $f \in I$. 
      The difficulty is that for arbitrary generating sets of ideals 
      the polynomial reduction does in general not reduce a polynomial 
      in the ideal to zero. Only for reduction with respect to 
      a Gr\"obner base the polynomial reduces to zero if it 
      is in the ideal.
\end{enumerate}
Once the ideal membership problem can be solved, many other 
problems in ideal theory can be solved by computational methods.
To define Gr\"obner bases more precisely we need some preparations 
about reduction relations. 

Let $\longrightarrow$ be a relation on $R$, 
(i.e.\ $\longrightarrow \subseteq R \times R$) 
then $\longrightarrow$ is called a 
{\em reduction relation} if it is 
a strictly anti-symmetric relation.
An element $a \in R$ is called {\em irreducible} 
if for all $b \in R$ 
$(a, b) \not\in \longrightarrow$.
A reduction relation $\longrightarrow$ is called {\em Noetherian} 
if there does not exist an infinite reduction sequence. 

Let $\longrightarrow$ be a reduction relation on $R$, 
then $\longrightarrow^*$ denotes the reflexive, transitive closure 
of $\longrightarrow$;
$\longleftrightarrow^*$ denotes the reflexive, transitive closure 
of the symmetric closure of $\longrightarrow$; 
for $f, g, h \in R$ $f \downarrow g$ denotes that $f$ and $g$ 
reduce to a common element, that is there exists $h$ with 
$f \longrightarrow^* h$ and $g \longrightarrow^* h$.
In this case $f \longleftrightarrow^* g$.

Reduction relations are in general not confluent; 
this means that two different reductions of the same 
element may lead to two different irreducible elements.
Let $\longrightarrow$ be a reduction relation on R, $a, b, c, d \in R$. 
Then $\longrightarrow$ is {\em confluent} if
$a \longrightarrow^* c$ and $a \longrightarrow^* d$
implies $c \downarrow d$; 
$\longrightarrow$ is {\em locally confluent} if
$a \longrightarrow c$ and $a \longrightarrow d$
implies $c \downarrow d$; 
$\longrightarrow$ has the {\em Church-Rosser property} if
$a \longleftrightarrow^* b$ 
implies $a \downarrow b$; 
$\longrightarrow$ has {\em unique normal forms} if
$a \longrightarrow^* b$, $a \longrightarrow^* c$ 
and $b$, $c$ are irreducible implies $b = c$.

Now Newmann's lemma tells us that for a 
{\em Noetherian} reduction relation $\longrightarrow$ on $R$, 
$\longrightarrow$ is confluent iff 
$\longrightarrow$ is locally confluent iff 
$\longrightarrow$ has unique normalforms. 

For polynomial ring $R = \K \lbrack X_1, \ldots, X_n \rbrack$, 
with respect to an admissible ordering $<$, over a field $\K$ a 
reduction relation can be defined as follows. 
Recall that a linear order $<$ on the set of terms 
$T = T(X_1, \ldots, X_n)$ is called admissible if 
\begin{enumerate}
\item $1 < t$ for all $t \in T$ and
\item $u < v$ implies that $u t < v t$ for all $u, v, t \in T$. 
\end{enumerate}
Recall that $\HT(f)$ denotes the highest term of $f$ with respect 
to the given term order $<$ and that $HC(f)$ denote the 
coefficient of $\HT(f)$ in $f$. 
Let $p \in R$, $t \in T$ and let $f, f' \in R$, $t \in T(f)$ then
$$
  f \longrightarrow_{t,p} f'
$$ 
iff there exists $u \in T$ such that $t = u \HT(p)$ and 
$$
  f' = f - a u p,
$$
where $a \in \K \setminus \{ 0 \}$ is the unique element of $\K$ 
such that $HC(f) = a HC(u p)$. 
Furthermore we define 
  $f \longrightarrow_p f'$ if
$f \longrightarrow_{t,p} f'$ for some $t$ in $T(f)$, 
and for a set $P$ of polynomials we define 
  $f \longrightarrow_P f'$ if for some $p \in P$, 
$f \longrightarrow_{p} f'$. 
By Dicksons lemma it can be shown, that the 
reduction relation $\longrightarrow_P$ is Noetherian for 
any $P \subset R$. 

Let $R = \K \lbrack X_1, \ldots, X_n \rbrack$ be a 
polynomial ring, with respect to an admissible ordering, over a field $\K$. 
Let $G \subset R$ be a finite subset of polynomials of $R$.
If the reduction relation $\longrightarrow_{G}$ 
is confluent, then $G$ is called a {\em Gr\"obner base}.

For the computation of a Gr\"obner base in finitely many steps we need 
one more definition. 
For $f, g \in R$, the S-polynomial of $f$ and $g$ is defined as 
$$
   SP(f,g) = a u f - b v g, 
$$
where $u, v \in T(X_1, \ldots, X_n)$ are defined 
such that $u \HT(f) = v \HT(g) = w$ with $w = lcm( \HT(f), \HT(g) )$ 
and $a, b \in \K$ are defined such that 
$HC(a u f) = HC(b v g)$. 
 
\begin{theorem}
Let $R = \K \lbrack X_1, \ldots, X_n \rbrack$ be a 
polynomial ring, with respect to an admissible 
ordering, over a field $\K$. 
Let $G \subset R$ be a finite subset of polynomials of $R$.
Then the following assertions are equivalent.
\begin{enumerate}
\item $G$ is a Gr\"obner base.
\item For all $f \in \ideal(G)$, $f \longrightarrow_{G}^* 0$. 
\item For all 
      $h \in H = \{ SP(f,g) \ : \ f, g \in G, f \neq g \}$,
      $h \longrightarrow_{G}^* 0$.
\end{enumerate}
\end{theorem}

Observe, that 3) is a finite condition whether an ideal base $G$ 
is a Gr\"obner base or not. And the main idea of the
Buchberger algorithm is, in case the test for a Gr\"obner base fails,
to adjoin a $\longrightarrow_{G}$ normalform of the S-polynomial 
to the base $G$ and to repeat the test. 
By a theorem we know, that for any finite $F \subset R$ of 
polynomials this repeated adjunction of normalforms of S-polynomials 
must eventualy terminate, so one can construct 
a Gr\"obner base $G$ of $\ideal(F)$. 
The proof of this theorem presents the 
Buchberger algorithm for constructing Gr\"obner bases.
\index{Buchberger algorithm}\index{algorithm! Buchberger} 
For a complete treatment of the theory of Gr\"obner bases see 
\cite{Becker93}. 

\subsection{Algorithms and Examples} %------------------

The algorithms for the computation of Gr\"obner bases are 
taken from the `The Buchberger Algorithm System', BAS 
as developed by \cite{GK83}.
Their implementation follows \cite{Winkler85} 
and contains various improvments to computing strategy and efficiency. 

The package contains also several subroutines which 
are of independent interest: S-polynomials, polynomial reduction 
and normalforms, irreducible sets, minimal Gr\"obner bases, 
optimization of termorderings, augmented computation of 
Gr\"obner bases, test for zero-dimensionality of ideals, 
construction of univariate polynomials of minimal degree in the ideal
and others.
There are also several packages which are buildt on top 
of the Gr\"obner base package or use it for precomputations: 
ideal dimension, zero-dimensional ideal decomposition, 
zero-dimensional ideal real root finding, syzygies and 
systems of linear polynomial equations and others.

The programs are mostly available for polynomials with 
rational, integer and arbitrary domain coefficients. 
\index{Gr\"obner base}\index{Buchberger algorithm}
\index{S-polynomial}\index{critical pairs}
The programs are contained in the Modula-2 libraries 
\verb/DIPRNGB/, \verb/DIPZ/, \verb/DIPTOO/, 
\verb/DIPIGB/ and \verb/DIPGB/. 

Examples for Gr\"obner base computations have been given in several 
sections (e.g.\ section \ref{dip.alg} or the next section).
%ex: min pol


\section{Ideal dimension} %----------

We quote from the introduction of 
\cite{KreW88} %----- kredel/texibm/dimens.tex -----
who developed the package. 
For a complete treatment of the theory and the extension of the 
method to arbitrary degree compatible term orders 
see \cite{Becker93}. 

Among the basic problems of the algorithmic theory of
polynomial ideals, the computation of the dimension
$dim(I)$ of an ideal $I$ in a polynomial ring
$\R = \K\lbrack X_1, \ldots, X_n \rbrack$
occupies a prominent place. The geometric definition of
$dim(I)$ as the maximal dimension of all isolated prime
ideals $J$ associated with $I$ is unfavourable
for computation, since it involves the primary
decomposition of $I$. Instead,
$dim(I)$ can be described more directly as the
largest number of elements in \R\ that are independent
modulo $I$ in a natural sense (see e.g.\ \cite{G12}) 
$$
  dim(I) = max\{ \ \vert U \vert \ : \ U \subset \{ X_1, \ldots, X_n \},
                 I \cap \K\lbrack U \rbrack = \{ 0 \} \  \}. 
$$
A third approach characterizes
$dim(I)$ as the degree of the Hilbert polynomial of
$I$, that can be computed from the vector space
dimension of the \K--linear spaces
$S_m = \lbrace f + I \, \vert \, deg(f) \le m \rbrace
\subseteq \R/I$.
 
This last characterization has been combined successfully with
the algorithmic technique of Gr\"obner bases introduced by
\cite{Buchb65}, see also \cite{MM83}.
The resulting algorithms are applicable to non-trivial cases.
The special problem to test whether
$dim(I) \le 0$ can be handled more easily by Buchberger's
criterion (Method 6.9 in \cite{Buchb85}).
 
The Gr\"obner basis method can also be combined with the
second characterization of $dim(I)$:
Consider all pure lexicographical orderings $<_L$ of terms in
\R\ induced by permutations of the variables $X_i$.
Compute a Gr\"obner base $G = G(<_L)$ of $I$
with respect to $<_L$, and let $S = S(<_L)$ be the largest
initial segment of the set of variables, such that no head term
of a polynomial in $G$ contains only variables from $S$.
Then each $S$ is independent modulo $I$ and the
largest $S$ determines the dimension of $I$.
(see \cite{KaR85}, compare also Lemma 5 in \cite{KS86}).
The advantage of this method is that it
determines besides $dim(I)$ also sets of variables independent
modulo $I$.  On the other hand, the number of Gr\"obner basis
calculations involved in this method renders it useless for practical
purposes in most cases.  Further related methods for computing the
dimension of a polynomial ideal appear in \cite{Giusti84} 
and \cite{CAF86}.
The application of resultant calculus to this problem
has been described in \cite{Kre85}.
 
The main algorithm of this package computes both the
dimension of $I$ and maximal independent sets of
variables modulo $I$ from a single Gr\"obner basis of $I$.
And the algorithm is verified to be correct in the case of a pure
lexicographical term order and a few other cases.
A recent theorem of \cite{CAF87}
implies that the algorithm is correct for an arbitrary admissible
term order.
The algorithm is significantly faster than the algorithms in \cite{MM83}
using the Hilbert polynomial.
It also provides considerable additional information on independent
sets and dimensions of isolated prime ideals associated with $I$. 
Thus, it is particulary suitable to the method of geometrical
theorem proving developed in \cite{KS86}.
It is also useful as a tool in the primary decomposition of $I$
(compare \cite{GTZ86} and also \cite{Kre87}).
The method provides parametrizations of affine algebraic sets.
Thus it may be helpful in determining the spatial structure
of molecules from algebraic equations describing this
structure. 
 
The verification of the algorithm employs the novel notion of
strong independence modulo an ideal $I$, a concept
that correlates well with Gr\"obner bases and may be
of independent interest.
The algorithm was first implemented in the ALDES/SAC-2 system 
by \cite{CoL80}
and has been tested successfully on substantial examples,
including those studied in \cite{BGK86}.


\subsection{Algorithms and Examples} %------------------

The specification of the main algorithm 
\verb/DILDIM/ is as follows. 
Given a Gr\"obner base $G$ of multivariate polynomials with
field coefficients, find the following
\begin{description} 
\item[$d =$] dimension $\ideal(G)$,
\item[$S =$] greatest maximal independent set of variables,
\item[$M =$] set of all maximal independent sets.
\end{description} 
The method is to compute strong independent sets of variables for 
the head terms of the polynomials in the Gr\"obner base 
as discussed in \cite{KreW88}.
\index{dimension}\index{independent sets}

The computed values are the dimension and strongly indepenedent 
sets in the case of the inverse lexicographical term order and in case 
of any total degree order. 
In case of a different term ordering the computed values are 
surely upper bounds for the dimension and independent sets.
It is however claimed by \cite{CAF87} that for all admissible 
term orders the dimension and independent sets are found in this way. 
If $G$ is not a Gr\"obner base the computed values are also
upper bounds.

The computation is valid for all coefficient domains 
since it depends only on the headterms of the polynomials.
The programs are contained in the Modula-2 library \verb/DIPDIM/. 

In the following example we compute first a Gr\"obner base of an 
ideal $I$ and then we determine the dimension of the ideal.
The input consists of a polynomial list in the usual 
syntax as described in section \ref{dip.alg} and 
then of the two statements `\verb/Q:=DIRPGB(P,1)/' and 
`\verb/DIMENSION(Q)/' which request 
the computation of the Gr\"obner base and the dimension respectively. 
The later program calls the `\verb/DILDIM/' routine and then prints 
the results to the current output stream.

{\footnotesize %-------------------------
\begin{verbatim}
     P:=PREAD(). 
 
     (A1,A2,A3,A4,X1,X2,X3,X4) L

     (
     ( X4 - ( A4 - A2 )),
     ( X1 + X2 + X3 + X4 - ( A1 + A3 + A4 )),
     ( X1 X3 + X1 X4 + X2 X3 + X3 X4 - ( A1 A4 + A1 A3 + A3 A4 )),
     ( X1 X3 X4 - ( A1 A3 A4 ))
     )

     PWRITE(P). 
     Q:=DIRPGB(P,1). 
     PWRITE(Q). 

     CLOUT("Computing Dimension ... "). 
     DIMENSION(Q).
\end{verbatim}
}

The following output shows first the computed Gr\"obner base and then 
the output of the dimension algorithm. 
The dimension turns out to be $4$ and a maximaly independent set 
of variables is `\verb/(A1,A2,A3,A4)/'. 
There is another maximal independent set
of variables `\verb/(A1,A2,A3,X1)/' as shown in the list of 
all maximal independent sets. 
The computing time for the computation of the dimension is neglectable.

{\footnotesize %-------------------------
\begin{verbatim}
     MAS: Polynomial in the variables: (A1,A2,A3,A4,X1,X2,X3,X4)
 
     Term ordering:  inverse lexicographical.
 
     Polynomial list: 
               (  X4 - A4 + A2 )
               (  X4 + X3 + X2 + X1 - A4 - A3 - A1 )
               (  X3 X4 + X1 X4 + X2 X3 + X1 X3 - A3 A4 - A1 A4 -
                A1 A3 )
               (  X1 X3 X4 - A1 A3 A4 )

     Time: read = 0, eval = 1667, print = 167, gc = 0.
     MAS: Polynomial in the variables: (A1,A2,A3,A4,X1,X2,X3,X4)
 
     Term ordering:  inverse lexicographical.
 
     Polynomial list: 
               (  A4**3 X1**3 -3 A2 A4**2 X1**3 +3 A2**2 A4 X1**3
                - A2**3 X1**3 - A3 A4**3 X1**2 - A1 A4**3 X1**2 +
               2 A2 A3 A4**2 X1**2 - A1 A3 A4**2 X1**2 +2 A1 A2 A
               4**2 X1**2 - A2**2 A3 A4 X1**2 +2 A1 A2 A3 A4 X1**
               2 - A1 A2**2 A4 X1**2 - A1 A2**2 A3 X1**2 + A1 A3 
               A4**3 X1 + A1 A3**2 A4**2 X1 - A1 A2 A3 A4**2 X1 +
                A1**2 A3 A4**2 X1 - A1 A2 A3**2 A4 X1 - A1**2 A2 
               A3 A4 X1 - A1**2 A3**2 A4**2 )

               (  A1 A3 A4 X2 + A4**2 X1**2 -2 A2 A4 X1**2 + A2**
               2 X1**2 - A3 A4**2 X1 - A1 A4**2 X1 + A2 A3 A4 X1 
               + A1 A2 A4 X1 + A1 A2 A3 X1 + A1 A3 A4**2 - A1 A2 
               A3 A4 )

               (  A1 A2 A3 X1 X2 + A4**2 X1**3 -2 A2 A4 X1**3 + A
               2**2 X1**3 - A3 A4**2 X1**2 - A1 A4**2 X1**2 + A2 
               A3 A4 X1**2 - A1 A3 A4 X1**2 + A1 A2 A4 X1**2 +2 A
               1 A2 A3 X1**2 + A1 A3 A4**2 X1 + A1 A3**2 A4 X1 + 
               A1**2 A3 A4 X1 - A1 A2 A3**2 X1 - A1 A2**2 A3 X1 -
                A1**2 A2 A3 X1 - A1**2 A3**2 A4 )

               (  A4 X1 X2 - A2 X1 X2 + A4 X1**2 - A2 X1**2 - A3 
               A4 X1 - A2 A4 X1 - A1 A4 X1 + A2 A3 X1 + A2**2 X1 
               + A1 A2 X1 + A1 A3 A4 )

               (  X2**2 +2 X1 X2 + A4 X2 - A3 X2 -2 A2 X2 - A1 X2
                + X1**2 - A3 X1 - A2 X1 - A1 X1 - A2 A4 + A2 A3 +
                A1 A3 + A2**2 + A1 A2 )

               (  X3 + X2 + X1 - A3 - A2 - A1 )

               (  X4 - A4 + A2 )

     MAS: Computing Dimension ... 

     Dimension = 4
 
     Maximal independent set = (A1,A2,A3,A4)
 
     All maximal independent sets = ( (A1,A2,A3,A4), (A1,A2,A3,X1) )
 
     Time: read = 0, eval = 150, print = 0, gc = 0.
\end{verbatim}
}
This is the end of the dimension example. 


\section{Zero-dimension ideal decomposition} %----------

We quote from the introduction of the package 
by \cite{Kre87}. %----- kredel/texibm/euro87[88].tex -----
For a complete treatment of the theory including the 
positive-dimension case see \cite{Becker93}. 

In a polynomial ring, a Noetherian Ring, it is known,
that every ideal $A$ can be decomposed into finitely many
primary components $q_i$:
\begin{displaymath}
       A = q_1 \cap \ldots \cap q_l 
\end{displaymath}
This fact was discovered by Lasker, Macaulay 
\cite{Lasker05,Macaulay16},
and in the special case of zero dimensional ideals already by M. Noether. 
By E. Noether this fact is true for every ring satisfying the so 
called `Teilerkettensatz' which is equivalent to Hilberts Basis Theorem 
\cite{Noether21}. 

In 1926 G. Hermann made an attempt to discribe a constructive way to 
find the primary decomposition of a given polynomial ideal over 
fields which allow constructive factorization. 
However she was not aware of the fact, that in general 
not for all such ground fields, the polynomials can be factorized 
constructively. 
Seidenberg gave an investigation of these topics
\cite{Hermann26,Seid74}.
 
The early constructive approaches were based
on the method of solving linear equations in
a module over the polynomial ring.
Today we are equipped with the powerful method
of Gr\"obner Bases, as investigated by B. Buchberger
\cite{Buchb65,Buchb85}. 
 
In 1976 R. Schrader proposed a way for 
zero dimensional polynomial ideals by
constructing univariate polynomials, 
factorization and computing the primary ideals
from the prime ideals by $q = A + p^\sigma$,
where $\sigma$ is the exponent of $p$ \cite{Sch76}.
However his primality test and the generation of
prime ideals is hard to realize. 
 
D. Lazard gave an algorithm to compute 
prime components and multiplicites for pure
equidimensional ideals. In 1985 he published a
careful study of the primary decomposition
in the case on a polynomial ring in two variables
\cite{Laz82,Laz85}. 
Kandri-Rody studied constructive ways to
compute the radical of an ideal via the computation
of associate isolated prime ideals \cite{KaR84}. 
 
P. Gianni, B. Trager \& G. Zacharias developed a set of
algorithms for primary decomposition in 1984. 
Their method uses ideals in `generic position' and factorization, 
instead of field extensions by adjoining new variables.
However they use a very complicated 
primality test, involving mappings to
polynomial rings over field extensions of the ground field. 
\cite{GTZ86}
 
In our method we compute the prime ideals 
by first decomposing the ideal according to Schrader.
An algorithm has been published by B\"oge, Gebauer and Kredel 
\cite{Sch76,BGK86}. 
Next we transform the generated ideals by 
some algebraic extension of the ground field
until we reach a prime basis for the ideals.
This gives us an easy primality test, and the 
primary ideals can now be determined by
$q = A + p^\sigma$.

At the moment the algorithms are implemented
for the rational numbers as ground field, but 
the method applies also to the rational functions as ground field. 
Since field extensions and squarefree decompositions are involved, 
the method is restricted to fields of characteristic zero. 

The method uses:
\begin{list}{$\bullet$}{}
\item Gr\"obner base calculations
\item construction of univariate polynomials
      and univariate polynomial factorization 
\item algebraic field extensions of the ground field
\item an easy to handle ideal primality test
\end{list}
The method produces for a given zero dimensional ideal:
\begin{list}{$\bullet$}{}
\item the associated prime ideals
\item the primary ideals
\item the exponents of the associated prime ideals 
\end{list}

An informal overview of all steps of the algorithm is 
given in table \ref{prim.alg}. 

\begin{table}[thbp]
\begin{description} 
\item[Input:] 
   $F =$ Basis for an ideal $A$ 
   $\subset \K\lbrack X_1,\ldots,X_r\rbrack$.
\item[Output:]
   All tuples $(P,Q,e)$ such that $ideal(P)$ is an associated prime ideal
   of $A$ with primary ideal $ideal(Q)$ and exponent $e$.    
\item[Step 0.] Compute a Gr\"obner base $G$ for $A$.
   {\bf if} dimension $ideal(G) \neq 0$ {\bf then stop}.
\item[Step 1.] Compute a set of so called U--bases
   $\{ U_1, \ldots, U_l \}, l \geq 1$, such that
   $$radical(ideal(G)) = \bigcap_{i=1,\ldots,l} radical(ideal(U_i))$$ 
   and all univariate polynomials of minimal degree in $ideal(U_i)$
   are irreducible, using univariate polynomial construction
   (for details see \cite{BGK86}).
\item[Step 2.] Compute a set of P--bases
   $\{ P'_1, \ldots, P'_m \}, m \geq l$, such that all polynomials 
   in $P'_i$ are at most bivariate with linear head term except one 
   univariate polynomial with (possibly) non linear head term 
   using primitive element construction.  
   Compute ideal bases $P_i$ by 
   $$ideal(P_i) = ideal(P'_i) \cap \K\lbrack X_1,\ldots,X_r\rbrack.$$ 
   Then $ideal(P_i)$ is a prime ideal associated to $A$.   
\item[Step 3.] Compute minimal $e \in \N$, such that 
   $ideal(P^{e}) \subset A + ideal(P^{e+1})$. 
   Then $e$ is the exponent of $ideal(Q)$ and 
   $ideal(Q) = A + ideal(P^e)$ is a primary component of $A$.
\end{description} 
\caption{Overview of primary ideal docomposition}
\label{prim.alg}
\end{table}


\subsection{Algorithms and Examples} %------------------

The specification of the main algorithm \verb/DECOMP0/ is as follows. 
Given a Gr\"obner base of multivariate polynomials with 
rational number coefficients of a zero--dimensional ideal. 
Then find the primary ideal decomposition over algebraic field
extensions of \Q. 
This problem is solved using the method of P-ideal decomposition, 
primary ideal computation by M. Noethers method as described in 
\cite{Kre87}. 
\index{primary ideal! decomposition} 

The primary ideal decomposition is computed only over the
coefficient domains of the rational numbers.
The term ordering must be inverse lexicographical.
There is a lot of run time information printed.

%-------

The specification of the main algorithm \verb/DECOMP0A/ is as follows. 
Given a Gr\"obner base of multivariate polynomials with 
rational number coefficients of a zero--dimensional ideal. 
Find the primary ideal decomposition over \Q. 
This problem is solved using the method of 
P-ideal decomposition over algebraic extension fields over \Q. 
Back transformation of the prime ideals to prime ideals over \Q\ by
Gr\"obner bases computation with a different term ordering and 
primary ideal computation by M. Noethers method.
\index{primary ideal! decomposition} 
This method is also described in \cite{Kre87}.

The primary ideal decomposition is computed only over the
coefficient domains of the rational numbers.
The term ordering must be inverse lexicographical.
There is a lot of run time information printed.
The programs are contained in the Modula-2 libraries 
\verb/DIPIDEAL/ and \verb/DIPDEC0/. 

%--------

In the following example we compute the decomposition of the 
ideal generated by $( x^2 - 2, y^2 - 2, (z - x y)^2 )$ over 
$\Q$ and over $\Q(\alpha)$ for some $\alpha \not \in \Q$.
The input consists of a polynomial list in the usual 
syntax as described in section \ref{dip.alg}. 
Then the statement `\verb/q:=DIRPGB(p,1)/' 
requests the computation of the Gr\"obner base. 
Next the statements `\verb/DECOMP0(q)/'
and `\verb/DECOMP0A(q)/' request the primary decomposition 
of the ideal over $\Q$ respectively over $\Q(\alpha)$ 
and write the results on the actual output stream. 

{\footnotesize   %----------
\begin{verbatim}
     (* Ideal decomposition of zero-dimensional polynomial ideals. *)

     (* Polynomial list: *)
     p:=PREAD().
     (x,y,z) L
     (
     ( ( z**2 - y x)**2  ),
     ( y**2 - 2 ),
     ( x**2 - 2 ),
     )
     PWRITE(p). 

     (* Groebner base: *)
     q:=DIRPGB(p,0).
     PWRITE(q).

     (* decomposition : *)
     DECOMP0(q).

     (* decomposition over Q(alpha) : *)
     DECOMP0A(q).
\end{verbatim}
}

The following output shows the computed Gr\"obner base.

{\footnotesize   %----------
\begin{verbatim}
     MAS: Polynomial in the variables: (x,y,z)
 
     Term ordering:  inverse lexicographical.
 
     Polynomial list: 
               (  z**4 -2 x y z**2 + x**2 y**2 )
               (  y**2 -2 )
               (  x**2 -2 )

     Time: read = 17, eval = 17, print = 0, gc = 0.
     MAS: Polynomial in the variables: (x,y,z)
 
     Term ordering:  inverse lexicographical.
 
     Polynomial list: 
               (  x**2 -2 )
               (  y**2 -2 )
               (  z**4 -2 x y z**2 +4 )
\end{verbatim}
}

The following output shows the computed primary decomposition 
over $\Q$. There are three primary components, which are 
listed in sequence. The information on each 
primary component consists 
at first of the corresponding prime ideal, 
at second of the primary ideal itself 
and at last of the exponent of the prime ideal. 
The computing time is slightly more than $21$ seconds. 
The intermediate output in not shown, except the 
string `\verb/Introduction of the new variable exz/',
which indicates, that a field extension was required 
to make the variables \verb/x/ and \verb/z/ linear 
in terms of the new variable \verb/exz/. 
After a prime base over this extension field has been computed, 
the new variable is removed using ideal intersections.
In the next example this variable and the corresponding 
polynomials are kept. 

{\footnotesize   %----------
\begin{verbatim}
     Introduction of the new variable exz

     Introduction of the new variable exz

     The given ideal
               (  x**2 -2 )
               (  y**2 -2 )
               (  z**4 -2 x y z**2 +4 )
 
     The decomposition of the ideal
 
     The prime ideal
               (  x**2 -2 )
               (  y - x )
               (  z + x )

     The primary ideal
               (  x**2 -2 )
               (  y - x )
               (  z**2 +2 x z +2 )
 
     The exponent is 2
 
     The prime ideal
               (  x**2 -2 )
               (  y - x )
               (  z - x )

     The primary ideal
               (  x**2 -2 )
               (  y - x )
               (  z**2 -2 x z +2 )
 
     The exponent is 2
 
     The prime ideal
               (  x**2 -2 )
               (  y + x )
               (  z**2 +2 )

     The primary ideal
               (  x**2 -2 )
               (  y + x )
               (  z**4 +4 z**2 +4 )
 
     The exponent is 2
 
     Time: read = 0, eval = 21400, print = 0, gc = 0.
\end{verbatim}
}


The following output shows the computed primary decomposition 
over $\Q(\alpha)$.
As before there are three primary components, which are 
listed in sequence. The information on each 
primary component consists 
at first of the corresponding prime ideal, 
at second of the primary ideal itself 
and at last of the exponent of the prime ideal. 
The computing time is nearly $28$ seconds. 
The intermediate output in not shown, except the 
string `\verb/Introduction of the new variable exz/',
which indicates, that a field extension was required 
to make the variables \verb/x/ and \verb/z/ linear 
in terms of the new variable \verb/exz/. 
Contrary to the previous example, this new variable 
and the corresponding polynomials are kept 
after a prime base over this extension field has been computed. 
So the displayed bases of the prime ideals are in fact 
prime bases, e.g.\ they consist of exactly one 
irreducible univariate polynomial and all other polynomials 
are bivariate and linear in the second variable.
The computing time is slightly more than in the previous example 
mostly despite of the computation of the 
primary ideals and exponents in a polynomial ring with 
$4$ instead of $3$ variables. But there are also examples where 
the computation over $\Q(\alpha)$ is faster than the 
computation over $\Q$ despite of the fact that no 
ideal intersections need to be computed.


{\footnotesize   %----------
\begin{verbatim}
     Introduction of the new variable exz
 
     Introduction of the new variable exz
 
     The given ideal
               (  exz**2 -2 )
               (  x**2 -2 )
               (  y**4 -2 exz x y**2 +4 )
 
     The decomposition of the ideal
 
     The prime ideal
               (  exz**4 +16 )
               (  x -1/8 exz**3 +1/2 exz )
               (  y +1/8 exz**3 -1/2 exz )
               (  z -1/8 exz**3 -1/2 exz )
 
     The primary ideal
               (  exz**4 +16 )
               (  x -1/8 exz**3 +1/2 exz )
               (  y +1/8 exz**3 -1/2 exz )
               (  z**2 -1/4 exz**3 z - exz z -2 )
 
     The exponent is 2
 
     The prime ideal
               (  exz**2 -18 )
               (  x +1/3 exz )
               (  y +1/3 exz )
               (  z -1/3 exz )
 
     The primary ideal
               (  exz**2 -18 )
               (  x +1/3 exz )
               (  y +1/3 exz )
               (  z**2 -2/3 exz z +2 )
 
     The exponent is 2
 
     The prime ideal
               (  exz**2 -2 )
               (  x + exz )
               (  y + exz )
               (  z + exz )
 
     The primary ideal
               (  exz**2 -2 )
               (  x + exz )
               (  y + exz )
               (  z**2 +2 exz z +2 )

     The exponent is 2

     Time: read = 17, eval = 27933, print = 0, gc = 0.
\end{verbatim}
}

%------------- 

In the next example, taken from \cite{Weinb76}, we want to factor 
a polynomial over an algebraic number field. 
Precisely, the polynomial $X^3 - 3$ should be factored in $\Q(\alpha)$ where
$\alpha$ is a root of $T^6 + 3 T^5 + 6 T^4 + T^3 - 3 T^2 + 12 T + 16$. 
Therefore we consider the ideal generated by these two polynomials 
in $\Q\lbrack T,X \rbrack$. 

{\footnotesize   %----------
\begin{verbatim} 
       ( 
       ( X**3 - 3 ), 
       ( T**6 + 3 T**5 + 6 T**4 + T**3 - 3 T**2  + 12 T + 16 )
       )
\end{verbatim} 
}

The given ideal base is already a Gr\"obner Base, and the 
univariate polynomials are irreducible. 
One field extensions is necessary to get linear headterms 
in 'T' and 'X' (denoted by 'ETX').
The field extension step yields
a polynomial of degree 18, which can be 
factored into 3 parts.

{\footnotesize   %----------
\begin{verbatim}
      ( ETX**18 -18 ETX**17 +180 ETX**16 -1122 ETX**15 
       + 4734 ETX**14 -13860 ETX**13 +37887 ETX**12
       - 163908 ETX**11 +608328 ETX**10 -680564 ETX**9
       - 5061348 ETX**8 +26631000 ETX**7 -46572249 ETX**6
       - 9583146 ETX**5 +231202116 ETX**4 -612614634 ETX**3
       + 1302509286 ETX**2 -2140997364 ETX +1595283481 )
\end{verbatim}
}

From its factors we obtain 3 extension ideals: 

{\footnotesize   %----------
\begin{verbatim}
      Extension ideal no 1 

      ( ETX**6 -6 ETX**5 +24 ETX**4 -50 ETX**3 +78 ETX**2 
        -132 ETX +121 )
      ( T -4/165 ETX**5 +37/330 ETX**4 -74/165 ETX**3 +
        112/165 ETX**2 -151/330 ETX +22/15 )
      ( X -8/165 ETX**5 +37/165 ETX**4 -148/165 ETX**3 
        +224/165 ETX**2 -316/165 ETX +44/15 ) 

      Extension ideal no 2 

      ( ETX**6 -6 ETX**5 +24 ETX**4 +4 ETX**3 -570 ETX**2 
        +516 ETX +3631 )
      ( T +8/9345 ETX**5 -23/3738 ETX**4 +302/9345 ETX**3 
        -716/9345 ETX**2 +2593/18690 ETX +6802/9345 )
      ( X +16/9345 ETX**5 -23/1869 ETX**4 +604/9345 ETX**3
        -1432/9345 ETX**2 -6752/9345 ETX +13604/9345 )

      Extension ideal no 3 

      ( ETX**6 -6 ETX**5 +24 ETX**4 +4 ETX**3 +402 ETX**2 
       -1428 ETX +3631 ) 
      ( T -8/16863 ETX**5 +3/1022 ETX**4 -6/803 ETX**3 
         +92/16863 ETX**2 +323/1606 ETX +4926/5621 )
      ( X -16/16863 ETX**5 +3/511 ETX**4 -12/803 ETX**3
        +184/16863 ETX**2 -480/803 ETX +9852/5621 )
\end{verbatim}
}

From the prime ideals over the field extension 
over \Q \ we compute the prime ideals over \Q. 
All Gr\"obner bases are containing the polynomial:

{\footnotesize   %----------
\begin{verbatim}
      ( T**6 +3 T**5 +6 T**4 + T**3 -3 T**2 +12 T +16 )
\end{verbatim}
}
{\footnotesize   %----------
\begin{verbatim}
      Prime ideal no 1

      ( X -1/12 T**5 -1/12 T**4 -1/6 T**3 +7/12 T**2 -11/12 T -4/3 ) 

      Prime ideal no 2

      ( X -1/12 T**5 -1/4 T**4 -1/2 T**3 -5/12 T**2 +1/4 T -1 )

      Prime ideal no 3

      ( X +1/6 T**5 +1/3 T**4 +2/3 T**3 -1/6 T**2 +2/3 T +7/3 )
\end{verbatim}
}

The computing time on an IBM 3090 was 52090 ms.
%--- 2769359 storage cells used.

This is the end of the primary decomposition examples. 
 

\section{Zero-dimension ideal real roots} %----------

We quote from the introduction of the package developed 
by \cite{Kre89}. %----- kredel/texibm/jscroot.tex -----
For a complete treatment of the theory see \cite{Becker93}. 

One of the application problems of computational mathematics
is the determination of the solutions (roots, zeros) of systems of
algebraic equations.
If the system of algebraic equations generates a
zero dimensional ideal in a polynomial ring over the
rational numbers, then the coordinates of the roots are algebraic numbers. 
The problem is to find a constructive method for the 
computation of the {\bf real} roots of an ideal
$A = ( g_1,\ldots,g_k)$ in $\Q\lbrack X_1, \ldots, X_r \rbrack$: 
\begin{eqnarray*} 
Zero(A) & = & \{ 
                  \alpha \in E^r \ : \
                  f(\alpha) = 0, \
                  \forall \ f \in A \} 
                  \\
           & = & \{ 
                  (\omega_1, \ldots, \omega_r ) \in E^r \ : \ 
                  g_i(\omega_1, \ldots, \omega_r ) = 0,  \ 
                  i=1,\ldots,k \}.
\end{eqnarray*}
where $E \subseteq \R$ is a real algebraic extension field of $\Q$.

This problem was fully realized during the
last century and the beginning of the 20-th century. 
The early attempts relied mainly on the
resultant calculus, and construction of
so-called elimination ideals 
involving Kroneckers resultant systems.
The computational complexity of this approach
was to high to be treated satisfactorily in these times 
\cite{Kronecker1882,Macaulay16}.
Even published methods tend to become forgotten,
so in older editions of V.d.Waerdens `(Modern) Algebra' from 1931 
we find a lot about resultant calculus which 
parts are removed in current editions e.g.\ 1971.

With the rise of computers the problem
was mainly attacked by numerical mathematics 
using iterative methods, such as homotopy methods. 

But all these methods give no warranty
that all solutions are found, or that 
a special coordinate of the solution
is exactly equal to a certain algebraic number.
So there is an increasing need
of exact methods in theoretical investigations.
We will just mention the article of Morgan which tries 
to describe `exact' numerical methods \cite{Morgan83},
or the article of Butcher
for finding the exact coefficients
of some Runge-Kutta iteration equations \cite{Butcher84} 
and so proving their existence; 
in theoretical economics too, there is a 
need of reliable mathematical methods. %-----\cite{Rose84}.

One of the most famous 
approaches to solve this problem by computer has been 
published by Collins and Loos
based on resultant calculus
and has been applied to quantifier elimination over
real closed fields \cite{Collins74,CoL82,Loos82}.
The method uses
projection sets (a special set of generators for elimination
ideals in this case),
primitive element construction, 
real root isolation of algebraic number field polynomials
and univariate polynomial construction.
It inductively reduces the problem
to the bivariate case by the mappings 
\begin{math}
   \Q\lbrack X_1, \ldots, X_r \rbrack 
   \longrightarrow
   \Q\lbrack X_1, \ldots, X_i \rbrack 
   \longrightarrow
   \Q(\beta_1, \ldots, \beta_{i-1}) \lbrack X_i \rbrack 
   \longrightarrow
   \Q(\alpha_{i-1}) \lbrack X_i \rbrack 
\end{math} 
 and then solving the bivariate case.

One of the first attempts to apply Gr\"obner Bases to this problem 
has been undertaken by Buchberger and Trinks, 
see Methods 6.10 and 6.12 in \cite{Buchb85}.
Pohst and Yun combined the computation of resultants and
pseudo division with Gr\"obner bases for the 
computation of elimination ideals \cite{PY81}. 
The next step towards the solution of 
this problem was the application of 
univariate polynomial construction and
ideal decomposition yielding a finite inclusion for 
the zeros of the ideal \cite{BGK86}.
Gianni discussed a method also based on Gr\"obner bases; 
it seems however to be impractical to 
construct the desired Gr\"obner bases 
due to the posibly large degrees for the polynomials generated
(their bases are defined like P-bases, but with one 
squarefree polynomial instead of an irreducible polynomial)
\cite{Gianni86}. 
Gianni and Kalkbrenner gave also
methods using specialization in algebraic field extensions 
and gcd-computations in algebraic field extensions, respectively 
\cite{Gianni87,Kalkb87}.

Our approach continues the one
described by B\"oge {\em et al.} and
solves the most important open problem left over: 
the selection of the `valid' solutions. 
We use following (sub)methods:
\begin{list}{$\bullet$}{}
\item Gr\"obner base calculations
\item construction of univariate polynomials 
\item univariate polynomial factorization
\item primitive element computation using Gr\"obner bases
\item univariate polynomial real root isolation
\item algebraic number field element sign
\end{list} 
Using these tools,
our method produces for a given zero dimensional ideal $A$:
\begin{list}{$\bullet$}{}
\item a decomposition of $A$ into radical ideals
\item all tuples of coordinates for the real roots of $A$
\end{list} 

An informal overview of all steps of the algorithm is 
given in table \ref{roots.alg}. 

\begin{table}[htbp]
\begin{description} 
\item[Input:] 
   $F =$ Basis for an ideal $A$ 
   $\subset \K\lbrack X_1,\ldots,X_r\rbrack$.
\item[Output:]
   All tuples of minimal polynomials and 
   isolating intervals for the real roots
   of $A$.
\item[Step 0.] Compute a Gr\"obner base $G$ for $A$.
   {\bf if} dimension $ideal(G) \neq 0$ {\bf then stop}.
\item[Step 1.] Compute a set of so called U--bases
   $\{ U_1, \ldots, U_l \}, l \geq 1$, such that
   $$Zero(ideal(G)) =  \bigcup_{i=1,\ldots,l} Zero(ideal(U_i))$$ and 
   all univariate polynomials of minimal degree in $ideal(U_i)$
   are irreducible, using univariate polynomial construction
   (for details see \cite{BGK86}).
\item[Step 2.] Compute a set of so called R--bases
   $\{ R_1, \ldots, R_m \}, m \geq l$, such that
   $$Zero(ideal(G)) =  \bigcup_{i=1,\ldots,m} Zero(ideal(R_i))$$ and 
   all polynomials in $R_i$ are at most bivariate,
   using primitive element construction
   (for details see also \cite{Kre87}). 
\item[Step 3.] Compute isolating intervals for the real roots
   of univariate polynomials (see \cite{Loos82}),
   and select valid roots of the elimination ideals of $ideal(R_i)$.
\end{description} 
\caption{Overview of real root computation}
\label{roots.alg}
\end{table}


\subsection{Algorithms and Examples} %------------------

The specification of the main algorithm \verb/ROOTS/ is as follows. 
Given a Gr\"obner base of {\em multivariate} polynomials with
rational number coefficients of a zero--dimensional ideal.
Find the isolating intervals of the real roots of the
ideal generated be the set of polynomials.
This problem is solved using the method of 
R-ideal decomposition, univariate polynomial real root isolation 
and combination of valid tuples of isolating intervals of the real roots.
\index{real roots! of zero--dimensional ideals}
The method is described in \cite{Kre89}.

The real roots are computed only over the
coefficient domains of the rational numbers.
The term ordering must be inverse lexicographical.
There is a lot of run time information printed.
The isolating  intervals will be refined to any desired precision 
specified in the second parameter. 
The programs are contained in the Modula-2 libraries 
\verb/DIPIDEAL/, \verb/DIPDEC0/ and \verb/DIPROOT/. 

In the following example we compute the real roots of the ideal generated 
by $( x^2 - 2, y^2 - 3, z^2 - x y )$ to a precision of 20 decimal digits.
The components of the real roots should appear among 
$\pm \sqrt{2}$ for the \verb/x/ component, 
$\pm \sqrt{3}$ for the \verb/y/ component and 
$\pm \sqrt{ \sqrt{2} \sqrt{3}}$ for the \verb/z/ component.

The input consists of a polynomial list in the usual 
syntax as described in section \ref{dip.alg}. 
Then the statement `\verb/q:=DIRPGB(p,0)/' 
requests the computation of the Gr\"obner base. 
Next the statement `\verb/ROOTS(q,20)/' request the 
computation of the isolating intervals for real roots to 
a precision of \verb/20/ decimal places 
and writes the results on the actual output stream. 

 
{\footnotesize   %----------
\begin{verbatim}
     (* Real roots of zero-dimensional polynomial ideals. *)

     (* Polynomial list: *)
     p:=PREAD().
     (x,y,z) L
     (
     ( z**2 - y x ),
     ( y**2 - 3 ),
     ( x**2 - 2 ),
     )
     PWRITE(p). 

     (* Groebner base: *)
     q:=DIRPGB(p,0).
     PWRITE(q).

     (* Real roots: *)
     ROOTS(q,20).
\end{verbatim}
}

The following output shows the computed Gr\"obner base, which 
in fact show, that the input already was a Gr\"obner base. 

{\footnotesize   %----------
\begin{verbatim}
     MAS: Polynomial in the variables: (x,y,z)
 
     Term ordering:  inverse lexicographical.
 
     Polynomial list: 
               (  z**2 - x y )
               (  y**2 -3 )
               (  x**2 -2 )

     MAS: Polynomial in the variables: (x,y,z)
 
     Term ordering:  inverse lexicographical.
 
     Polynomial list: 
               (  x**2 -2 )
               (  y**2 -3 )
               (  z**2 - x y )
\end{verbatim}
}


The next output shows the result of step 1 in the method of 
table \ref{roots.alg}, the so called `normalized tuples', 
which happens to be just a single tuple. 
Such a tuple consists first of the respective Gr\"obner base and 
then of the univariate polynomials of minimal degree in the ideal 
in each variable. 
The tuples are are characterized 
{\em first} by the respective ideals 
generated by the bases beeing radicals and 
their intersection beeing a decomposition 
of the radical of the original ideal and
{\em second} by the fact that the univariate polynomials 
of minimal degree in each variable are irreducible.


{\footnotesize   %----------
\begin{verbatim}
     The normalized tupels
 
     Zero set tupel no 1
 
     Characterising groebner basis
               (  x**2 -2 )
               (  y**2 -3 )
               (  z**2 - x y )

     Characterising polynomial for the real roots is
     p(x) = (  x**2 -2 )
 
     Characterising polynomial for the real roots is
     p(y) = (  y**2 -3 )
 
     Characterising polynomial for the real roots is
     p(z) = (  z**4 -6 )
\end{verbatim}
}

The next output shows the result of step 2 in the method of 
table \ref{roots.alg}, the so called `refined tuples', which 
happens to be just a single tuple. 
Such a tuple consists first of the respective Gr\"obner base and 
then of the univariate polynomials of minimal degree in the ideal 
in each variable. 
As the normalized tuples before the refined tuples are characterized 
{\em first} by the respective ideals 
generated by the bases beeing radicals and 
their intersection beeing a decomposition 
of the radical of the original ideal and
{\em second} by the fact that the univariate polynomials 
of minimal degree in each variable are irreducible.
Additionally this tuples have the 
{\em third} property, that the ideal basis polynomials 
are at most bivariate (so called R-bases).
This property is enforced by a field extension,
making the variables \verb/x/ and \verb/y/ linear 
with respect to the new variable \verb/eyx/ and thus 
removing the trivariate polynomial $z^2 - x y$ from the base.
This event is indicated by the 
string `\verb/Introduction of the new variable eyx/'. 
Note, that the ideal base is not jet a prime base (P-base) 
because the polynomial in the variable \verb/z/ is still 
not linear as it would be required by a P-base. 

{\footnotesize   %----------
\begin{verbatim}
     Introduction of the new variable eyx

     The refined tupels
 
     Zero set tupel no 1
 
     Characterising groebner basis
               (  eyx**4 -10 eyx**2 +1 )
               (  x -1/2 eyx**3 +9/2 eyx )
               (  y -1/2 eyx**3 +11/2 eyx )
               (  z**2 +1/2 eyx**2 -5/2 )

     Characterising polynomial for the real roots is
     p(eyx) = (  eyx**4 -10 eyx**2 +1 )
 
     Characterising polynomial for the real roots is
     p(x) = (  x**2 -2 )
 
     Characterising polynomial for the real roots is
     p(y) = (  y**2 -3 )
 
     Characterising polynomial for the real roots is
     p(z) = (  z**4 -6 )
\end{verbatim}
}

The next output shows the result of step 3 in the method of 
table \ref{roots.alg}, the so called `zero set tuples', which 
now happen to be four tuples. 
Each zero set tuple characterizes one real root of the given 
zero-dimensional ideal. 
Such a tuple consists for each variable 
first of the univariate polynomial of minimal degree in the ideal 
second of the isolating interval of the real root in this component 
and third of the decimal approximation of the 
real root with the requested precision. 
The components introduced by the field extensions can by 
ignored to obtain a real root of the original ideal 
(without changing the number of real roots).

{\footnotesize   %----------
\begin{verbatim}
     The zero set for dim 0 tupels 

 
     Zero set tupel no 1
 
     Characterising polynomial for the real root is
     p(eyx) = (  eyx**4 -10 eyx**2 +1 )
     The isolating interval for the real root is
     eyx = (0, 1/2)
     The decimal approximation for the real root is
     eyx = 0.317837245195782244726
 
     Characterising polynomial for the real root is
     p(x) = (  x**2 -2 )
     The isolating interval for the real root is
     x = (-2, -1)
     The decimal approximation for the real root is
     x = -1.414213562373095048802
 
     Characterising polynomial for the real root is
     p(y) = (  y**2 -3 )
     The isolating interval for the real root is
     y = (-2, -1)
     The decimal approximation for the real root is
     y = -1.732050807568877293527
 
     Characterising polynomial for the real root is
     p(z) = (  z**4 -6 )
     The isolating interval for the real root is
     z = (-2, -1)
     The decimal approximation for the real root is
     z = -1.565084580073287316584
 
 
     Zero set tupel no 2
 
     Characterising polynomial for the real root is
     p(eyx) = (  eyx**4 -10 eyx**2 +1 )
     The isolating interval for the real root is
     eyx = (-1/2, -1/4)
     The decimal approximation for the real root is
     eyx = -0.317837245195782244726
 
     Characterising polynomial for the real root is
     p(x) = (  x**2 -2 )
     The isolating interval for the real root is
     x = (0, 2)
     The decimal approximation for the real root is
     x = 1.414213562373095048802
 
     Characterising polynomial for the real root is
     p(y) = (  y**2 -3 )
     The isolating interval for the real root is
     y = (0, 2)
     The decimal approximation for the real root is
     y = 1.732050807568877293527
 
     Characterising polynomial for the real root is
     p(z) = (  z**4 -6 )
     The isolating interval for the real root is
     z = (-2, -1)
     The decimal approximation for the real root is
     z = -1.565084580073287316584
 
 
     Zero set tupel no 3
 
     Characterising polynomial for the real root is
     p(eyx) = (  eyx**4 -10 eyx**2 +1 )
     The isolating interval for the real root is
     eyx = (0, 1/2)
     The decimal approximation for the real root is
     eyx = 0.317837245195782244726

     Characterising polynomial for the real root is
     p(x) = (  x**2 -2 )
     The isolating interval for the real root is
     x = (-2, -1)
     The decimal approximation for the real root is
     x = -1.414213562373095048802

     Characterising polynomial for the real root is
     p(y) = (  y**2 -3 )
     The isolating interval for the real root is
     y = (-2, -1)
     The decimal approximation for the real root is
     y = -1.732050807568877293527
 
     Characterising polynomial for the real root is
     p(z) = (  z**4 -6 )
     The isolating interval for the real root is
     z = (0, 2)
     The decimal approximation for the real root is
     z = 1.565084580073287316584
 
 
     Zero set tupel no 4
 
     Characterising polynomial for the real root is
     p(eyx) = (  eyx**4 -10 eyx**2 +1 )
     The isolating interval for the real root is
     eyx = (-1/2, -1/4)
     The decimal approximation for the real root is
     eyx = -0.317837245195782244726
 
     Characterising polynomial for the real root is
     p(x) = (  x**2 -2 )
     The isolating interval for the real root is
     x = (0, 2)
     The decimal approximation for the real root is
     x = 1.414213562373095048802
 
     Characterising polynomial for the real root is
     p(y) = (  y**2 -3 )
     The isolating interval for the real root is
     y = (0, 2)
     The decimal approximation for the real root is
     y = 1.732050807568877293527
 
     Characterising polynomial for the real root is
     p(z) = (  z**4 -6 )
     The isolating interval for the real root is
     z = (0, 2)
     The decimal approximation for the real root is
     z = 1.565084580073287316584
 
     Time: read = 0, eval = 7116, print = 0, gc = 7734.
\end{verbatim}
}

The total computing time for the real root isolation 
including the ideal decompositions is 
slightly more than $7$ seconds ($8$ seconds in a different run). 
The computing time strongly depends on the requested precision 
as it is shown in table \ref{root.tab}. 

\begin{table}[htpb] \centering
\begin{tabular}{|r|r|} \hline
 Precision in    &  Computing time  \\
 decimal digits  &  in milliseconds \\
\hline
     0   &   4400 \\ 
    20   &   8833 \\ 
    50   &  16250 \\
   100   &  37566 \\
\hline
\end{tabular}
\caption{Computing Time Summary: Real Roots}
\label{root.tab}
\end{table}

This is the end of the real root isolation example.


%\section{} %----------

%{\footnotesize %-------------------------
%\begin{verbatim}
%\end{verbatim}
%}
%{\footnotesize %-------------------------
%\begin{verbatim}
%\end{verbatim}
%}
