The ring
R should be one of the base rings associated with the ring of
f. An error is raised if
f cannot be lifted to
R.
The first example is lifting from the fraction field of R to R.
i1 : lift(4/2,ZZ)
o1 = 2
|
i2 : R = ZZ[x];
|
i3 : f = ((x+1)^3*(x+4))/((x+4)*(x+1))
2
o3 = x + 2x + 1
o3 : frac(R)
|
i4 : lift(f,R)
2
o4 = x + 2x + 1
o4 : R
|
Another use of lift is to take polynomials in a quotient ring and lift them to the polynomial ring.
i5 : A = QQ[a..d];
|
i6 : B = A/(a^2-b,c^2-d-a-3);
|
i7 : f = c^5
2
o7 = 2a*c*d + c*d + 6a*c + b*c + 6c*d + 9c
o7 : B
|
i8 : lift(f,A)
2
o8 = 2a*c*d + c*d + 6a*c + b*c + 6c*d + 9c
o8 : A
|
i9 : jf = jacobian ideal f
o9 = {1} | 2cd+6c |
{1} | c |
{1} | 2ad+d2+6a+b+6d+9 |
{1} | 2ac+2cd+6c |
4 1
o9 : Matrix B <--- B
|
i10 : lift(jf,A)
o10 = {1} | 2cd+6c |
{1} | c |
{1} | 2ad+d2+6a+b+6d+9 |
{1} | 2ac+2cd+6c |
4 1
o10 : Matrix A <--- A
|
Elements may be lifted to any base ring, if such a lift exists. For example,
i11 : use B;
|
i12 : g = (a^2+2*a-3)-(a+1)^2
o12 = -4
o12 : B
|
i13 : lift(g,A)
o13 = -4
o13 : A
|
i14 : lift(g,QQ)
o14 = -4
o14 : QQ
|
i15 : lift(lift(g,QQ),ZZ)
o15 = -4
|
The functions
lift and
substitute are useful to move numbers from one kind of coefficient ring to another.
i16 : substitute(3,RR)
o16 = 3.
o16 : RR
|
i17 : lift(3.0,ZZ)
o17 = 3
|
i18 : lift(3.0,QQ)
o18 = 3
o18 : QQ
|
i19 : 12/127.
o19 = 0.0944882
o19 : RR
|
i20 : lift(oo,QQ)
12
o20 = ---
127
o20 : QQ
|