Index: Singular/LIB/zeroset.lib
===================================================================
--- Singular/LIB/zeroset.lib	(revision b9b9069272a257e1724ad47e9b76d246a6e960fc)
+++ Singular/LIB/zeroset.lib	(revision 9173792041b606db778caa93efbcb33cd4dab347)
@@ -1,6 +1,5 @@
-// Last change 10.12.2000
-///////////////////////////////////////////////////////////////////////////////
-
-version="$Id: zeroset.lib,v 1.6 2001-01-16 13:48:47 Singular Exp $";
+// Last change 12.02.2001 (Eric Westenberger)
+///////////////////////////////////////////////////////////////////////////////
+version="$Id: zeroset.lib,v 1.7 2001-02-19 14:17:50 lossen Exp $";
 category="Symbolic-numerical solving";
 info="
@@ -11,9 +10,9 @@
 
 OVERVIEW:
- Algorithms for finding the zero-set of a zero-dim. ideal in Q(a)[x_1,..x_n],
+ Algorithms for finding the zero-set of a zero-dim. ideal in Q(a)[x_1,..,x_n],
  Roots and Factorization of univariate polynomials over Q(a)[t]
  where a is an algebric number. Written in the frame of the
  diploma thesis (advisor: Prof. Gert-Martin Greuel) 'Computations of moduli
- spaces of semiquasihomogenous singularities and an implementation in Singular'
+ spaces of semiquasihomogenous singularities and an implementation in Singular'.
  This library is meant as a preliminary extension of the functionality
  of Singular for univariate factorization of polynomials over simple algebraic
@@ -26,6 +25,4 @@
  EGCD(f, g)    gcd over an algebraic extension field of Q
  Factor(f)    factorization of f over an algebraic extension field
- InvertNumber(c)  inverts an element of an algenraic extension field
- LinearZeroSet(I)  find the linear (partial) solution of I
  Quotient(f, g)    quotient q  of f w.r.t. g (in f = q*g + remainder)
  Remainder(f,g)    remainder of the division of f by g
@@ -37,5 +34,5 @@
  EGCDMain(f, g)    gcd over an algebraic extension field of Q
  FactorMain(f)    factorization of f over an algebraic extension field
- InvertNumberMain(c)  inverts an element of an algenraic extension field
+ InvertNumberMain(c)  inverts an element of an algebraic extension field
  QuotientMain(f, g)  quotient of f w.r.t. g
  RemainderMain(f,g)  remainder of the division of f by g
@@ -44,9 +41,4 @@
  ContainedQ(data, f)  f in data ?
  SameQ(a, b)    a == b (list a,b)
- TransferRing()    create a new basering (to use ...Main())
- NewBaseRing()    create a new basering (return from  ...Main())
- SimplifyData(data)  reduces entries of data w.r.t. mpoly
- SimplifyPoly(f)  reduces coefficients of f w.r.t. mpoly
- SimplifySolution(sol)  reduces the entries of sol w.r.t. the ideal mpoly
 ";
 
@@ -68,5 +60,5 @@
 // Improvement :
 // a main problem is the growth of the coefficients. Try Roots(x7 - 1)
-// retrurn ideal mpoly !
+// return ideal mpoly !
 // mpoly is not monic, comes from primitive_extra
 
@@ -86,16 +78,18 @@
 
 proc Roots(poly f)
-"USAGE:   Roots(f); poly f
-PUROPSE: compute all roots of f in a finite extension of the groundfield
+"USAGE:   Roots(f); where f is a polynomial
+PURPOSE: compute all roots of f in a finite extension of the ground field
          without multiplicities.
 RETURN:  ring, a polynomial ring over an extension field of the ground field,
-         containing a list 'roots', poly 'newA', poly 'f':
-         - 'roots' is the list of roots of the polynomial f (no multiplicities)
-         - if the groundfield is Q(a') and the extension field is Q(a), then
-         'newA' is the representation of a' in Q(a). If the basering
-         contains a parameter 'a' and the minpoly remains unchanged then
-         'newA' = 'a'. If the basering does not contain a parameter then
-         'newA' = 'a' (default).
-         - 'f' is the polynomial f in  Q(a) (a' being substituted by newA)
+         containing a list 'roots' and polynomials 'newA' and 'f':
+  @format
+  - 'roots' is the list of roots of the polynomial f (no multiplicities)
+  - if the groundfield is Q(a') and the extension field is Q(a), then
+    'newA' is the representation of a' in Q(a). 
+    If the basering contains a parameter 'a' and the minpoly remains unchanged
+    then 'newA' = 'a'.
+    If the basering does not contain a parameter then 'newA' = 'a' (default).
+  - 'f' is the polynomial f in Q(a) (a' being substituted by 'newA')
+  @end format
 ASSUME:  ground field to be Q or a simple extension of Q given by a minpoly
 EXAMPLE: example  Roots; shows an example
@@ -164,13 +158,15 @@
 
 proc RootsMain(poly f)
-"USAGE:   RootsMain(f); poly f
-PURPOSE: compute all roots of f in a finite extension of the groundfield
+"USAGE:   RootsMain(f); where f is a polynomial
+PURPOSE: compute all roots of f in a finite extension of the ground field
          without multiplicities.
 RETURN:  list, all entries are polynomials
-         _[1] = roots of f, each entry is a polynomial
-         _[2] = 'newA'  - if the groundfield is Q(a') and the extension field
-                is Q(a), then 'newA' is the representation of a' in Q(a)
-         _[3] = minpoly of the algebraic extension of the groundfield
-ASSUME:  basering = Q[x,a] ideal mpoly must be defined, it might be 0 !
+  @format
+  _[1] = roots of f, each entry is a polynomial
+  _[2] = 'newA' - if the groundfield is Q(a') and the extension field
+         is Q(a), then 'newA' is the representation of a' in Q(a)
+  _[3] = minpoly of the algebraic extension of the groundfield
+  @end format
+ASSUME:  basering = Q[x,a] ideal mpoly must be defined, it might be 0!
 NOTE:    might change the ideal mpoly !!
 EXAMPLE: example  Roots; shows an example
@@ -304,17 +300,19 @@
 
 proc ZeroSet(ideal I, list #)
-"USAGE:   ZeroSetMain(ideal I [, int opt]); ideal I, int opt
-PUROPSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
+"USAGE:   ZeroSet(I [,opt] ); I=ideal, opt=integer
+PURPOSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
          of the groundfield.
 RETURN:  ring, a polynomial ring over an extension field of the ground field,
-         containing a list 'zeroset', a polynomial 'newA', and an ideal 'id'.
-         - 'zeroset'  is list of the zeros of the ideal 'I', each zero is
-           an ideal.
-         - if the groundfield is Q(a') and the extension field is Q(a), then
-         'newA' is the representation of a' in Q(a).  If the basering
-         contains a parameter 'a' and the minpoly remains unchanged then
-         'newA' = 'a'. If the basering does not contain a parameter then
-         'newA' = 'a' (default).
-         - 'id' is the ideal 'I'  in Q(a)[x_1,...] (a' substituted by 'newA')
+         containing a list 'zeroset', a polynomial 'newA', and an
+         ideal 'id':
+  @format
+  - 'zeroset' is the list of the zeros of the ideal I, each zero is an ideal.
+  - if the groundfield is Q(a') and the extension field is Q(a), then
+    'newA' is the representation of a' in Q(a).
+    If the basering contains a parameter 'a' and the minpoly remains unchanged
+    then 'newA' = 'a'.
+    If the basering does not contain a parameter then 'newA' = 'a' (default).    
+  - 'id' is the ideal I in Q(a)[x_1,...] (a' substituted by 'newA')
+  @end format
 ASSUME:  dim(I) = 0, and ground field to be Q or a simple extension of Q given
          by a minpoly.
@@ -406,9 +404,9 @@
 
 proc InvertNumberMain(poly f)
-"USAGE:   InvertNumberMain(f); poly f
+"USAGE:   InvertNumberMain(f); where f is a polynomial
 PURPOSE: compute 1/f if f is a number in Q(a) i.e., f is represented by a
          polynomial in Q[a].
 RETURN:  poly 1/f
-ASSUME:  basering = Q[x_1,...,x_n,a], ideal 'mpoly' must be defined and != 0 !
+ASSUME:  basering = Q[x_1,...,x_n,a], ideal mpoly must be defined and != 0 !
 "
 {
@@ -449,5 +447,5 @@
 proc LeadTerm(poly f, int i)
 "USAGE:   LeadTerm(f); poly f, int i
-PUROPSE: compute the leading coef and term of f w.r.t var(i), where the last
+PURPOSE: compute the leading coef and term of f w.r.t var(i), where the last
          ring variable is treated as a parameter.
 RETURN:  list of polynomials
@@ -469,9 +467,11 @@
 
 proc Quotient(poly f, poly g)
-"USAGE:   Quotient(f, g); poly f, g;
-PUROPSE: compute the quotient q and remainder r s.t. f = g*q + r, deg(r) < g
+"USAGE:   Quotient(f, g); where f,g are polynomials;
+PURPOSE: compute the quotient q and remainder r s.t. f = g*q + r, deg(r) < deg(g)
 RETURN:  list of polynomials
-         _[1] = quotient  q
-         _[2] = remainder r
+  @format
+  _[1] = quotient  q
+  _[2] = remainder r
+  @end format
 ASSUME:  basering = Q[x] or Q(a)[x]
 EXAMPLE: example  Quotient; shows an example
@@ -503,11 +503,13 @@
 
 proc QuotientMain(poly f, poly g)
-"USAGE:   QuotientMain(f, g); poly f, g
-PUROPSE: compute the quotient q and remainder r s.t. f = g*q + r, deg(r) < g
+"USAGE:   QuotientMain(f, g); where f,g are polynomials
+PURPOSE: compute the quotient q and remainder r s.t. f = g*q + r, deg(r) < deg(g)
 RETURN:  list of polynomials
-         _[1] = quotient  q
-         _[2] = remainder r
-ASSUME:  basering = Q[x,a] and ideal 'mpoly' is defined (it might be 0),
-         this represents the ring Q(a)[x] together with 'minpoly'.
+  @format
+  _[1] = quotient  q
+  _[2] = remainder r
+  @end format
+ASSUME:  basering = Q[x,a] and ideal mpoly is defined (it might be 0),
+         this represents the ring Q(a)[x] together with its minimal polynomial.
 EXAMPLE: example  Quotient; shows an example
 "
@@ -527,7 +529,7 @@
 
 proc Remainder(poly f, poly g)
-"USAGE:   Remainder(f, g); poly f, g
-PUROPSE: compute the remainder of the division of f by g, i.e. a polynomial r
-         s.t. f = g*q + r, deg(r) < g.
+"USAGE:   Remainder(f, g); where f,g are polynomials
+PURPOSE: compute the remainder of the division of f by g, i.e. a polynomial r
+         s.t. f = g*q + r, deg(r) < deg(g).
 RETURN:  poly
 ASSUME:  basering = Q[x] or Q(a)[x]
@@ -557,9 +559,9 @@
 
 proc RemainderMain(poly f, poly g)
-"USAGE:   RemainderMain(f, g); poly f, g
-PUROPSE: compute the remainder r s.t. f = g*q + r, deg(r) < g
+"USAGE:   RemainderMain(f, g); where f,g are polynomials
+PURPOSE: compute the remainder r s.t. f = g*q + r, deg(r) < deg(g)
 RETURN:  poly
-ASSUME:  basering = Q[x,a] and ideal 'mpoly' is defined (it might be 0),
-         this represents the ring Q(a)[x] together with 'minpoly'.
+ASSUME:  basering = Q[x,a] and ideal mpoly is defined (it might be 0),
+         this represents the ring Q(a)[x] together with its minimal polynomial.
 "
 {
@@ -579,7 +581,8 @@
 
 proc EGCD(poly f, poly g)
-"USAGE:   EGCDMain(f, g); poly f, g
-PUROPSE: compute the polynomial gcd of f and g over Q(a)[x]
-RETURN:  poly h s.t. h is a greatest common divisor of f and g (not nec. monic)
+"USAGE:   EGCD(f, g); where f,g are polynomials
+PURPOSE: compute the polynomial gcd of f and g over Q(a)[x]
+RETURN:  polynomial h s.t. h is a greatest common divisor of f and g (not nec.
+         monic)
 ASSUME:  basering = Q(a)[t]
 EXAMPLE: example  EGCD; shows an example
@@ -609,9 +612,9 @@
 
 proc EGCDMain(poly f, poly g)
-"USAGE:   EGCDMain(f, g); poly f, g
-PUROPSE: compute the polynomial gcd of f and g over Q(a)[x]
+"USAGE:   EGCDMain(f, g); where f,g are polynomials
+PURPOSE: compute the polynomial gcd of f and g over Q(a)[x]
 RETURN:  poly
-ASSUME:  basering = Q[x,a] and ideal 'mpoly' is defined (it might be 0),
-         this represents the ring Q(a)[x] together with 'minpoly'.
+ASSUME:  basering = Q[x,a] and ideal mpoly is defined (it might be 0),
+         this represents the ring Q(a)[x] together with its minimal polynomial.
 EXAMPLE: example EGCD; shows an example
 "
@@ -636,5 +639,5 @@
 proc MEGCD(poly f, poly g, int varIndex)
 "USAGE:   MEGCD(f, g, i); poly f, g; int i
-PUROPSE: compute  the polynomial gcd of f and g in the i'th variable
+PURPOSE: compute  the polynomial gcd of f and g in the i'th variable
 RETURN:  poly
 ASSUME:  f, g are polynomials in var(i), last variable is the algebraic number
@@ -670,10 +673,12 @@
 
 proc SQFRNorm(poly f)
-"USAGE:   SQFRNorm(f); poly f
-PUROPSE: compute the norm of the squarefree polynomial f in Q(a)[x].
-RETURN:  list
-         _[1] = squarefree norm of g (poly)
-         _[2] = g (= f(x - s*a)) (poly)
-         _[3] = s (int)
+"USAGE:   SQFRNorm(f); where f is a polynomial
+PURPOSE: compute the norm of the squarefree polynomial f in Q(a)[x].
+RETURN:  list with 3 entries
+  @format
+  _[1] = squarefree norm of g (poly)
+  _[2] = g (= f(x - s*a)) (poly)
+  _[3] = s (int)
+  @end format
 ASSUME:  f must be squarefree, basering = Q(a)[x] and minpoly != 0.
 NOTE:    the norm is an element of Q[x]
@@ -702,11 +707,13 @@
 
 proc SQFRNormMain(poly f)
-"USAGE:   SQFRNorm(f); poly f
-PUROPSE: compute the norm of the squarefree polynomial f in Q(a)[x].
-RETURN:  list
-         _[1] = squarefree norm of g (poly)
-         _[2] = g (= f(x - s*a)) (poly)
-         _[3] = s (int)
-ASSUME:  f must be squarefree, basering = Q[x,a] and ideal 'mpoly' is equal to
+"USAGE:   SQFRNorm(f); where f is a polynomial
+PURPOSE: compute the norm of the squarefree polynomial f in Q(a)[x].
+RETURN:  list with 3 entries
+  @format
+  _[1] = squarefree norm of g (poly)
+  _[2] = g (= f(x - s*a)) (poly)
+  _[3] = s (int)
+  @end format
+ASSUME:  f must be squarefree, basering = Q[x,a] and ideal mpoly is equal to
          'minpoly',this represents the ring Q(a)[x] together with 'minpoly'.
 NOTE:   the norm is an element of Q[x]
@@ -752,12 +759,14 @@
 
 proc Factor(poly f)
-"USAGE:   Factor(f); poly f
-PUROPSE: compute the factorization of the squarefree poly f over Q(a)[t], minpoly  = p(a).
-RETURN:  list
-         _[1] = factors (monic), first entry is the leading coefficient
-         _[2] = multiplicities (not yet)
-ASSUME:  basering must be the univariate polynomial ring over a field which
+"USAGE:   Factor(f); where f is a polynomial
+PURPOSE: compute the factorization of the squarefree poly f over Q(a)[t]
+RETURN:  list with two entries
+  @format
+  _[1] = factors (monic), first entry is the leading coefficient
+  _[2] = multiplicities (not yet implemented)
+  @end format
+ASSUME:  basering must be the univariate polynomial ring over a field, which
          is Q or a simple extension of Q given by a minpoly.
-NOTE:    if basering = Q[t] then this is the built-in 'factorize'.
+NOTE:    if basering = Q[t] then this is the built-in @code{factorize}
 EXAMPLE: example  Factor; shows an example
 "
@@ -788,12 +797,14 @@
 
 proc FactorMain(poly f)
-"USAGE:   FactorMain(f); poly f
-PUROPSE: compute the factorization of the squarefree poly f over Q(a)[t],
+"USAGE:   FactorMain(f); where f is a polynomial
+PURPOSE: compute the factorization of the squarefree poly f over Q(a)[t],
          minpoly  = p(a).
-RETURN:  list
-         _[1] = factors, first is a constant
-         _[2] = multiplicities (not yet)
-ASSUME:  basering = Q[x,a], represents Q(a)[x] and minpoly.
-         ideal mpoly must be defined, it might be 0 !
+RETURN:  list with 2 entries
+  @format
+  _[1] = factors, first is a constant
+  _[2] = multiplicities (not yet implemented)
+  @end format
+ASSUME:  basering = Q[x,a], representing Q(a)[x]. An ideal mpoly must
+         be defined, representing the minimal polynomial (it might be 0!).
 EXAMPLE: example  Factor; shows an example
 "
@@ -845,5 +856,5 @@
 proc ZeroSetMain(ideal I, int primDecQ)
 "USAGE:   ZeroSetMain(ideal I, int opt); ideal I, int opt
-PUROPSE: compute the zero-set of the zero-dim. ideal I, in a simple extension
+PURPOSE: compute the zero-set of the zero-dim. ideal I, in a simple extension
          of the groundfield.
 RETURN:  list
@@ -934,5 +945,5 @@
 proc ZeroSetMainWork(ideal id, intvec wt, int sVars)
 "USAGE:   ZeroSetMainWork(I, wt, sVars);
-PUROPSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
+PURPOSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
          of the groundfield (without multiplicities).
 RETURN:  list, all entries are polynomials
@@ -942,5 +953,5 @@
          _[4] = name of algebraic number (default = 'a')
 ASSUME:  basering = Q[x_1,x_2,...,x_n,a]
-         ideal mpoly must be defined, it might be 0 !
+         ideal mpoly must be defined, it might be 0!
 NOTE:    might change 'mpoly' !!
 EXAMPLE: example  IdealSolve; shows an example
@@ -1098,5 +1109,5 @@
 proc NonLinearZeroSetMain(ideal I, intvec wt)
 "USAGE:   ZeroSetMainWork(I, wt, sVars);
-PUROPSE: solves the (nonlinear) univariate polynomials in I
+PURPOSE: solves the (nonlinear) univariate polynomials in I
          of the groundfield (without multiplicities).
 RETURN:  list, all entries are polynomials
@@ -1186,5 +1197,5 @@
 static proc ExtendSolutions(list solutions, list newSolutions)
 "USAGE:   ExtendSolutions(sols, newSols); list sols, newSols;
-PUROPSE: extend the entries of 'sols' by the entries of 'newSols',
+PURPOSE: extend the entries of 'sols' by the entries of 'newSols',
          each entry of 'newSols' is a number.
 RETURN:  list
@@ -1245,5 +1256,5 @@
 static proc SubsMapIdeal(list sol, list index, int opt)
 "USAGE:   SubsMapIdeal(sol,index,opt); list sol, index; int opt;
-PUROPSE: built an ideal I as follows.
+PURPOSE: built an ideal I as follows.
          if i is contained in 'index' then set I[i] = sol[i]
          if i is not contained in 'index' then
@@ -1275,5 +1286,5 @@
 proc SimplifyZeroset(data)
 "USAGE:   SimplifyZeroset(data); list data
-PUROPSE: reduce the entries of the elements of 'data' w.r.t. the ideal 'mpoly'
+PURPOSE: reduce the entries of the elements of 'data' w.r.t. the ideal 'mpoly'
          'data' is a list of ideals/lists.
 RETURN:  list
@@ -1296,5 +1307,5 @@
 proc Variables(poly f, int n)
 "USAGE:   Variables(f,n); poly f; int n;
-PUROPSE: list of variables among var(1),...,var(n) which occur in f.
+PURPOSE: list of variables among var(1),...,var(n) which occur in f.
 RETURN:  list
 ASSUME:  n <= nvars(basering)
@@ -1314,11 +1325,11 @@
 
 proc ContainedQ(data, f, list #)
-"USAGE:    ContainedQ(data, f [, opt]); list data; f is of any type, int opt
-PUROPSE:  test if 'f' is an element of 'data'.
+"USAGE:    ContainedQ(data, f [, opt]); data=list; f=any type, opt=integer
+PURPOSE:  test if f is an element of data.
 RETURN:   int
-          0 if 'f' not contained in 'data'
-          1 if 'f' contained in 'data'
-OPTIONS:  opt = 0 : use '==' for comparing f with elements from data
-          opt = 1 : use 'SameQ' for comparing f with elements from data
+          0 if f not contained in data
+          1 if f contained in data
+OPTIONS:  opt = 0 : use '==' for comparing f with elements from data@*
+          opt = 1 : use @code{SameQ} for comparing f with elements from data
 "
 {
@@ -1345,6 +1356,6 @@
 
 proc SameQ(a, b)
-"USAGE:    SameQ(a, b); list/intvec a, b;
-PUROPSE:  test a == b elementwise, i.e., a[i] = b[i].
+"USAGE:    SameQ(a, b); a,b=list/intvec
+PURPOSE:  test a == b elementwise, i.e., a[i] = b[i].
 RETURN:   int
           0 if a != b
@@ -1374,5 +1385,5 @@
 static proc SimplifyPoly(poly f)
 "USAGE:   SimplifyPoly(f); poly f
-PUROPSE: reduces the coefficients of f w.r.t. the ideal 'moly' if they contain
+PURPOSE: reduces the coefficients of f w.r.t. the ideal 'moly' if they contain
          the algebraic number 'a'.
 RETURN:  poly
@@ -1399,5 +1410,5 @@
 static proc SimplifyData(data)
 "USAGE:   SimplifyData(data); ideal/list data;
-PUROPSE: reduces the entries of 'data' w.r.t. the ideal 'mpoly' if they contain
+PURPOSE: reduces the entries of 'data' w.r.t. the ideal 'mpoly' if they contain
          the algebraic number 'a'
 RETURN:  ideal/list
@@ -1423,5 +1434,5 @@
 static proc TransferRing(R)
 "USAGE:   TransferRing(R);
-PUROPSE: creates a new ring containing the same variables as R, but without
+PURPOSE: creates a new ring containing the same variables as R, but without
          parameters. If R contains a parameter then this parameter is added
          as the last variable and 'minpoly' is represented by the ideal 'mpoly'
@@ -1457,5 +1468,5 @@
 static proc NewBaseRing()
 "USAGE:   NewBaseRing();
-PUROPSE: creates a new ring, the last variable is added as a parameter.
+PURPOSE: creates a new ring, the last variable is added as a parameter.
          minpoly is set to mpoly[1].
 RETURN:  ring
