add first version of finite determinacy calculations

This commit is contained in:
Nacho B. R. 2025-05-13 16:14:12 +01:00
parent 8d435326a9
commit 6c7682073d
3 changed files with 972 additions and 25 deletions

View File

@ -126,3 +126,785 @@ ideal f = y+b,x*(y2+yb+b2)+x3,y4+y3b+y2b2+yb3+b4;
kbase(std(f));
quit
;
if(0){"a";}
if(1){"a";}
;
quit;
LIB"AeCodPruebas.lib";
ring r = 0,(x,y),ds;
AeNormal(ideal(x,y2,xy));
AeNormal(ideal(x,y2,y3+x2y));
AeNormal(ideal(x,y2,y3+x19y));
AeNormal(ideal(x,y2,y3+x15y));
AeNormal(ideal(x,y2,y3+x5y));
module m;
ncols(m);
m[1]==0;
m[1]!=0;
module m = 0,0,0,0;
print(m);
m = 0*gen(1)+0*gen(2);
m;
m = 0,gen(2);
m;
m[1] == 0;
print(m);
m=0;
size(m);
quit;
LIB"AeCodPruebas.lib";
ring r = 0,(x,y),ds;
ideal f = x,y2,y3+x2y;
MaxPowerContained(f);
LIB"AeCodPruebas.lib";
MaxPowerContained(f);
LIB"AeCodPruebas.lib";
MaxPowerContained(f);
LIB"AeCodPruebas.lib";
MaxPowerContained(f);
MaxPowerContained(f);
LIB"AeCodPruebas.lib";
MaxPowerContained(f);
quit;
LIB"AeCodPruebas.lib";
LIB"AeCodPruebas.lib";
quit;
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
nn
n
n
n
n
n
n
n
n
n
n
n
p GOX
n
n
n
n
n
n
p a
p GOY
n
n
n
n
n
nn
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
p a
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
p col
n
n
n
n
n
n
p M
n
p M
n
n
n
n
n
n
n
p M
n
p M
n
n
n
n
n
n
n
n
n
n
p col
n
p col
n
n
n
n
n
n
n
p M
n
n
n
n
n
n
n
n
p M
n
n
n
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n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
p maxibound
n
n
n
n
n
p determinacyIdeal
p maxibound
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
p maxibound
p determinacyIdeal
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
p tkef
n
n
p tkef
n
n
p freemax
n
n
n
n
n
n
p freemax
n
n
p auxtke
n
n
n
n
n
p auxtke

View File

@ -186,6 +186,121 @@ proc AeNormal(ideal f, list #)
return(NAef);
}
proc MaxPowerContained(ideal f)
{
/*
f: Cn -> Cp is a map-germ with p >= n
*/
int i;
int n = nvars(basering);
int p = ncols(f);
matrix jf[p][n] = jacob(f);
module tkef = module(jf) + f*freemodule(p);
tkef = std(tkef);
int tkemax = 0;
tkefmodk = tkef + maxideal(tkemax + 1)*freemodule(p);
tkefmodk = std(tkefmodk);
module freemax = freemodule(p);
module auxtke = reduce(freemax, tkefmodk);
while (size(auxtke) != 0)
{
tkemax++;
freemax = maxideal(tkemax)*freemodule(p);
tkefmodk = tkef + maxideal(tkemax + 1)*freemodule(p);
auxtke = reduce(freemax, tkefmodk);
}
def Raux = MalgrRing(ideal(0),n,ideal(f[1..n]));
string RName=nameof(basering);
setring Raux;
execute("def f = imap("+RName+",f)");
execute("def jf = imap("+RName+",jf)");
module wf = freemodule(p);
int m = ncols(Gens);
//print("wf=");wf;//
if (p > n)
{
ideal h = ideal(f[(n+1)..p]);
//print("h=");h;//
for (i=1; i <= m-1; i++)
{
wf = wf + (freemodule(p) * (h)^i);
//print("wf=");wf;//
}
}
int maxi_contained = 0;
int maxi_power_target = 0;
module mktheta = freemodule(p);
module mk1theta = (mappingf^tkemax)*freemodule(p);
//module TAef = GenerateOYModule(jf, wf, #);
module TAef;
module Tmktheta;
module Tmk1theta;
module auxmod;
while (maxi_contained == 0)
{
maxi_power_target = maxi_power_target + 1;
mktheta = mappingf*mktheta;
mk1theta = mappingf*mk1theta;
Tmktheta = GenerateOYModule(mktheta, 0, mappingf^(maxi_power_target+1));
Tmk1theta = GenerateOYModule(mk1theta, 0, mappingf^(maxi_power_target+1));
TAef = GenerateOYModule(jf, wf, mappingf^(maxi_power_target+1));
/*Tmktheta;
"---";
TAef;
"---";
Tmk1theta;
*/
/*
mktheta;
Tmktheta;
maxOX^(maxi_power+1);
*/
auxmod = reduce(Tmktheta, std(Tmk1theta + TAef));
//reduce(Tmktheta,std(Tmk1theta));
//std(TAef);
if (size(auxmod)==0)
{
maxi_contained = 1;
}
}
/*
execute("setring(" + RName + ")");
module NAef = imap(Raux, NAef);
*/
int maxi_power = 1;
ideal mpfmax = std(mappingf^maxi_power_target);
while (size(reduce(maxOX^maxi_power, mpfmax))!=0)
{
maxi_power = maxi_power +1;
}
return(maxi_power);
}
//////////////////////////////////////////////////////////////////////////////
proc NormalOYModule(matrix GOX, matrix GOY, list #)
@ -327,7 +442,15 @@ proc GenerateOYModule(matrix GOX, matrix GOY, list #)
int ny = ncols(GOY);
int nx = ncols(GOX);
int a = nrows(GOY);
if (size(module(GOY)) != 0)
{
int a = nrows(GOY);
}
else
{
int a = nrows(GOX);
}
module M = 0; // This will be module with the same generators but over O_n
@ -343,19 +466,22 @@ proc GenerateOYModule(matrix GOX, matrix GOY, list #)
for (i=1; i<= ny; i++)
{
col = submat(GOY,intvec(1..a),intvec(i)); // Pick the next generator in GOY
if (s>0)
if (GOY[i]!=0)
{
M = M + MatrixToVector(MalgrFormVect(col, mappingf^k)); // Convert to GOX
}
else
{
auxcol = MalgrFormVect(col);
M = M + MatrixToVector(auxcol); // Convert to GOX
if (MalgrFormToOX(auxcol) != col and flag_unit == 0)
col = submat(GOY,intvec(1..a),intvec(i)); // Pick the next generator in GOY
if (s>0)
{
print("Warning: a unit has been used for the MalgrForm of the target module. Computations might not be accurate.");
flag_unit = 1;
M = M + MatrixToVector(MalgrFormVect(col, mappingf^k)); // Convert to GOX
}
else
{
auxcol = MalgrFormVect(col);
M = M + MatrixToVector(auxcol); // Convert to GOX
if (MalgrFormToOX(auxcol) != col and flag_unit == 0)
{
print("Warning: a unit has been used for the MalgrForm of the target module. Computations might not be accurate.");
flag_unit = 1;
}
}
}
}
@ -370,16 +496,19 @@ proc GenerateOYModule(matrix GOX, matrix GOY, list #)
for (i=1; i <= nx; i++)
{
col = submat(GOX,intvec(1..a),intvec(i)); // Pick the next generator in GOX
for (j=1; j<= m; j++)
if (GOX[i]!=0)
{
if (s>0)
col = submat(GOX,intvec(1..a),intvec(i)); // Pick the next generator in GOX
for (j=1; j<= m; j++)
{
M = M + MatrixToVector(MalgrFormVect(Gens[j]*col, mappingf^k)); // Convert to GOX
}
else
{
M = M + MatrixToVector(MalgrFormVect(Gens[j]*col));
if (s>0)
{
M = M + MatrixToVector(MalgrFormVect(Gens[j]*col, mappingf^k)); // Convert to GOX
}
else
{
M = M + MatrixToVector(MalgrFormVect(Gens[j]*col));
}
}
}
}
@ -653,7 +782,7 @@ proc MalgrFormVect(matrix v, list #)
{
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.
}
/* Caution: We do not compute again a standard basis of K since this would be equivalent to computing
the polynomial of the image when p > n and this is too computationally expensive. */
@ -755,6 +884,7 @@ proc MalgrFormVect(matrix v, list #)
//////////////////////////////////////////////////////////////////////////////
proc MatrixToVector(matrix M)

View File

@ -1,11 +1,46 @@
LIB"AeCodPruebas.lib";
ring r = 0,(x,y,z),ds;
ring r = 0,(x,y),ds;
int i;
ideal f = x,y,yz+z6+z8,z3+xz;
matrix jf = jacob(f);
ideal f = x, xy+y6+y9;
ideal mappingf = f[1..nvars(r)];
//breakpoint(MaxPowerContained);
AeNormal(f,maxideal(2));
//AeNormal(f,maxideal(3));quit;
int k = MaxPowerContained(f);
int a = 0;
ideal aux1 = 0;
ideal aux2 = 0;
k;
while (size(aux1)==0 && size(aux2)==0)
{
a++;
aux1 = reduce(maxideal(k), std(mappingf^a));
aux2 = reduce(maxideal(k-1), std(mappingf^a));
}
a;
if (size(aux1)!=0)
{
"warning!";
}
AeNormal(f, maxideal(a));
//breakpoint(GenerateOYModule,464);
//breakpoint(MalgrFormVect);
/*
int k = MaxPowerContained(f);
int a = 1;
ideal mappingf = f[1..nvars(r)];
ideal auxred=reduce(mappingf^k, maxideal(1));
TargetIdeal(f,maxideal(5));
*/
//AeNormal(f, );
/*
def Q = MalgrRing(ideal(0),2,ideal(x,y2));