Ilya Zakharevich on Fri, 2 Nov 2001 15:06:37 -0500 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: subst() broken |
On Fri, Nov 02, 2001 at 04:02:49PM +0100, Bill Allombert wrote: > > ? subst(Mod(1+y,z),y,Mod(x,z)) > > %78 = 0 > > ? subst(Mod(y,-b*a^2+t^3),y,Mod(x,-b*a^2+t^3)) > > %75 = 0 > > ? subst(Mod(1+y,-b*a^2+t^3),y,Mod(x,-b*a^2+t^3)) > > %76 = Mod(Mod(1, -b*a^2 + t^3), -b*a^2 + t^3) > > > > The first two are "just wrong". The last one is such, and also very > > unusable... > I am not sure subst is broken at all. Maybe Mod is broken from some point of vue > but the behaviour you spot is perfectly correct. Remember variable priority is > very important in multivariate expression and especially in POLMOD. I cannot "remember" it because priorities are not documented. I find some unintelligible hints (in the section "Polmods"); some other *hints* in "Type t_POLMOD (polmod)' (without definition of what is a priority); and a kinda-definition in "PARI variables" (without mentioning the relation to the time flow). Nowhere it is written how priorities affect any operation. (BTW, nowhere is it written why multivar polynomials are called "non-sparse", when the presentation is "very sparse" - the multiplicative constant is the max-degree-in-any-separate-variable, which is usually very small). > ? Mod(1+y,z) > %2 = 0 > Mod(1+y,z) involve a division in the ring Q(Z)[Y]. Now I remember this mentioned some time ago on this list. Is this *documented*? > Probably you mean (1+y)*Mod(1,z), but it is not the same thing: > it is a polynomial not a POLMOD. I have no slightest idea what you mean by this sentence. Can it be expressed algebraically, or it is just some "implementation detail"? > %76 seems good to me. Last time Mod(Mod) was mentioned (by me ;-), the answer was that simplify() should kill it. Why did not it? > Why not just writing subst(Mod(1+y,-b*a^2+t^3),y,x) > if it what you want ? What were you expecting ? Well, I expect that subst(Mod(1+y,-b*a^2+t^3),y,x) should not differ from subst(Mod(1+y,-b*a^2+t^3),y,Mod(x,-b*a^2+t^3)). Why should it? I'm trying to sove a simple problem: given a 3rd degree homogeneous 3-variate polynomial poly and an inflection point p, find the corresponding Weirstrass form. p is a polmod. So the linear transformation which moves it to (0,1,0) has coefficients in polmods. Now I need to change variables in poly; there are 3 of them; after I change the first one, poly has polmods as coefficients. The second substitution leads to the examples I had shown you. Hope this helps, Ilya