Mode of #cas

groebner

Gives the reduced lexicographic Gröbner basis of a polynomial ideal, with theorems about Ideal.span in MvPolynomial.

#cas [groebner x, y, …] [f₁, …, fₘ]
gives the reduced Gröbner basis of the polynomials f₁, …, fₘ for the lexicographic order x > y > …, and proves that it spans the same ideal and is a Gröbner basis in Mathlib’s MvPolynomial.

A Gröbner basis reorganizes a system of polynomial equations into a form that is easier to solve, and groebner computes one for the input ideal. The lexicographic basis eliminates variables. When the system has finitely many complex solutions, its last elements involve only the last variables, so you can read off the common zeros one variable at a time, much as you would back-substitute in a triangular linear system.

The report proves two theorems about Mathlib’s Ideal.span in MvPolynomial (Fin n) ℚ. The first says that the basis spans the same ideal as the input. The second says that it is a Gröbner basis for MonomialOrder.lex: the leading term of every nonzero element of the ideal is divisible by the leading term of a basis element. The first alone holds for the input as well, and the second is the property that the elimination above relies on.

Details and Options

  • The theorems are Ideal.span {f₁, …, fₘ} = Ideal.span {g₁, …, gₖ} and ∀ p ∈ Ideal.span {g₁, …, gₖ}, p ≠ 0 → ∃ g ∈ {g₁, …, gₖ}, MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p, in MvPolynomial (Fin n) ℚ with the listed variables read as X 0, X 1, … in that order, so the first one is the largest.
  • The equality of the ideals comes with explicit cofactors both ways, checked by Mathlib’s tactic ring. The Gröbner property follows from Buchberger’s criterion (Buchberger 1970) and a division of the S-polynomial of every pair of the basis, which the kernel checks (CAS.Polynomial.Sparse.groebnerCertified). That the basis is the reduced one is not part of the theorem.
  • The inputs are polynomials with rational coefficients in the listed variables. Division is allowed by nonzero constants only.
  • Each element of the basis is scaled to coprime integer coefficients with a positive leading coefficient. An ideal that contains a nonzero constant has the basis 1. The zero ideal has the empty basis, printed 0 and written {0} in the theorems.
  • The search stops after 400 polynomials or 4000 pairs, with a message that suggests an oracle.
  • With CASOracle.Ideal imported, #cas [groebner x, y, oracle := sage] [f₁, …] asks SageMath for the basis, oracle := singular asks Singular, and oracle := sympy asks SymPy. Lean checks the basis in the same way, and that it is reduced is printed as a hint. See oracle.
  • The tactic cas proves equalities of spans in any commutative ring, and the Gröbner property for MonomialOrder.lex of a set literal such as {g₁, g₂} in MvPolynomial (Fin n) ℚ. For an equality of spans, a certificate with denominators needs a ℚ-algebra. Other monomial orders are not among its goals.

Examples (16)#

Basic Examples (2)

The circle x2+y2=5 and the hyperbola xy=2. The last element of the basis is a polynomial in y alone:

In[1]:=
#cas [groebner x, y] [x^2 + y^2 - 5, x*y - 2]
Out[1]=

Gröbner basis of the same ideal (checked)

2x+y3−5y,y4−5y2+4
2*x + y^3 - 5*y, y^4 - 5*y^2 + 4
Domain
ℚ[x, y] as MvPolynomial (Fin 2) ℚ, with x = X 0, y = X 1
Input (polynomials)
x^2 + y^2 - 5, x*y - 2

Checked by Lean’s kernel: Ideal of the inputs

Ideal.span {X 0 ^ 2 + X 1 ^ 2 - 5, X 0 * X 1 - 2} =
  Ideal.span {2 * X 0 + X 1 ^ 3 - 5 * X 1, X 1 ^ 4 - 5 * X 1 ^ 2 + 4}
The certificate: 2 checked steps
  1. Ideal of the inputs

    Ideal.span {X 0 ^ 2 + X 1 ^ 2 - 5, X 0 * X 1 - 2} =
      Ideal.span {2 * X 0 + X 1 ^ 3 - 5 * X 1, X 1 ^ 4 - 5 * X 1 ^ 2 + 4}

    Checked by Lean’s kernel

  2. Gröbner property of the basis

    ∀ p ∈ Ideal.span {2 * X 0 + X 1 ^ 3 - 5 * X 1, X 1 ^ 4 - 5 * X 1 ^ 2 + 4},
      p ≠ 0 →
        ∃ g ∈ {2 * X 0 + X 1 ^ 3 - 5 * X 1, X 1 ^ 4 - 5 * X 1 ^ 2 + 4},
          MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    the reduced basis for the lexicographic order x > y, each element scaled to coprime integer coefficients with a positive leading coefficient; computed by SymLean's Buchberger algorithm, 4 polynomials in the derivation, 2 in the basis

The unit sphere, the paraboloid y=x2+z2 and the plane x=z. The basis is triangular and ends with a polynomial in z:

In[2]:=
#cas [groebner x, y, z] [x^2 + y^2 + z^2 - 1, x^2 + z^2 - y, x - z]
Out[2]=

Gröbner basis of the same ideal (checked)

x−z,y−2z2,4z4+2z2−1
x - z, y - 2*z^2, 4*z^4 + 2*z^2 - 1
Domain
ℚ[x, y, z] as MvPolynomial (Fin 3) ℚ, with x = X 0, y = X 1, z = X 2
Input (polynomials)
x^2 + y^2 + z^2 - 1, x^2 + z^2 - y, x - z

Checked by Lean’s kernel: Ideal of the inputs

Ideal.span {X 0 ^ 2 + X 1 ^ 2 + X 2 ^ 2 - 1, X 0 ^ 2 + X 2 ^ 2 - X 1, X 0 - X 2} =
  Ideal.span {X 0 - X 2, X 1 - 2 * X 2 ^ 2, 4 * X 2 ^ 4 + 2 * X 2 ^ 2 - 1}
The certificate: 2 checked steps
  1. Ideal of the inputs

    Ideal.span {X 0 ^ 2 + X 1 ^ 2 + X 2 ^ 2 - 1, X 0 ^ 2 + X 2 ^ 2 - X 1, X 0 - X 2} =
      Ideal.span {X 0 - X 2, X 1 - 2 * X 2 ^ 2, 4 * X 2 ^ 4 + 2 * X 2 ^ 2 - 1}

    Checked by Lean’s kernel

  2. Gröbner property of the basis

    ∀ p ∈ Ideal.span {X 0 - X 2, X 1 - 2 * X 2 ^ 2, 4 * X 2 ^ 4 + 2 * X 2 ^ 2 - 1},
      p ≠ 0 →
        ∃ g ∈ {X 0 - X 2, X 1 - 2 * X 2 ^ 2, 4 * X 2 ^ 4 + 2 * X 2 ^ 2 - 1},
          MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    the reduced basis for the lexicographic order x > y > z, each element scaled to coprime integer coefficients with a positive leading coefficient; computed by SymLean's Buchberger algorithm, 6 polynomials in the derivation, 3 in the basis

Scope (3)

Rational coefficients are allowed, and each element of the basis is scaled to coprime integer coefficients. In the theorem the coefficient 12 of the input is the constant polynomial C (1 / 2):

In[3]:=
#cas [groebner x, y] [x/2 + y - 1, x^2 - y]
Out[3]=

Gröbner basis of the same ideal (checked)

x+2y−2,4y2−9y+4
x + 2*y - 2, 4*y^2 - 9*y + 4
Domain
ℚ[x, y] as MvPolynomial (Fin 2) ℚ, with x = X 0, y = X 1
Input (polynomials)
x/2 + y - 1, x^2 - y

Checked by Lean’s kernel: Ideal of the inputs

Ideal.span {C (1 / 2) * X 0 + X 1 - 1, X 0 ^ 2 - X 1} =
  Ideal.span {X 0 + 2 * X 1 - 2, 4 * X 1 ^ 2 - 9 * X 1 + 4}
The certificate: 2 checked steps
  1. Ideal of the inputs

    Ideal.span {C (1 / 2) * X 0 + X 1 - 1, X 0 ^ 2 - X 1} =
      Ideal.span {X 0 + 2 * X 1 - 2, 4 * X 1 ^ 2 - 9 * X 1 + 4}

    Checked by Lean’s kernel

  2. Gröbner property of the basis

    ∀ p ∈ Ideal.span {X 0 + 2 * X 1 - 2, 4 * X 1 ^ 2 - 9 * X 1 + 4},
      p ≠ 0 →
        ∃ g ∈ {X 0 + 2 * X 1 - 2, 4 * X 1 ^ 2 - 9 * X 1 + 4},
          MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    the reduced basis for the lexicographic order x > y, each element scaled to coprime integer coefficients with a positive leading coefficient; computed by SymLean's Buchberger algorithm, 4 polynomials in the derivation, 2 in the basis

The polynomials xy−1 and x have no common zero. The basis is 1, and the ideal is the whole ring:

In[4]:=
#cas [groebner x, y] [x*y - 1, x]
Out[4]=

Gröbner basis of the same ideal (checked)

1
Domain
ℚ[x, y] as MvPolynomial (Fin 2) ℚ, with x = X 0, y = X 1
Input (polynomials)
x*y - 1, x

Checked by Lean’s kernel: Ideal of the inputs

Ideal.span {X 0 * X 1 - 1, X 0} = Ideal.span {1}
The certificate: 2 checked steps
  1. Ideal of the inputs

    Ideal.span {X 0 * X 1 - 1, X 0} = Ideal.span {1}

    Checked by Lean’s kernel

  2. Gröbner property of the basis

    ∀ p ∈ Ideal.span {1},
      p ≠ 0 → ∃ g ∈ {1}, MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    the reduced basis for the lexicographic order x > y, each element scaled to coprime integer coefficients with a positive leading coefficient; computed by SymLean's Buchberger algorithm, 3 polynomials in the derivation, 1 in the basis

The zero ideal has the empty basis, printed 0:

In[5]:=
#cas [groebner x, y] [x - x]
Out[5]=

Gröbner basis of the same ideal (checked)

0
Domain
ℚ[x, y] as MvPolynomial (Fin 2) ℚ, with x = X 0, y = X 1
Input (polynomials)
x - x

Checked by Lean’s kernel: Ideal of the inputs

Ideal.span {X 0 - X 0} = Ideal.span {0}
The certificate: 2 checked steps
  1. Ideal of the inputs

    Ideal.span {X 0 - X 0} = Ideal.span {0}

    Checked by Lean’s kernel

  2. Gröbner property of the basis

    ∀ p ∈ Ideal.span {0},
      p ≠ 0 → ∃ g ∈ {0}, MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    the reduced basis for the lexicographic order x > y, each element scaled to coprime integer coefficients with a positive leading coefficient; computed by SymLean's Buchberger algorithm, 0 polynomials in the derivation, 0 in the basis

Options (1)

SageMath can propose the basis, with CASOracle.Ideal imported. Lean checks it in the same way and proves the same two theorems:

In[6]:=
#cas [groebner x, y, oracle := sage] [x ^ 2 + y ^ 2 - 5, x * y - 2]

Quoted from tests/oracle/Oracles.lean, where #guard_msgs pins the output (the part shown).

Out[6]=

Gröbner basis of the same ideal (checked)

2x+y3−5y,y4−5y2+4
2*x + y^3 - 5*y, y^4 - 5*y^2 + 4

Applications (3)

The first example as a theorem about Mathlib’s Ideal.span. Only the three standard axioms are used:

In[7]:=
open MvPolynomial in
theorem span_circle_hyperbola :
    Ideal.span {(X 0 ^ 2 + X 1 ^ 2 - 5 : MvPolynomial (Fin 2) ℚ), X 0 * X 1 - 2} =
      Ideal.span {2 * X 0 + X 1 ^ 3 - 5 * X 1, X 1 ^ 4 - 5 * X 1 ^ 2 + 4} := by
  cas

#print axioms span_circle_hyperbola
Out[7]=

span_circle_hyperbola depends on the axioms propext, Classical.choice, Quot.sound.


The Gröbner property of its basis, which the tactic cas proves from Buchberger’s criterion:

In[8]:=
open MvPolynomial in
theorem groebner_circle_hyperbola :
    ∀ p ∈ Ideal.span ({2 * X 0 + X 1 ^ 3 - 5 * X 1, X 1 ^ 4 - 5 * X 1 ^ 2 + 4} :
        Set (MvPolynomial (Fin 2) ℚ)), p ≠ 0 →
      ∃ g ∈ ({2 * X 0 + X 1 ^ 3 - 5 * X 1, X 1 ^ 4 - 5 * X 1 ^ 2 + 4} :
        Set (MvPolynomial (Fin 2) ℚ)),
        MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p := by
  cas
Out[8]=

Lean accepts the proof.


In the first example y is a root of y4−5y2+4=(y2−1)(y2−4), and then x=(5y−y3)/2. solve uses such a basis to prove the complete list of real solutions:

In[9]:=
#cas [solve x, y] (x^2 + y^2 = 5 ∧ x * y = 2)
Out[9]=

complete list of real solutions

{x=−1, y=−2},{x=−2, y=−1},{x=2, y=1},{x=1, y=2}
{x = -1, y = -2}, {x = -2, y = -1}, {x = 2, y = 1}, {x = 1, y = 2}
Input (polynomial system)
(x^2 + y^2 = 5 ∧ x * y = 2)

Checked by Lean’s kernel: Complete list of real solutions

∀ (x y : ℝ),
  x ^ 2 + y ^ 2 = 5 ∧ x * y = 2 ↔ x = -1 ∧ y = -2 ∨ x = -2 ∧ y = -1 ∨ x = 2 ∧ y = 1 ∨ x = 1 ∧ y = 2
The certificate: 1 checked step
  1. Complete list of real solutions

    ∀ (x y : ℝ),
      x ^ 2 + y ^ 2 = 5 ∧ x * y = 2 ↔ x = -1 ∧ y = -2 ∨ x = -2 ∧ y = -1 ∨ x = 2 ∧ y = 1 ∨ x = 1 ∧ y = 2

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    lexicographic basis in shape position with respect to y; eliminant of degree 4, 4 real roots, 4 polynomials in the derivation

Properties and Relations (2)

member writes an element of the ideal as a combination of the inputs. Here it is the last element of the first basis:

In[10]:=
#cas [member x, y] (y^4 - 5*y^2 + 4) [x^2 + y^2 - 5, x*y - 2]
Out[10]=

a combination of the generators (checked)

y4−5y2+4=y2(x2+y2−5)+(−xy−2)(xy−2)
y^4 - 5*y^2 + 4 = y^2*(x^2 + y^2 - 5) + (-x*y - 2)*(x*y - 2)
Domain
ℚ[x, y] as MvPolynomial (Fin 2) ℚ, with x = X 0, y = X 1
Input (polynomial and ideal)
y^4 - 5*y^2 + 4 and ⟨x^2 + y^2 - 5, x*y - 2⟩

Checked by Lean’s kernel: Membership in the ideal of the generators

X 1 ^ 4 - 5 * X 1 ^ 2 + 4 ∈ Ideal.span {X 0 ^ 2 + X 1 ^ 2 - 5, X 0 * X 1 - 2}
The certificate: 1 checked step
  1. Membership in the ideal of the generators

    X 1 ^ 4 - 5 * X 1 ^ 2 + 4 ∈ Ideal.span {X 0 ^ 2 + X 1 ^ 2 - 5, X 0 * X 1 - 2}

    Checked by Lean’s kernel


The order of the variables is the order of elimination. With y>x, the basis of the line and the parabola of Scope ends with a polynomial in x:

In[11]:=
#cas [groebner y, x] [x/2 + y - 1, x^2 - y]
Out[11]=

Gröbner basis of the same ideal (checked)

2y+x−2,2x2+x−2
2*y + x - 2, 2*x^2 + x - 2
Domain
ℚ[y, x] as MvPolynomial (Fin 2) ℚ, with y = X 0, x = X 1
Input (polynomials)
x/2 + y - 1, x^2 - y

Checked by Lean’s kernel: Ideal of the inputs

Ideal.span {C (1 / 2) * X 1 + X 0 - 1, X 1 ^ 2 - X 0} =
  Ideal.span {2 * X 0 + X 1 - 2, 2 * X 1 ^ 2 + X 1 - 2}
The certificate: 2 checked steps
  1. Ideal of the inputs

    Ideal.span {C (1 / 2) * X 1 + X 0 - 1, X 1 ^ 2 - X 0} =
      Ideal.span {2 * X 0 + X 1 - 2, 2 * X 1 ^ 2 + X 1 - 2}

    Checked by Lean’s kernel

  2. Gröbner property of the basis

    ∀ p ∈ Ideal.span {2 * X 0 + X 1 - 2, 2 * X 1 ^ 2 + X 1 - 2},
      p ≠ 0 →
        ∃ g ∈ {2 * X 0 + X 1 - 2, 2 * X 1 ^ 2 + X 1 - 2},
          MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    the reduced basis for the lexicographic order y > x, each element scaled to coprime integer coefficients with a positive leading coefficient; computed by SymLean's Buchberger algorithm, 3 polynomials in the derivation, 2 in the basis

Possible Issues (4)

Every variable of the inputs is listed after the mode name:

In[12]:=
#cas [groebner x, y] [x^2 + z, y]
Out[12]=

Error

expression contains undeclared variables: z

The inputs are polynomials:

In[13]:=
#cas [groebner x, y] [x^2 + sin y, y]
Out[13]=

Error

groebner: x^2 + sin y is not a polynomial with rational coefficients

The tactic cas refuses the Gröbner property of a set that does not have it, and the rest of its message names a pair whose S-polynomial leaves a nonzero remainder. The parabolas x2−y and y2−x are such a set:

In[14]:=
open MvPolynomial in
example :
    ∀ p ∈ Ideal.span ({X 0 ^ 2 - X 1, X 1 ^ 2 - X 0} : Set (MvPolynomial (Fin 2) ℚ)), p ≠ 0 →
      ∃ g ∈ ({X 0 ^ 2 - X 1, X 1 ^ 2 - X 0} : Set (MvPolynomial (Fin 2) ℚ)),
        MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p := by
  cas
Out[14]=

Error

cas expected a checked semantic proposition, reflected equality, arithmetic relation, an ordinary inequality on real variables bounded by rational literal hypotheses (a two-sided bound `a ≤ f x ∧ f x ≤ b`, a membership `f x ∈ Set.Icc a b`, or a universally quantified bound), or the statement of a `#cas` command (a limit, a polynomial root count, a polynomial sign condition)
The rest of the message
Command theorem route:
  cas sign route expected a quantifier over ℝ
Box enclosure route:
  cas box route: the goal has the head symbol `Exists`; the route proves `f x ≤ c`, `f x < c`, `c ≤ f x`, `c < f x` (also with `≥` and `>`), `|f x| ≤ c`, `|f x| < c`, `a ≤ f x ∧ f x ≤ b` (also with `<`), `f x ∈ Set.Icc a b` (also `Set.Ioo`, `Set.Ico`, `Set.Ioc`), `f x ≤ g x`, `f x < g x`, and conjunctions of these, with `c`, `a`, `b` closed and every real variable bounded by hypotheses `a ≤ x` and `x ≤ b`, `x ∈ Set.Icc a b`, or `|x| ≤ r` with rational literal endpoints
Registered route ideal:
  cas: the basis is not a Gröbner basis for `MonomialOrder.lex`: the S-polynomial of
    X 0 ^ 2 - X 1
  and
    X 1 ^ 2 - X 0
  leaves the remainder
    -X 1 ^ 4 + X 1
  on division by the basis
Grind fallback:
  `grind` failed (`set_option trace.cas.fallback true` shows its diagnostics)
norm_num fallback:
  norm_num did not close the goal

The reduced basis x−y2,y4−y of the same ideal has the property:

In[15]:=
open MvPolynomial in
theorem groebner_two_parabolas :
    ∀ p ∈ Ideal.span ({X 0 - X 1 ^ 2, X 1 ^ 4 - X 1} : Set (MvPolynomial (Fin 2) ℚ)), p ≠ 0 →
      ∃ g ∈ ({X 0 - X 1 ^ 2, X 1 ^ 4 - X 1} : Set (MvPolynomial (Fin 2) ℚ)),
        MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p := by
  cas
Out[15]=

Lean accepts the proof.


The two sets in the statement are compared as written, so the same set listed in another order after ∃ g ∈ is refused. The reason is in the rest of the message, under “Registered route ideal”:

In[16]:=
open MvPolynomial in
example :
    ∀ p ∈ Ideal.span ({X 0, X 1} : Set (MvPolynomial (Fin 2) ℚ)), p ≠ 0 →
      ∃ g ∈ ({X 1, X 0} : Set (MvPolynomial (Fin 2) ℚ)),
        MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p := by
  cas
Out[16]=

Error

cas expected a checked semantic proposition, reflected equality, arithmetic relation, an ordinary inequality on real variables bounded by rational literal hypotheses (a two-sided bound `a ≤ f x ∧ f x ≤ b`, a membership `f x ∈ Set.Icc a b`, or a universally quantified bound), or the statement of a `#cas` command (a limit, a polynomial root count, a polynomial sign condition)
The rest of the message
Command theorem route:
  cas sign route expected a quantifier over ℝ
Box enclosure route:
  cas box route: the goal has the head symbol `Exists`; the route proves `f x ≤ c`, `f x < c`, `c ≤ f x`, `c < f x` (also with `≥` and `>`), `|f x| ≤ c`, `|f x| < c`, `a ≤ f x ∧ f x ≤ b` (also with `<`), `f x ∈ Set.Icc a b` (also `Set.Ioo`, `Set.Ico`, `Set.Ioc`), `f x ≤ g x`, `f x < g x`, and conjunctions of these, with `c`, `a`, `b` closed and every real variable bounded by hypotheses `a ≤ x` and `x ≤ b`, `x ∈ Set.Icc a b`, or `|x| ≤ r` with rational literal endpoints
Registered route ideal:
  cas: on a goal `∀ p ∈ Ideal.span S, p ≠ 0 → ∃ …`, `cas` proves only the Gröbner property for `MonomialOrder.lex`, `∃ g ∈ S, MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p` with the same set `S`; other monomial orders and other conclusions are not supported
Grind fallback:
  `grind` failed (`set_option trace.cas.fallback true` shows its diagnostics)
norm_num fallback:
  norm_num did not close the goal

Neat Examples (1)

The elementary symmetric polynomials of x,y,z, the last one shifted by 1. At a common zero, x, y and z are the three roots of t3−1 in some order, and the basis ends with z3−1:

In[17]:=
#cas [groebner x, y, z] [x + y + z, x*y + y*z + z*x, x*y*z - 1]
Out[17]=

Gröbner basis of the same ideal (checked)

x+y+z,y2+yz+z2,z3−1
x + y + z, y^2 + y*z + z^2, z^3 - 1
Domain
ℚ[x, y, z] as MvPolynomial (Fin 3) ℚ, with x = X 0, y = X 1, z = X 2
Input (polynomials)
x + y + z, x*y + y*z + z*x, x*y*z - 1

Checked by Lean’s kernel: Ideal of the inputs

Ideal.span {X 0 + X 1 + X 2, X 0 * X 1 + X 1 * X 2 + X 2 * X 0, X 0 * X 1 * X 2 - 1} =
  Ideal.span {X 0 + X 1 + X 2, X 1 ^ 2 + X 1 * X 2 + X 2 ^ 2, X 2 ^ 3 - 1}
The certificate: 2 checked steps
  1. Ideal of the inputs

    Ideal.span {X 0 + X 1 + X 2, X 0 * X 1 + X 1 * X 2 + X 2 * X 0, X 0 * X 1 * X 2 - 1} =
      Ideal.span {X 0 + X 1 + X 2, X 1 ^ 2 + X 1 * X 2 + X 2 ^ 2, X 2 ^ 3 - 1}

    Checked by Lean’s kernel

  2. Gröbner property of the basis

    ∀ p ∈ Ideal.span {X 0 + X 1 + X 2, X 1 ^ 2 + X 1 * X 2 + X 2 ^ 2, X 2 ^ 3 - 1},
      p ≠ 0 →
        ∃ g ∈ {X 0 + X 1 + X 2, X 1 ^ 2 + X 1 * X 2 + X 2 ^ 2, X 2 ^ 3 - 1},
          MonomialOrder.lex.leadingTerm g ∣ MonomialOrder.lex.leadingTerm p

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    the reduced basis for the lexicographic order x > y > z, each element scaled to coprime integer coefficients with a positive leading coefficient; computed by SymLean's Buchberger algorithm, 5 polynomials in the derivation, 3 in the basis

See Also

member · solve · cas · oracle · polynomialRemainder