Index: Singular/LIB/finvar.lib
===================================================================
--- Singular/LIB/finvar.lib	(revision 013a76e1c23680e70350e2b1490fb5f16196a9d9)
+++ Singular/LIB/finvar.lib	(revision e53306f81bfae16e5d8715a3d1e3eff205b2cbb8)
@@ -1,7 +1,7 @@
-// $Id: finvar.lib,v 1.22 1999-08-31 12:38:56 Singular Exp $
+// $Id: finvar.lib,v 1.23 1999-09-03 07:58:02 Singular Exp $
 // author: Agnes Eileen Heydtmann, email:agnes@math.uni-sb.de
 // last change: 98/11/05
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: finvar.lib,v 1.22 1999-08-31 12:38:56 Singular Exp $"
+version="$Id: finvar.lib,v 1.23 1999-09-03 07:58:02 Singular Exp $"
 info="
 LIBRARY:  finvar.lib       LIBRARY TO CALCULATE INVARIANT RINGS & MORE
@@ -43,6 +43,4 @@
  secondary_and_irreducibles_no_molien() s.i. & irreducible s.i., without M.s.
  secondary_not_cohen_macaulay()    s.i. when invariant ring not Cohen-Macaulay
- algebra_containment()             query of algebra containment
- module_containment()              query of module containment
  orbit_variety()                   ideal of the orbit variety
  relative_orbit_variety()          ideal of a relative orbit variety
@@ -66,4 +64,5 @@
 LIB "elim.lib";
 LIB "general.lib";
+LIB "algebra.lib";
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -5621,125 +5620,4 @@
 ///////////////////////////////////////////////////////////////////////////////
 
-proc algebra_containment (poly p, ideal A)
-"USAGE:   algebra_containment(p,A); p <poly>, A <ideal> giving generators, say
-         f1,...,fm, subalgebra of the basering
-RETURN:  1 (TRUE) (type <int>) if p is contained in the subalgebra K[f1,...,fm]
-         0 (FALSE) (type <int>) if p is not contained
-DISPLAY: a representation of p in terms of algebra generators fi=y(i) if p
-         is contained in the subalgebra, provided printlevel>=1
-         (default: printlevel=0)
-THEORY:  The ideal of algebraic relations of the algebra generators f1,...,fm
-         given by A is computed introducing new variables y(i) and the product
-         order with x(i) >> y(i) where x(i) are the variable of the basering.
-         p reduces to a polynomial only in the y(i) <=> p is contained in the
-         subring generated by the polynomials f1,...,fm in A.
-EXAMPLE: example algebra_containment; shows an example
-"
-{ int DEGB = degBound;
-  degBound=0;
-  def br=basering;
-  int n=nvars(br);
-  int m=ncols(A);
-  string mp=string(minpoly);
-  execute "ring R=("+charstr(br)+"),(x(1..n),y(1..m)),(dp(n),dp(m));";
-  execute "minpoly=number("+mp+");";
-  ideal vars=x(1..n);
-  map emb=br,vars;
-  ideal A=ideal(emb(A));
-  poly check=emb(p);
-  for (int i=1;i<=m;i++)
-  { A[i]=A[i]-y(i);
-  }
-  A=std(A);
-  check=reduce(check,A);
-  degBound = DEGB;
-  if( sum(leadexp(check),1..n) == 0 )
-  { dbprint(printlevel-voice+2,"// "+string(check));
-    return(1);
-  }
-  else
-  { return(0);
-  }
-}
-example
-{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
-         ring R=0,(x,y,z),dp;
-         matrix A[1][7]=x2+y2,z2,x4+y4,1,x2z-1y2z,xyz,x3y-1xy3;
-         poly p1=x10z3-x8y2z3+2x6y4z3-2x4y6z3+x2y8z3-y10z3+x6z4+3x4y2z4+3x2y4z4+y6z4;
-         printlevel=2;
-         algebra_containment(p1,A);
-         poly p2=z;
-         algebra_containment(p2,A);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc module_containment(poly p, matrix P, matrix S)
-"USAGE:  module_containment(p,P,S); p <poly>, P <ideal>, generators of an
-         algebra, S <ideal>, generators of a module over the algebra generated
-         by P
-ASSUME:  ncols(P)=number of variables in the basering and the generators in P
-RETURNS: 1 (TRUE) (type <int>) if p is contained in the module
-         0 (FALSE) type <int>) if p is not contained
-DISPLAY: the representation of p in terms of algebra generators P[i]=z(i) and
-         module generators S[j]=y(j) if p is contained in the module
-THEORY:  The ideal of algebraic relations of all the generators p1,...,pn,
-         s1,...,st given by P and S is computed introducing new variables y(j),
-         z(i) and the product order: x^a*y^b*z^c > x^d*y^e*z^f if x^a > x^d
-         with respect to the lp ordering or else if z^c > z^f with respect to
-         the dp ordering or else if y^b > y^e with respect to the lp ordering
-         again. p reduces to a polynomial only in the y(j) and z(i), linear in
-         the z(i) <=> p is contained in the module.
-EXAMPLE: example module_containment; shows an example
-"
-{ def br=basering;
-  int DEGB=degBound;
-  degBound=0;
-  int n=nvars(br);
-  if (ncols(P)==n)
-  { int m=ncols(S);
-    string mp=string(minpoly);
-    execute "ring R=("+charstr(br)+"),(x(1..n),y(1..m),z(1..n)),(lp(n),dp(m),lp(n));";
-    execute "minpoly=number("+mp+");";
-    ideal vars=x(1..n);
-    map emb=br,vars;
-    matrix P=emb(P);
-    matrix S=emb(S);
-    ideal check=emb(p);
-    ideal I;
-    for (int i=1;i<=m;i++)
-    { I[i]=S[1,i]-y(i);
-    }
-    for (i=1;i<=n;i++)
-    { I[m+i]=P[1,i]-z(i);
-    }
-    I=std(I);
-    check[1]=reduce(check[1],I);
-    I=elim(check,1,n);                 // checking whether all variables from
-    if (I[1]<>0)                       // the former ring have disappeared
-    { dbprint(printlevel-voice+2,"// "+string(check));
-      return(1);
-    }
-    else
-    { return(0);
-    }
-  }
-  else
-   { "ERROR: the first ideal must have nvars(basering) entries";
-    return();
-  }
-}
-example
-{ "EXAMPLE: Sturmfels: Algorithms in Invariant Theory 2.3.7:"; echo=2;
-         ring R=0,(x,y,z),dp;
-         matrix P[1][3]=x2+y2,z2,x4+y4;
-         matrix S[1][4]=1,x2z-1y2z,xyz,x3y-1xy3;
-         poly p1=x10z3-x8y2z3+2x6y4z3-2x4y6z3+x2y8z3-y10z3+x6z4+3x4y2z4+3x2y4z4+y6z4;
-         printlevel=2;
-         module_containment(p1,P,S);
-         poly p2=z;
-         module_containment(p2,P,S);
-}
-///////////////////////////////////////////////////////////////////////////////
-
 proc orbit_variety (matrix F,string newring)
 "USAGE:   orbit_variety(F,s);
