ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 05 Jun 2020 13:59:33 +0200Why does Sage say my Groebner basis is 1?https://ask.sagemath.org/question/51770/why-does-sage-say-my-groebner-basis-is-1/Consider the following program
A.<a1, a2, a3, l2, l3> = PolynomialRing(QQ)
F = A.fraction_field()
F.inject_variables()
R.<c2, s2, c1, s1> = PolynomialRing(F, order = 'lex')
I = R.ideal(l3*s1*s2 + l2*c1 - a1, l3*s1*c2 - l2*s1 - a2, l3*c2 - a3, c1^2 + s1^2 - 1, c2^2 + s2^2 - 1)
I.groebner_basis()
So $a_1, a_2, a_3, l_2, l_3$ are parameters, and I am trying to solve the system of equations
$$a_1 = l_3s_1s_2 + l_2c_1 $$
$$a_2 = l_3s_1c_2 - l_2s_1$$
$$a_3 = l_3c_2$$
$$c_1^2 + s_1^1 = 1$$
$$c_2^2 + s_2^2 = 1$$
Now this gives as result 1, meaning that there is no solution to this system. However, for $a_1 = l_2$, $a_2 = 0$ and $a_3 = l_3$ we do have a solution, namely $c_1 = 1, s_1 = 0, c_2 = 1, s_2 = 0$.
So is something in the programming going wrong, or am I misunderstanding something on the algebraic geometry part?Fri, 05 Jun 2020 12:03:28 +0200https://ask.sagemath.org/question/51770/why-does-sage-say-my-groebner-basis-is-1/Answer by rburing for <p>Consider the following program</p>
<pre><code>A.<a1, a2, a3, l2, l3> = PolynomialRing(QQ)
F = A.fraction_field()
F.inject_variables()
R.<c2, s2, c1, s1> = PolynomialRing(F, order = 'lex')
I = R.ideal(l3*s1*s2 + l2*c1 - a1, l3*s1*c2 - l2*s1 - a2, l3*c2 - a3, c1^2 + s1^2 - 1, c2^2 + s2^2 - 1)
I.groebner_basis()
</code></pre>
<p>So $a_1, a_2, a_3, l_2, l_3$ are parameters, and I am trying to solve the system of equations</p>
<p>$$a_1 = l_3s_1s_2 + l_2c_1 $$</p>
<p>$$a_2 = l_3s_1c_2 - l_2s_1$$</p>
<p>$$a_3 = l_3c_2$$</p>
<p>$$c_1^2 + s_1^1 = 1$$</p>
<p>$$c_2^2 + s_2^2 = 1$$</p>
<p>Now this gives as result 1, meaning that there is no solution to this system. However, for $a_1 = l_2$, $a_2 = 0$ and $a_3 = l_3$ we do have a solution, namely $c_1 = 1, s_1 = 0, c_2 = 1, s_2 = 0$.</p>
<p>So is something in the programming going wrong, or am I misunderstanding something on the algebraic geometry part?</p>
https://ask.sagemath.org/question/51770/why-does-sage-say-my-groebner-basis-is-1/?answer=51771#post-id-51771If you work over the fraction field of the parameters, you implicitly assume that all the parameters are nonzero, and even more: that all nontrivial polynomial expressions in the parameters are nonzero (because they all may appear as denominators). Concretely: `R.one().lift(I)` gives a list of coefficients of generators of `I` such that the linear combination equals `1`. (In particular, it shows that the Groebner basis is correct.) Of course these coefficients are (formal) fractions. But the non-vanishing of the denominator of these fractions is in fact inconsistent with the original system of equations. Put another way: the parameters can not all be chosen arbitrarily; they must satisfy some consistency condition that follows from the system of equations (see below).
Better just work in a big polynomial ring:
sage: R.<c2, s2, c1, s1, a1, a2, a3, l2, l3> = PolynomialRing(QQ, order='lex')
sage: I = R.ideal(l3*s1*s2 + l2*c1 - a1, l3*s1*c2 - l2*s1 - a2, l3*c2 - a3, c1^2 + s1^2 - 1, c2^2 + s2^2 - 1)
sage: list(I.groebner_basis())
You get a big "triangular" system of equations that you can try to solve from the bottom up.
The last equation involves only the parameters, so it is a consistency condition (if it is not satisfied, then there is no solution). The second-to-last equation is $s_1a_3 - s_1l_2 - a_2=0$. If $a_3\neq l_2$ then you can solve it for $s_1$. If $a_3=l_2$ then $a_2=0$ and the remaining equation for $s_1$ is (at most) a quartic depending on the parameters, and so on.Fri, 05 Jun 2020 12:57:42 +0200https://ask.sagemath.org/question/51770/why-does-sage-say-my-groebner-basis-is-1/?answer=51771#post-id-51771Comment by Schrift for <p>If you work over the fraction field of the parameters, you implicitly assume that all the parameters are nonzero, and even more: that all nontrivial polynomial expressions in the parameters are nonzero (because they all may appear as denominators). Concretely: <code>R.one().lift(I)</code> gives a list of coefficients of generators of <code>I</code> such that the linear combination equals <code>1</code>. (In particular, it shows that the Groebner basis is correct.) Of course these coefficients are (formal) fractions. But the non-vanishing of the denominator of these fractions is in fact inconsistent with the original system of equations. Put another way: the parameters can not all be chosen arbitrarily; they must satisfy some consistency condition that follows from the system of equations (see below).</p>
<p>Better just work in a big polynomial ring:</p>
<pre><code>sage: R.<c2, s2, c1, s1, a1, a2, a3, l2, l3> = PolynomialRing(QQ, order='lex')
sage: I = R.ideal(l3*s1*s2 + l2*c1 - a1, l3*s1*c2 - l2*s1 - a2, l3*c2 - a3, c1^2 + s1^2 - 1, c2^2 + s2^2 - 1)
sage: list(I.groebner_basis())
</code></pre>
<p>You get a big "triangular" system of equations that you can try to solve from the bottom up.</p>
<p>The last equation involves only the parameters, so it is a consistency condition (if it is not satisfied, then there is no solution). The second-to-last equation is $s_1a_3 - s_1l_2 - a_2=0$. If $a_3\neq l_2$ then you can solve it for $s_1$. If $a_3=l_2$ then $a_2=0$ and the remaining equation for $s_1$ is (at most) a quartic depending on the parameters, and so on.</p>
https://ask.sagemath.org/question/51770/why-does-sage-say-my-groebner-basis-is-1/?comment=51772#post-id-51772Thank you!Fri, 05 Jun 2020 13:59:33 +0200https://ask.sagemath.org/question/51770/why-does-sage-say-my-groebner-basis-is-1/?comment=51772#post-id-51772