ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 30 Jul 2022 07:38:10 +0200How to test element is in multivariate function field's idealhttps://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/I'm trying to calculate the valuation of a function in a the function field of a coordinate ring $K(V) = \{ f / g : f, g \in K[V] \}$.
My first attempt is to construct the coordinate ring $K[V] = K[x, y] / \langle C(x, y) \rangle$
sage: K.<x, y> = Integers(11)[]
sage: S = K.quotient(y^2 - x^3 - 4*x)
sage: S
Quotient of Multivariate Polynomial Ring in x, y over Ring of integers modulo 11 by the ideal (10*x^3 + y^2 + 7*x)
Now I want to see if a function $f = y - 2x$ lies in the ideal $I = \langle u \rangle$ where $u = x - 2$.
sage: I = S.ideal(x - 2)
sage: S(y - 2*x) in I
False
But sage is wrong. $y - 2x \in \langle x - 2 \rangle$ as shown by the following code:
sage: f1 = S(y - 2*x)
sage: f1
9*xbar + ybar
sage: f2 = S(
....: (x - 2) * (
....: (x - 2)^2*(y + 4) - 5*(x - 2)*(y + 4) - 2*((x - 2)^3 - 5*(x - 2)^2 + 5*(x - 2)
....: ))) / S((y + 4)^2)
sage: f2
9*xbar + ybar
sage: bool(f1 == f2)
True
As plainly visible, f2 has the factor $(x - 2)$.
How can I calculate this in sage without having to factor the polynomial myself?
I assume this is because we need an actual function field in sage, but I get singular errors when I attempt to turn S into a fraction field.
sage: K.<x, y> = Integers(11)[]
sage: S = K.quotient(y^2 - x^3 - 4*x)
sage: R = FractionField(S)
# ...
RuntimeError: error in Singular function call 'primdecSY':
ASSUME failed: ASSUME(0, hasFieldCoefficient(basering) );
error occurred in or before primdec.lib::primdecSY_i line 5983: ` return (attrib(rng,"ring_cf")==0);`
leaving primdec.lib::primdecSY_i (5983)
Is there a way to construct local rings and maximal ideals? Or a way to calculate valuations (order of vanishing for poles and zeros) on elliptic curves?
ThanksThu, 28 Jul 2022 07:20:00 +0200https://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/Answer by Max Alekseyev for <p>I'm trying to calculate the valuation of a function in a the function field of a coordinate ring $K(V) = { f / g : f, g \in K[V] }$.</p>
<p>My first attempt is to construct the coordinate ring $K[V] = K[x, y] / \langle C(x, y) \rangle$</p>
<pre><code>sage: K.<x, y> = Integers(11)[]
sage: S = K.quotient(y^2 - x^3 - 4*x)
sage: S
Quotient of Multivariate Polynomial Ring in x, y over Ring of integers modulo 11 by the ideal (10*x^3 + y^2 + 7*x)
</code></pre>
<p>Now I want to see if a function $f = y - 2x$ lies in the ideal $I = \langle u \rangle$ where $u = x - 2$.</p>
<pre><code>sage: I = S.ideal(x - 2)
sage: S(y - 2*x) in I
False
</code></pre>
<p>But sage is wrong. $y - 2x \in \langle x - 2 \rangle$ as shown by the following code:</p>
<pre><code>sage: f1 = S(y - 2*x)
sage: f1
9*xbar + ybar
sage: f2 = S(
....: (x - 2) * (
....: (x - 2)^2*(y + 4) - 5*(x - 2)*(y + 4) - 2*((x - 2)^3 - 5*(x - 2)^2 + 5*(x - 2)
....: ))) / S((y + 4)^2)
sage: f2
9*xbar + ybar
sage: bool(f1 == f2)
True
</code></pre>
<p>As plainly visible, f2 has the factor $(x - 2)$.</p>
<p>How can I calculate this in sage without having to factor the polynomial myself?</p>
<p>I assume this is because we need an actual function field in sage, but I get singular errors when I attempt to turn S into a fraction field.</p>
<pre><code>sage: K.<x, y> = Integers(11)[]
sage: S = K.quotient(y^2 - x^3 - 4*x)
sage: R = FractionField(S)
# ...
RuntimeError: error in Singular function call 'primdecSY':
ASSUME failed: ASSUME(0, hasFieldCoefficient(basering) );
error occurred in or before primdec.lib::primdecSY_i line 5983: ` return (attrib(rng,"ring_cf")==0);`
leaving primdec.lib::primdecSY_i (5983)
</code></pre>
<p>Is there a way to construct local rings and maximal ideals? Or a way to calculate valuations (order of vanishing for poles and zeros) on elliptic curves?</p>
<p>Thanks</p>
https://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/?answer=63435#post-id-63435First, the multivariate ideal machinery in Sage is known to be buggy over non-fields, and `Integers(11)` is not recognized as a field. Replace it with `GF(11)`.
Second, since computation of `f2` involves division by `S((y + 4)^2)`, you indeed need to define `S` as a fraction field:
K.<x, y> = GF(11)[]
S = K.quotient(y^2 - x^3 - 4*x).fraction_field()
to get `S(y - 2*x)` in `I`.Thu, 28 Jul 2022 15:43:23 +0200https://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/?answer=63435#post-id-63435Comment by Max Alekseyev for <p>First, the multivariate ideal machinery in Sage is known to be buggy over non-fields, and <code>Integers(11)</code> is not recognized as a field. Replace it with <code>GF(11)</code>.</p>
<p>Second, since computation of <code>f2</code> involves division by <code>S((y + 4)^2)</code>, you indeed need to define <code>S</code> as a fraction field:</p>
<pre><code>K.<x, y> = GF(11)[]
S = K.quotient(y^2 - x^3 - 4*x).fraction_field()
</code></pre>
<p>to get <code>S(y - 2*x)</code> in <code>I</code>.</p>
https://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/?comment=63453#post-id-63453No surprise here. Since `1/(x-2)` is in `S`, the ideal `I` in fact represents the whole `S`.Sat, 30 Jul 2022 07:38:10 +0200https://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/?comment=63453#post-id-63453Comment by narodnik for <p>First, the multivariate ideal machinery in Sage is known to be buggy over non-fields, and <code>Integers(11)</code> is not recognized as a field. Replace it with <code>GF(11)</code>.</p>
<p>Second, since computation of <code>f2</code> involves division by <code>S((y + 4)^2)</code>, you indeed need to define <code>S</code> as a fraction field:</p>
<pre><code>K.<x, y> = GF(11)[]
S = K.quotient(y^2 - x^3 - 4*x).fraction_field()
</code></pre>
<p>to get <code>S(y - 2*x)</code> in <code>I</code>.</p>
https://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/?comment=63452#post-id-63452For example:
sage: K.<x, y> = GF(11)[]
sage: S = K.quotient(y^2 - x^3 - 4*x)
sage: I = S.ideal(x - 2)
sage: I
Ideal (xbar - 2) of Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 11 by the ideal (-x^3 + y^2 - 4*x)Sat, 30 Jul 2022 07:33:26 +0200https://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/?comment=63452#post-id-63452Comment by narodnik for <p>First, the multivariate ideal machinery in Sage is known to be buggy over non-fields, and <code>Integers(11)</code> is not recognized as a field. Replace it with <code>GF(11)</code>.</p>
<p>Second, since computation of <code>f2</code> involves division by <code>S((y + 4)^2)</code>, you indeed need to define <code>S</code> as a fraction field:</p>
<pre><code>K.<x, y> = GF(11)[]
S = K.quotient(y^2 - x^3 - 4*x).fraction_field()
</code></pre>
<p>to get <code>S(y - 2*x)</code> in <code>I</code>.</p>
https://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/?comment=63450#post-id-63450But why now does it say True for all powers of the ideal? The valuation of this function on the curve is 2, so the output here is wrong:
sage: S(y - 2*x) in I
True
sage: S(y - 2*x) in I^2
True
sage: S(y - 2*x) in I^3
True
The last line should be false. In fact it says they are all the same ideal:
sage: K.<x, y> = GF(11)[]
sage: S = K.quotient(y^2 - x^3 - 4*x).fraction_field()
sage: I = S.ideal(x - 2)
sage: I
Principal ideal (1) of Fraction Field of Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 11 by the ideal (-x^3 + y^2 - 4*x)
sage: I^3
Principal ideal (1) of Fraction Field of Quotient of Multivariate Polynomial Ring in x, y over Finite Field of size 11 by the ideal (-x^3 + y^2 - 4*x)Fri, 29 Jul 2022 18:23:32 +0200https://ask.sagemath.org/question/63429/how-to-test-element-is-in-multivariate-function-fields-ideal/?comment=63450#post-id-63450