-- -*- M2-comint -*- hash: 1336709889433276528

i1 : f = a -> {-a_1^3*max(sin(a_2),1)+a_0*a_1*a_2*ceiling((log(1 + abs a_0))^0),-a_1^2*a_2+a_0*a_1*a_3,-a_1*a_2^2+a_1^2*a_3,-a_1^2*a_3+a_0*a_1*a_4,-a_1*a_2*a_3+a_1^2*a_4,-a_1*a_3^2+a_1*a_2*a_4}

o1 = f

o1 : FunctionClosure

i2 : P4 := QQ[t_0..t_4]

o2 = QQ[t ..t ]
         0   4

o2 : PolynomialRing

i3 : P5 := QQ[u_0..u_5]

o3 = QQ[u ..u ]
         0   5

o3 : PolynomialRing

i4 : time psi = abstractRationalMap(P4,P5,f)
 -- used 0.000418771s (cpu); 0.00041588s (thread); 0s (gc)

o4 = -- rational map --
     source: Proj(QQ[t , t , t , t , t ])
                      0   1   2   3   4
     target: Proj(QQ[u , u , u , u , u , u ])
                      0   1   2   3   4   5
     defining forms: given by a function

o4 : AbstractRationalMap (rational map from PP^4 to PP^5)

i5 : time projectiveDegrees(psi,3)
 -- used 0.269808s (cpu); 0.177387s (thread); 0s (gc)

o5 = 2

i6 : time rationalMap psi
 -- used 0.444965s (cpu); 0.355445s (thread); 0s (gc)

o6 = -- rational map --
     source: Proj(QQ[t , t , t , t , t ])
                      0   1   2   3   4
     target: Proj(QQ[u , u , u , u , u , u ])
                      0   1   2   3   4   5
     defining forms: {
                       2
                      t  - t t ,
                       1    0 2
                      
                      t t  - t t ,
                       1 2    0 3
                      
                       2
                      t  - t t ,
                       2    1 3
                      
                      t t  - t t ,
                       1 3    0 4
                      
                      t t  - t t ,
                       2 3    1 4
                      
                       2
                      t  - t t
                       3    2 4
                     }

o6 : RationalMap (quadratic rational map from PP^4 to PP^5)

i7 : phi = rationalMap map specialCremonaTransformation(3,ZZ/10000019);

o7 : RationalMap (Cremona transformation of PP^4 of type (3,2))

i8 : phi' = abstractRationalMap phi

o8 = -- rational map --
                     ZZ
     source: Proj(--------[x , x , x , x , x ])
                  10000019  0   1   2   3   4
                     ZZ
     target: Proj(--------[x , x , x , x , x ])
                  10000019  0   1   2   3   4
     defining forms: given by a function (degree = 3)

o8 : AbstractRationalMap (rational map from PP^4 to PP^4)

i9 : psi' = inverseMap phi'

o9 = -- rational map --
                     ZZ
     source: Proj(--------[x , x , x , x , x ])
                  10000019  0   1   2   3   4
                     ZZ
     target: Proj(--------[x , x , x , x , x ])
                  10000019  0   1   2   3   4
     defining forms: given by a function

o9 : AbstractRationalMap (rational map from PP^4 to PP^4)

i10 : psi = rationalMap psi';

o10 : RationalMap (quadratic rational map from PP^4 to PP^4)

i11 : assert(isInverseMap(phi,psi))

i12 : ZZ/65521[x_0..x_3]; I = minors(2,matrix{{x_0,x_1,x_2},{x_1,x_2,x_3}})

                2                           2
o13 = ideal (- x  + x x , - x x  + x x , - x  + x x )
                1    0 2     1 2    0 3     2    1 3

                 ZZ
o13 : Ideal of -----[x ..x ]
               65521  0   3

i14 : time T = abstractRationalMap(I,"OADP")
 -- used 0.119314s (cpu); 0.0775308s (thread); 0s (gc)

o14 = -- rational map --
                     ZZ
      source: Proj(-----[x , x , x , x ])
                   65521  0   1   2   3
                     ZZ
      target: Proj(-----[x , x , x , x ])
                   65521  0   1   2   3
      defining forms: given by a function

o14 : AbstractRationalMap (rational map from PP^3 to PP^3)

i15 : time projectiveDegrees(T,2)
 -- used 3.20032s (cpu); 1.96548s (thread); 0s (gc)

o15 = 3

i16 : time T2 = T * T
 -- used 2.134e-05s (cpu); 2.1091e-05s (thread); 0s (gc)

o16 = -- rational map --
                     ZZ
      source: Proj(-----[x , x , x , x ])
                   65521  0   1   2   3
                     ZZ
      target: Proj(-----[x , x , x , x ])
                   65521  0   1   2   3
      defining forms: given by a function

o16 : AbstractRationalMap (rational map from PP^3 to PP^3)

i17 : time projectiveDegrees(T2,2)
 -- used 5.08064s (cpu); 3.09506s (thread); 0s (gc)

o17 = 1

i18 : p = apply(3,i->random(ZZ/65521))|{1}

o18 = {-6648, -23396, -12311, 1}

o18 : List

i19 : q = T p

o19 = {-9634, 20704, -25014, 1}

o19 : List

i20 : T q

o20 = {-6648, -23396, -12311, 1}

o20 : List

i21 : time f = rationalMap T
 -- used 4.20603s (cpu); 2.61215s (thread); 0s (gc)

o21 = -- rational map --
                     ZZ
      source: Proj(-----[x , x , x , x ])
                   65521  0   1   2   3
                     ZZ
      target: Proj(-----[x , x , x , x ])
                   65521  0   1   2   3
      defining forms: {
                          3                       2
                       - x  - 32759x x x  + 32760x x ,
                          1         0 1 2         0 3
                       
                             2        2
                       32760x x  + x x  + 32760x x x ,
                             1 2    0 2         0 1 3
                       
                                 2    2
                       - 32760x x  - x x  - 32760x x x ,
                               1 2    1 3         0 2 3
                       
                        3                         2
                       x  + 32759x x x  - 32760x x
                        2         1 2 3         0 3
                      }

o21 : RationalMap (cubic rational map from PP^3 to PP^3)

i22 : describe f!

o22 = rational map defined by forms of degree 3
      source variety: PP^3
      target variety: PP^3
      dominance: true
      birationality: true (the inverse map is already calculated)
      projective degrees: {1, 3, 3, 1}
      number of minimal representatives: 1
      dimension base locus: 1
      degree base locus: 6
      coefficient ring: ZZ/65521

i23 : 
