# bug in kernel of ring homomorphism of quotient rings

Reported by: Owned by: gh-mwageringel major sage-9.3 commutative algebra slelievre, tscrim Markus Wageringel Travis Scrimshaw N/A 0aba8a0 0aba8a061aa148ca448be2d8661744f27c485065

### Description

As reported on sage-devel:

```sage: A.<t> = QQ[]
sage: B.<x,y> = QQ[]
sage: H = B.quotient(B.ideal([B.1]))
sage: f = A.hom([H.0], H)
sage: f.kernel()
Principal ideal (t) of Univariate Polynomial Ring in t over Rational Field
```

whereas the kernel should be the zero ideal.

### comment:1 follow-up: ↓ 5 Changed 16 months ago by gh-mwageringel

• Branch set to u/gh-mwageringel/31367
• Commit set to 0aba8a061aa148ca448be2d8661744f27c485065
• Status changed from new to needs_review

The problem indeed only occurs with quotient rings, as the implementation switches from the quotient to the cover ring in order to compute an elimination ideal. For this, the elimination variables need to be lifted from the quotient to the cover ring. However, one of the generator variables of the quotient ring is 0 in the example, so `0.lift()` gives 0 again, rather than a variable of the cover ring. I have fixed this by taking the correct variables from the cover ring directly.

In more detail, the problematic call to `elimination_ideal` is of this kind:

```sage: R.<x,y,z> = QQ[]
sage: R.ideal(x-y, z).elimination_ideal([y, R(0)])
Ideal (x - y, z) of Multivariate Polynomial Ring in x, y, z over Rational Field
```

This is a usage error because it calls `elimination_ideal` with a 0 instead of a variable. The implementation then calls libsingular with the product of the passed variables, which is 0 again, so nothing gets eliminated.

A question that remains is whether `elimination_ideal` should validate its arguments in order to make sure they are all variables of the ring. This can be a different ticket though.

New commits:

 ​0aba8a0 `31367: fix elimination in case of quotient rings`

### comment:2 Changed 15 months ago by gh-mwageringel

The bot is green. Please review.

### comment:3 Changed 15 months ago by tscrim

• Reviewers set to Travis Scrimshaw
• Status changed from needs_review to positive_review

LGTM.

Thank you.

### comment:5 in reply to: ↑ 1 Changed 15 months ago by gh-mwageringel

A question that remains is whether `elimination_ideal` should validate its arguments in order to make sure they are all variables of the ring. This can be a different ticket though.
I have created #31414 for validating the input of `elimination_ideal`.