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.Sat, 12 Dec 2020 22:16:59 +0100How to call a constant polynomial with lift()?https://ask.sagemath.org/question/54661/how-to-call-a-constant-polynomial-with-lift/I am trying to call a constant polynomial with `lift()`,
but I get an error. The following is a minimal example
of my input that produces an error:
sage: A.<x, y> = PolynomialRing(CC, 2, order='degrevlex')
sage: I = A.ideal([x + y, x + y + 1])
sage: A(1).lift(I)
When I input a non-constant polynomial (say, `f = (x+y)^2`),
Sage executes `lift(I)` as expected. I only get an error
for constant polynomials like `A(1)`.Sat, 12 Dec 2020 19:33:48 +0100https://ask.sagemath.org/question/54661/how-to-call-a-constant-polynomial-with-lift/Comment by rburing for <p>I am trying to call a constant polynomial with <code>lift()</code>,
but I get an error. The following is a minimal example
of my input that produces an error:</p>
<pre><code>sage: A.<x, y> = PolynomialRing(CC, 2, order='degrevlex')
sage: I = A.ideal([x + y, x + y + 1])
sage: A(1).lift(I)
</code></pre>
<p>When I input a non-constant polynomial (say, <code>f = (x+y)^2</code>),
Sage executes <code>lift(I)</code> as expected. I only get an error
for constant polynomials like <code>A(1)</code>.</p>
https://ask.sagemath.org/question/54661/how-to-call-a-constant-polynomial-with-lift/?comment=54666#post-id-54666Note that `CC` is `Complex Field with 53 bits of precision`, so this "field" consisting of floating point approximations is generally unsuitable for exact algebraic applications like GrÃ¶bner bases and the division algorithm (which are used here). Often you can reduce your problem to a computation over a number field and/or over $\mathbb{Q}$.Sat, 12 Dec 2020 22:16:59 +0100https://ask.sagemath.org/question/54661/how-to-call-a-constant-polynomial-with-lift/?comment=54666#post-id-54666Answer by rburing for <p>I am trying to call a constant polynomial with <code>lift()</code>,
but I get an error. The following is a minimal example
of my input that produces an error:</p>
<pre><code>sage: A.<x, y> = PolynomialRing(CC, 2, order='degrevlex')
sage: I = A.ideal([x + y, x + y + 1])
sage: A(1).lift(I)
</code></pre>
<p>When I input a non-constant polynomial (say, <code>f = (x+y)^2</code>),
Sage executes <code>lift(I)</code> as expected. I only get an error
for constant polynomials like <code>A(1)</code>.</p>
https://ask.sagemath.org/question/54661/how-to-call-a-constant-polynomial-with-lift/?answer=54665#post-id-54665Since `1` does not belong to the ideal, it is not possible to express `1` as a linear combination (with polynomial coefficients) of the generators of the ideal (which is what `lift` tries to do).
So `lift` correctly gives an error; it even provides the reason.
*Edit* (after the generators were changed): you should work over a field with exact arithmetic, such as the smallest field that contains the coefficients of your polynomials; in this case you can work over `QQ`:
sage: A.<x, y> = PolynomialRing(QQ, 2, order='degrevlex')
sage: I = A.ideal([x + y, x + y + 1])
sage: A(1).lift(I)
[-1, 1]
This result implies the result over $\mathbb{C}$.Sat, 12 Dec 2020 21:54:48 +0100https://ask.sagemath.org/question/54661/how-to-call-a-constant-polynomial-with-lift/?answer=54665#post-id-54665