From e2717632d5530a47f399fdf9a21ab1951423945c Mon Sep 17 00:00:00 2001 From: Nelynx Date: Thu, 27 Feb 2025 16:33:03 +0100 Subject: [PATCH] add option to work modulo an ideal --- .singularhistory | 33 +++++++++++++++++++++++++++++ AeCodPruebas.lib | 55 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/.singularhistory b/.singularhistory index 0e210ae..387b5bc 100644 --- a/.singularhistory +++ b/.singularhistory @@ -12,3 +12,36 @@ f = imap(s,f); f; kbase(std(f)); quit; +LIB"AeCodPruebas.lib"; +ring r = 0,(x,y),ds; +ideal f = x,y2,y3+x2y; +def Q = MalgrRing(ideal(0),2,f); +setring Q; +TargetIdeal(ideal(x,y)); +LIB"AeCodPruebas.lib"; +TargetIdeal(ideal(x,y)); +LIB"AeCodPruebas.lib"; +TargetIdeal(ideal(x,y)); +LIB"AeCodPruebas.lib"; +TargetIdeal(ideal(x,y)); +LIB"AeCodPruebas.lib"; +TargetIdeal(ideal(x,y)); +LIB"AeCodPruebas.lib"; +TargetIdeal(ideal(x,y)); +LIB"AeCodPruebas.lib"; +TargetIdeal(ideal(x,y)); +LIB"AeCodPruebas.lib"; +TargetIdeal(ideal(x,y)); +LIB"AeCodPruebas.lib"; +TargetIdeal(ideal(x,y)); +ring r = 0,(x,y),ds; +ideal f = x,y2,y3+x2y; +LIB"AeCodPruebas.lib"; +TargetIdeal(f, ideal(x,y)); +TargetIdeal(f, std(ideal(x,y))); +LIB"AeCodPruebas.lib"; +TargetIdeal(f, std(ideal(x,y))); +LIB"AeCodPruebas.lib"; +ring r = 0,(x,y),ds; +ideal f = x,y2,y3+x2y; +TargetIdeal(f, std(ideal(x,y))); diff --git a/AeCodPruebas.lib b/AeCodPruebas.lib index b556470..b63cb69 100644 --- a/AeCodPruebas.lib +++ b/AeCodPruebas.lib @@ -123,6 +123,13 @@ proc AeNormal(ideal f, list #) int n = nvars(basering); int p = ncols(f); + int s = size(#); + + if (s > 0) + { + int k = TargetIdeal(f,std(#[1])); + } + def Raux = MalgrRing(ideal(0),n,ideal(f[1..n])); matrix jf[p][n] = jacob(f); @@ -133,7 +140,11 @@ proc AeNormal(ideal f, list #) execute("def f = imap("+RName+",f)"); execute("def jf = imap("+RName+",jf)"); - execute("def # = imap("+RName+",#)"); + + if (s > 0) + { + execute("def # = imap("+RName+",#)"); + } module wf = freemodule(p); int m = ncols(Gens); @@ -150,6 +161,11 @@ proc AeNormal(ideal f, list #) } } + if (s>0) + { + wf = wf + freemodule(p)*(f^k); + } + if (size(#)>0) { jf = jf + #[1]*freemodule(p); @@ -218,6 +234,39 @@ proc NormalOYModule(matrix GOX, matrix GOY, list #) ////////////////////////////////////////////////////////////////////////////// + +proc TargetIdeal(ideal f, ideal J) +{ + /* + Ideal f should be a finite map. + Ideal J should be an ideal in O_X in STD form, such that the radical of J is the maximal ideal. + OUTPUT: An integer k such that f^k is contained in J. + */ + + int done = 0; + int k = 1; + + ideal auxf = 1; + + while (done == 0) + { + auxf = auxf*f; + if (size(reduce(auxf,J,1)) == 0) + { + done = 1; + } + else + { + k++; + } + } + + return(k); + +} + +////////////////////////////////////////////////////////////////////////////// + proc GenerateOYModule(matrix GOX, matrix GOY, list #) { /* @@ -383,7 +432,7 @@ proc MalgrFormPoly(poly h, list #) { K = std(#[1]+GF); // Work modulo an ideal, if requested. } - + for (i=dimX+1; i <= size(mappingf); i++) { K = K + ideal(X(i) - reduce(mappingf[i], K)); // Assign the components of f which do not give the finite mapping to variables in the target, if p > n. @@ -399,7 +448,6 @@ proc MalgrFormPoly(poly h, list #) poly c; int nGens = ncols(Gens); - // Convert the Malgrange Normal Form of the polynomial to row matrix form. /* @@ -408,6 +456,7 @@ proc MalgrFormPoly(poly h, list #) We only need to extract these coefficients and add them to the corresponding component in v. */ + matrix v[1][nGens] = 0; for (i=1; i<= nGens-1; i++)