Testing if a (list of) polynomial(s) belongs to an ideal given by a Gröbner basis

### 10.6.3 Testing if a (list of) polynomial(s) belongs to an ideal given by a Gröbner basis

The in_ideal command determines whether or not a polynomial is in an ideal.

- in_ideal takes three mandatory arguments and one optional argument:
  - P, a polynomial or a list of polynomials.
  - gbasis, a list giving a Gröbner basis.
  - vars, the list of polynomial variables.

    If gbasis is computed with a different order from the default, then vars must use the same order.

  - Optionally, an optional argument from gbasic (see Section 10.6.1), such as plex or tdeg. By default it will be plex.
- in_ideal(P,gbasis,vars ⟨,option ⟩) returns the value true (1) or false (0), or a list of trues and falses, indicating whether or not the polynomial(s) in P are in the ideal generated by gbasis using the variables in vars.

#### Examples

in_ideal((x+y)^2,[y^2,x^2+2*x*y],[x,y])

1 |  |  |  |  |  |  |  |  |  |

in_ideal([(x+y)^2,x+y],[y^2,x^2+2*x*y],[x,y])

| ⎡ ⎣ | 1,0 | ⎤ ⎦

in_ideal(x+y,[y^2,x^2+2*x*y],[x,y])

0 |  |  |  |  |  |  |  |  |  |