isWellDefined(BasicDivisor) -- whether a divisor is valid

Description

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)} )) -- 1 : (ContainmentHooks) with Strategy => Inhomogeneous from -*Function[/usr/share/Macaulay2/Core/modules2.m2:331:61-331:99]*- -- (minimalPrimes,Ideal) with Strategy => Monomial from -*Function[/usr/share/Macaulay2/MinimalPrimes.m2:315:27-324:61]*- -- (trim,Module) with Strategy => Complement from -*Function[/usr/share/Macaulay2/Core/matrix2.m2:243:62-243:113]*- -- (codim,Module) with Strategy => Default from -*Function[/usr/share/Macaulay2/Core/monideal.m2:30:57-42:52]*- -- (codim,Module) with Strategy => Default from -*Function[/usr/share/Macaulay2/Core/monideal.m2:30:57-42:52]*- 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)) -- 1 : (ContainmentHooks) with Strategy => Inhomogeneous from -*Function[/usr/share/Macaulay2/Core/modules2.m2:331:61-331:99]*- -- (minimalPrimes,Ideal) with Strategy => Monomial from -*Function[/usr/share/Macaulay2/MinimalPrimes.m2:315:27-324:61]*- -- (trim,Module) with Strategy => Complement from -*Function[/usr/share/Macaulay2/Core/matrix2.m2:243:62-243:113]*- -- (codim,Module) with Strategy => Default from -*Function[/usr/share/Macaulay2/Core/monideal.m2:30:57-42:52]*- -- (codim,Module) with Strategy => Default from -*Function[/usr/share/Macaulay2/Core/monideal.m2:30:57-42:52]*- o5 = true i6 : isWellDefined(divisor({1}, {ideal(x,y)})) -- 1 : (ContainmentHooks) with Strategy => Inhomogeneous from -*Function[/usr/share/Macaulay2/Core/modules2.m2:331:61-331:99]*- -- (minimalPrimes,Ideal) with Strategy => Monomial from -*Function[/usr/share/Macaulay2/MinimalPrimes.m2:315:27-324:61]*- -- (trim,Module) with Strategy => Complement from -*Function[/usr/share/Macaulay2/Core/matrix2.m2:243:62-243:113]*- -- (codim,Module) with Strategy => Default from -*Function[/usr/share/Macaulay2/Core/monideal.m2:30:57-42:52]*- -- 1 : (ContainmentHooks) with Strategy => Inhomogeneous from -*Function[/usr/share/Macaulay2/Core/modules2.m2:331:61-331:99]*- -- 1 : (ContainmentHooks) with Strategy => Inhomogeneous from -*Function[/usr/share/Macaulay2/Core/modules2.m2:331:61-331:99]*- -- (codim,Module) with Strategy => Default from -*Function[/usr/share/Macaulay2/Core/monideal.m2:30:57-42:52]*- (isWellDefined, BasicDivisor): Not all ideals are height one o6 = false i7 : isWellDefined(divisor({1}, {ideal(x^2)})) -- 1 : (ContainmentHooks) with Strategy => Inhomogeneous from -*Function[/usr/share/Macaulay2/Core/modules2.m2:331:61-331:99]*- -- (minimalPrimes,Ideal) with Strategy => Monomial from -*Function[/usr/share/Macaulay2/MinimalPrimes.m2:315:27-324:61]*- -- (trim,Module) with Strategy => Complement from -*Function[/usr/share/Macaulay2/Core/matrix2.m2:243:62-243:113]*- -- (codim,Module) with Strategy => Default from -*Function[/usr/share/Macaulay2/Core/monideal.m2:30:57-42:52]*- -- 1 : (ContainmentHooks) with Strategy => Inhomogeneous from -*Function[/usr/share/Macaulay2/Core/modules2.m2:331:61-331:99]*- (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