How to test element is in multivariate function field's 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?
Thanks