Changes between Initial Version and Version 1 of Ticket #7711, comment 22


Ignore:
Timestamp:
03/24/12 21:32:42 (10 years ago)
Author:
AlexGhitza
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7711, comment 22

    initial v1  
    1515Behind the scenes Sage performed 2/2 and decided that the answer was 1 in ZZ rather than 1 in QQ, so this seems to break the convention.  Also, the answer has a different parent than (3*x).integral(), which is the type of inconsistency that Paul was pointing out before.  So should this stay the way it is, or should this be changed to be more consistent?
    1616
    17 But it gets a tiny bit more complicated than this.  Suppose your coefficients are not ZZ, but rather ZZ[y], where y is a vector of 200 variables.  The integral of 2*x is still x^2, but where do we want this x^2 to live?  Possible answers are (a) ZZ[y][x], (b) Frac(ZZ[y])[x], (c) QQ[y][x].
    18 The current behavior is (a) for 2*x and (b) for 3*x, and I am currently leaning toward changing both to (c).  This is the question that I need some input on.
     17But it gets a tiny bit more complicated than this.  Suppose your coefficients are not ZZ, but rather ZZ[y], where y is a vector of 200 variables.  The integral of 2*x is still {{{x^2}}}, but where do we want this {{{x^2}}} to live?  Possible answers are (a) ZZ[y][x], (b) Frac(ZZ[y])[x], (c) QQ[y][x].
     18The current behavior is (a) for 2*x and (b) for 3*x, and I am currently leaning toward changing both to (c).  Here's why: you have p in R[x], where R is some coefficient ring.  When you do p.integral(), you are not really dividing p by integers n, but rather the coefficients of p by integers n.  So maybe we should look at what division by n in the coefficient ring R does:
     19
     20{{{
     21sage: R.<y0,y1,y2,y3> = ZZ[]
     22sage: S.<x> = R[]
     23sage: p = 2*y0
     24sage: p.parent()
     25Multivariate Polynomial Ring in y0, y1, y2, y3 over Integer Ring
     26sage: (p/2).parent()
     27Multivariate Polynomial Ring in y0, y1, y2, y3 over Rational Field
     28sage: p = 3*y0
     29sage: (p/2).parent()
     30Multivariate Polynomial Ring in y0, y1, y2, y3 over Rational Field
     31}}}
     32
     33So p/2 is not in the fraction field of R.  This is what I would like integral() to do as well.
     34
     35Thoughts?