Opened 9 years ago

# libsingular reduces polynomials incompletely — at Version 10

Reported by: Owned by: SimonKing malb major sage-9.3 commutative algebra multivariate polynomial reduction malb Samuel Lelièvre N/A public/12529 5b3253a14e46a97e783d5800cc20898bd1bb6957 todo

On sage-support, Oleksandr Kazymyrov reported the following:

```sage: gens = 'y a0 a1 a2 b0 b1 b2 c1 c2 d0 d1 d2 d3 d4 d5 d6 d7'.split()
sage: R = PolynomialRing(GF(8), 17, gens)
sage: R.inject_variables(verbose=False)
sage: A, B, C = a0 + a1*y + a2*y^2, b0 + b1*y + b2*y^2, c1*y + c2*y^2
sage: D = d0 + d1*y + d2*y^2 + d3*y^3 + d4*y^4 + d5*y^5 + d6*y^6 + d7*y^7
sage: F = D.subs({y: B})
sage: G = A.subs({y: F}) + C
sage: g = G.mod(y^8 + y)
sage: g.degree(y)
14
```

This is now fixed and we add a doctest:

```sage: g.degree(y)
7
```

The problem may have been in libsingular, rather than in Singular.

It may have been tail reduction not being done.

### comment:1 Changed 9 years ago by jdemeyer

• Priority changed from blocker to critical

I don't believe all basic arithmetic failures should be blockers, and it's dubious that this issue is even about "basic" arithmetic.

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

• Milestone changed from sage-5.11 to sage-5.12

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

• Milestone changed from sage-6.1 to sage-6.2

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

• Milestone changed from sage-6.2 to sage-6.3

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

• Milestone changed from sage-6.3 to sage-6.4

### comment:6 Changed 6 years ago by jakobkroeker

• Stopgaps set to todo

### comment:7 Changed 8 months ago by kedlaya

I just tried this and got an answer consistent with Singular. Maybe close this as a duplicate?

### comment:8 Changed 7 months ago by slelievre

• Milestone changed from sage-6.4 to sage-9.3
• Priority changed from critical to major

Condensed version of the initial report, as a tentative doctest:

```sage: gens = 'y a0 a1 a2 b0 b1 b2 c1 c2 d0 d1 d2 d3 d4 d5 d6 d7'.split()
sage: R = PolynomialRing(GF(8), 17, gens)
sage: R.inject_variables(verbose=False)
sage: A, B, C = a0 + a1*y + a2*y^2, b0 + b1*y + b2*y^2, c1*y + c2*y^2
sage: D = d0 + d1*y + d2*y^2 + d3*y^3 + d4*y^4 + d5*y^5 + d6*y^6 + d7*y^7
sage: F = D.subs({y: B})
sage: G = A.subs({y: F}) + C
sage: g = G.mod(y^8 + y)
sage: g.degree(y)
7
```

This was fixed by #27508 (Force tail reduction in polynomial quotient ring).

It was merged in Sage 9.1.rc2, from which version on we get the correct value: 7.

In Sage <= 9.1.rc1, we get an incorrect value: 14.

If someone can suggest where to locate this doctest, I can push a branch.

Priority down from critical to major: bug fixed, only a doctest is needed.

Last edited 7 months ago by slelievre (previous) (diff)

### comment:9 Changed 7 months ago by kedlaya

I would suggest to put the doctest in `sage/rings/polynomial/polynomial_element.pyx` under `mod` or `__mod__`.

### comment:10 Changed 7 months ago by slelievre

• Authors set to Samuel Lelièvre
• Branch set to public/12529
• Commit set to 5b3253a14e46a97e783d5800cc20898bd1bb6957
• Description modified (diff)
• Milestone changed from sage-9.3 to sage-9.2
• Status changed from new to needs_review

 ​5b3253a `Add doctest for remainder in multivariate polynomial ring`