Opened 11 years ago

Closed 6 years ago

# Bug in mapping to residue fields

Reported by: Owned by: cremona davidloeffler major sage-duplicate/invalid/wontfix number fields residue field was, justin, ylchapuy John Cremona N/A

### Description

See #9417:

```sage: K.<a> = NumberField(x^2+18*x+1)
sage: P = K.ideal(2)
sage: F = K.residue_field(P)
sage: R = PolynomialRing(F, 'x')
sage: R([0, a, a, 1])
x^3 + abar*x^2 + abar*x
sage: F(a)
1
sage: a.minpoly()
x^2 + 18*x + 1
sage: F.gen()
abar
sage: F.gen().minpoly()
x^2 + x + 1
```

The polynomial `x^3+a*x^2+a*x` reduced modulo P=(2) wrongly to `x^3+abar*x^2+abar*x`. Although the generator of the residue field F is suggestively called abar, it it *not* the reduction of a mod P (which is 1 mod P).

### comment:1 Changed 11 years ago by cremona

Note that this is correct:

```R([F(co) for co in [0,a,a,1]])
```

I think the problem lies in lines 94-108 of sage/rings/polynomial/polynomial_zz_pex.pyx, hence I am CC-int Yann L-C! Meanwhile I am using that work-around for #9417.

### comment:2 Changed 11 years ago by ylchapuy

polynomial_zz_pex.pyx is not intended to be used for this base ring (maybe it could but it wasn't thought like this). The constructor of the univariate polynomials ring should be more careful.

And I'm sorry, but I won't have time to do this myself.

### comment:3 Changed 11 years ago by cremona

Thanks for reporting back. I'll try to fix this myself, but in any case I was able to use a simple workaround.

### comment:4 Changed 8 years ago by jdemeyer

• Milestone changed from sage-5.11 to sage-5.12

### comment:5 Changed 8 years ago by vbraun_spam

• Milestone changed from sage-6.1 to sage-6.2

### comment:6 Changed 8 years ago by vbraun_spam

• Milestone changed from sage-6.2 to sage-6.3

### comment:7 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.3 to sage-6.4

fixed?

### comment:9 follow-ups: ↓ 10 ↓ 11 Changed 6 years ago by cremona

With 6.9.beta3 I see this:

```K.<a> = NumberField(x^2+18*x+1)
sage: P = K.ideal(2)
sage: F = K.residue_field(P)
sage: R = PolynomialRing(F, 'x')
sage: R([0, a, a, 1])
x^3 + x^2 + x
```

which shows that the original issue has been fixed, though I do not know where or when.

I cannot see the "won't fix" option but that is what this should now get.

### comment:10 in reply to: ↑ 9 Changed 6 years ago by pbruin

• Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
• Status changed from new to needs_review

With 6.9.beta3 I see this:

```K.<a> = NumberField(x^2+18*x+1)
sage: P = K.ideal(2)
sage: F = K.residue_field(P)
sage: R = PolynomialRing(F, 'x')
sage: R([0, a, a, 1])
x^3 + x^2 + x
```

which shows that the original issue has been fixed, though I do not know where or when.

It might be #11239.

### comment:11 in reply to: ↑ 9 Changed 6 years ago by pbruin

• Reviewers set to John Cremona
• Status changed from needs_review to positive_review

I cannot see the "won't fix" option but that is what this should now get.

I agree.

### comment:12 Changed 6 years ago by vbraun

• Resolution set to wontfix
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.