This function tries to verify that this is a valid divisor. It checks that the coefficients are from the right ring (in the WeilDivisor/QWeilDivisor/RWeilDivisor cases at least). It also checks to make sure all the ideals are from the same ring, are prime, and have height one. If debugLevel > 0, the function will print an message explaining why the divisor was not valid.
i1 : debugLevel = 1;
|
i2 : R = QQ[x,y];
|
i3 : isWellDefined(divisor({1}, {ideal(x)} ))
-- (minimalPrimes,Ideal) with Strategy => Monomial from FunctionClosure[/usr/local/share/Macaulay2/MinimalPrimes.m2:304:16-313:63]
-- (trim,Module) with Strategy => PID from FunctionClosure[/usr/local/share/Macaulay2/Core/matrix2.m2:252:4-255:9]
o3 = true
|
i4 : isWellDefined(divisor({1/2}, {ideal(x)} ))
(isWellDefined, BasicDivisor): Not all coefficients are integers
o4 = false
|
i5 : isWellDefined(divisor({1/2}, {ideal(x)}, CoefficientType=>QQ))
-- (minimalPrimes,Ideal) with Strategy => Monomial from FunctionClosure[/usr/local/share/Macaulay2/MinimalPrimes.m2:304:16-313:63]
-- (trim,Module) with Strategy => PID from FunctionClosure[/usr/local/share/Macaulay2/Core/matrix2.m2:252:4-255:9]
o5 = true
|
i6 : isWellDefined(divisor({1}, {ideal(x,y)}))
-- (minimalPrimes,Ideal) with Strategy => Monomial from FunctionClosure[/usr/local/share/Macaulay2/MinimalPrimes.m2:304:16-313:63]
-- (trim,Module) with Strategy => PID from FunctionClosure[/usr/local/share/Macaulay2/Core/matrix2.m2:252:4-255:9]
(isWellDefined, BasicDivisor): Not all ideals are height one
o6 = false
|
i7 : isWellDefined(divisor({1}, {ideal(x^2)}))
-- (minimalPrimes,Ideal) with Strategy => Monomial from FunctionClosure[/usr/local/share/Macaulay2/MinimalPrimes.m2:304:16-313:63]
-- (trim,Module) with Strategy => PID from FunctionClosure[/usr/local/share/Macaulay2/Core/matrix2.m2:252:4-255:9]
(isWellDefined, BasicDivisor): Not all ideals are prime
o7 = false
|
i8 : S = QQ[a,b];
|
i9 : isWellDefined(divisor({1,2}, {ideal(x), ideal(a)}))
(isWellDefined, BasicDivisor): Not all ideals have the same ambient ring
o9 = false
|