On Thursday, March 14, 2024 at 6:04:26 AM UTC-4 Frank Moore wrote:
> Since not all the output variables are in ring R (the 2nd half of graphR),
> I interpret this to mean that
b = (u1 + u2 + v1 + v2)> is NOT in the image of
f().
> Is that right ?
This certainly holds when both rings are polynomial rings (and is proven in this case on page 369 of CLO). I haven't worked through the details in the case of a fraction field, but I think similar modifications to what was in Chapter 3 could be made to prove it in this case.
As for writing a new function, give it a shot! If you have trouble, just reach out once more and I can help.
Using your graph ideal variant technique, I've written a new function, called mypreimage(f,b). See attached file.
It's similar to the built-in preimage(), but the second argument b is now a ring element instead of an ideal.
It does not work when b has a nontrivial denominator, but that's good enough for me now.
So I'm pretty happy with it, but there are 2 areas where I'm not sure I've done things in a good M2 way:
1. Before exiting the function, I try to restore the previous state of things with these 3 lines:
use R;
use F;
erase( unused_0 ) ;
The two use statements are needed because without them, the indeterminates are considered
to be in the ring graphR.
2. because the new indeterminate name y might conflict with an existing name, I wrote a function
unusedindeterminate() to get a new name that does not conflict.
Are there any better ways to do these things ?
Unfortunately, even when b is in the image of f(), mypreimage() can compute an invalid preimage,
where some of the output indeterminates are not in the source R.
The only time I've seen this happen is when f() is not injective.
Here is an example:
F = frac( QQ[u1,v1,u2,v2] )
p = u1*u2*v1*v2 ;
s = (v1*v2 - u1*u2) / 2 ;
c = (v1*v2 + u1*u2) / 2 ;
z1 = (v1 - u1) + (v2 - u2) ;
z1c = (1/v1 - 1/u1) + (1/v2 - 1/u2) ;
R = QQ[P,S,C,Z1,Z1C]
f = map( F, R, {p,s,c,z1,z1c} )
kernel( f )
= ideal( S^2 − C^2 + P ) -- so f is not injective
b = (v1 - u1)*(v2 - u1)*(v1 - u2)*(v2 - u2)
f( 4*S^2 + P*Z1*Z1C ) == b -- so b is in the image of f()
= true
mypreimage( f, b )
= (2*v1*S*Z1 + 2*v2*S*Z1 - 4*S^2 - S*Z1^2 - C*Z1^2)*(-1)
So unfortunately, this polynomial has v1 and v2.
Interestingly, the result depends on the order of the indeterminates in R.
If P is moved from first to last, then mypreimage(f,b) is succesful and returns
what I want: 4*S^2 + P*Z1*Z1C.
Another problem I've had with fraction fields is that kernel() fails
when QQ is replace by QQ[i]/(i^2+1). The error message is:
And I have no idea what this means.
So considering these two problems, I'm planning a new approach.
Since I need to write a function anyway, I plan to go back to what
I mentioned earlier in this conversation:
convert from fraction field version to a polynomial version,
use the built-in preimage()for that,
and then convert the result back to the fraction field version.
It may take some time.
Thanks again for your help,
Glenn Davis