Opened 3 years ago

# exact division sometimes fails in QQbar[x,y]

Reported by: Owned by: gh-BrentBaccala minor sage-8.3 commutative algebra N/A

### Description

The following example (cribbed from Sage's multivariate polynomial discriminant code and an algebraic curve test case) is an exact division (output suppressed for brevity):

```sage: R.<x,y> = QQ[]
sage: f = 3*x*(x-1)*y^4 -4*(x-1)*(x-2)*y^3 + (4/27)*(x-2)^4
sage: ans = f.resultant(f.derivative(y), y) / (f.coefficient(y^4))
sage: R(ans);
```

However, if we try the same thing over `QQbar`, it doesn't work:

```sage: R.<x,y> = QQbar[]
sage: f = 3*x*(x-1)*y^4 -4*(x-1)*(x-2)*y^3 + (4/27)*(x-2)^4
sage: ans = f.resultant(f.derivative(y), y) / (f.coefficient(y^4))
sage: R(ans);
TypeError: unable to coerce since the denominator is not 1
```

In both cases, `ans` comes back in a fraction field, though in the first example, it is a polynomial and be converted back to `R`. In the second example, it is an (improper) rational function.

`ans` doesn't involve `y`, and one way to "fix" this is to convert into `QQbar[x]` before performing the division:

```sage: R.<x,y> = QQbar[]
sage: f = 3*x*(x-1)*y^4 -4*(x-1)*(x-2)*y^3 + (4/27)*(x-2)^4
sage: Rx = QQbar[x]
sage: ans = Rx(f.resultant(f.derivative(y), y)) / Rx(f.coefficient(y^4))
sage: R(Rx(ans));
```

`ans` still comes back in a fraction field, and has to be converted to `Rx` before it can be converted to `R`, but at least the univariate code recognizes it as an exact division, where the multivariate code seems not to.

### Change History (0)

Note: See TracTickets for help on using tickets.