Is it possible to "solve" a ring map equation, when the target ring is a fraction field ?

96 views
Skip to first unread message

Glenn Davis

unread,
Mar 11, 2024, 11:50:20 PMMar 11
to Macaulay2
Hello,

I have created a ring map f(), where the target ring is a fraction field F,
and I would like to "solve"  the equation:
    f(X) = b
for a specific b in F.
The function preimage() cannot be used, because it fails when the target is a fraction field.

Here is an example, where I already know X by different means:

    F = frac( QQ[u1,v1,u2,v2] )

    s   = (v1*v2 - u1*u2) / 2 ;
    z1  = (v1 - u1) + (v2 - u2) ;
    z1c = (1/v1 - 1/u1) + (1/v2 - 1/u2) ;
    p   = u1*u2*v1*v2 ;

    R = QQ[S,Z1,Z1C,P]

    f = map( F, R, {s,z1,z1c,p} )
   
    isInjective( f )
        = true

    b = (v1 - u1)*(v2 - u1)*(v1 - u2)*(v2 - u2)

    f( 4*S^2  +   P*Z1*Z1C ) == b
        =  true  


so we see that     X = 4*S^2  +   P*Z1*Z1C.
And we know that  X is unique because f() is injective.

But is there any way in Macaulay2 to find X for any b,
or determine whether there is no such X ?

I am using Macaulay2, version 1.22.0.1, in Macaulay2Web.

Thank you,
Glenn Davis

Douglas Leonard

unread,
Mar 12, 2024, 11:53:50 AMMar 12
to maca...@googlegroups.com
OK, so what am I missing here?
I would have written a polynomial version of this, computed a GB and reduced any b by it.
So, for instance:

R=QQ[v1,v2,u1,u2]
x1=v1*v2-u1*u2
x2=v1-u1+v2-u2
x3=(v1+v2)*u1*u2-(u1+u2)*v1*v2
I=ideal(x1,x2,x3)
G=gens gb I
b=(v1-u1)*(v2-u1)*(v1-u2)*(v2-u2)
b%I-- =0, so b can be reduced in at least one way by division elements of G

From: maca...@googlegroups.com <maca...@googlegroups.com> on behalf of Glenn Davis <davisgl...@gmail.com>
Sent: Monday, March 11, 2024 10:50 PM
To: Macaulay2 <maca...@googlegroups.com>
Subject: [EXT] [Macaulay2] Is it possible to "solve" a ring map equation, when the target ring is a fraction field ?
 
CAUTION: Email Originated Outside of Auburn.
--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/macaulay2/1c8a9aa0-1553-4f83-8210-10240ae217d1n%40googlegroups.com.

Glenn Davis

unread,
Mar 12, 2024, 8:17:09 PMMar 12
to Macaulay2
Thank you for your very quick answer.  If I understand it correctly,
it shows that for the example equation f(X)=b, an X exists.
But I want more.
I want to know what X is, and I want Macaulay2 to compute X without my own
conversion from fractions to polynomials, and then back again.

Don't get me wrong; I don't mean to be critical.
I think Macaulay2 is very powerful, and it has already been
a great help to me.   I am very grateful.
But I also expect that it can do these 2 things, and I have read much
of the documentation, and cannot find a way to do them.

Frank Moore

unread,
Mar 12, 2024, 9:29:51 PMMar 12
to maca...@googlegroups.com
Glenn,

I think one can use a variant of the graph ideal to perform this calculation.  The fundamentals of this idea are discussed in Section 3.3 of Cox-Little-O'Shea:

F = frac(QQ[u1,v1,u2,v2])

s   = (v1*v2 - u1*u2) / 2
z1  = (v1 - u1) + (v2 - u2)
z1c = (1/v1 - 1/u1) + (1/v2 - 1/u2)
p   = u1*u2*v1*v2
R = QQ[S,Z1,Z1C,P]
f = map( F, R, {s,z1,z1c,p} )
graphR = QQ[y,u1,v1,u2,v2,S,Z1,Z1C,P,MonomialOrder => Lex]
phi = map(graphR,F,(vars graphR)_{1,2,3,4})
graphI = ideal { (phi denominator s)*S - (phi numerator s),
                 (phi denominator z1)*Z1 - (phi numerator z1),
                 (phi denominator z1c)*Z1C - (phi numerator z1c),
                 (phi denominator p)*P - (phi numerator p),
                 1 - (phi denominator s)*(phi denominator z1)*(phi denominator z1c)*(phi denominator p)*y}  
graphIgb = gb graphI
netList flatten entries gens graphIgb

b = (v1 - u1)*(v2 - u1)*(v1 - u2)*(v2 - u2)
b % graphIgb

The reduction of b modulo the GB given should give the preimage of b that you seek.

Frank



--
Dr. W. Frank Moore
Associate Professor
Department of Mathematics and Statistics
Wake Forest University

email: moo...@wfu.edu

Glenn Davis

unread,
Mar 13, 2024, 9:43:47 PMMar 13
to Macaulay2
YES !    

i10 :  b % graphIgb
o10 :  4*S^2 - Z1*Z1C*P

which is what I wanted.  Thank you so much !

I'm not sure why this works yet, but I found Section 3.3 in the reference you gave,
and see that you are roughly following Theorem 2 (Rational Implicitization),
and the resulting implicitization algorithm by Kalkbrener.
I will be studying these to find why it works.

I tried some other values of b, and here is an example:

i11 : (u1 + u2 + v1 + v2) % graphIgb
o11 : 2*v1 + 2*v2 - Z1

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 ?

There is a lot of typing using this method to get the preimage of b,
and I will be needing to do this many times.
I think writing a new Macaulay2 function is appropriate, so I guess I'll give it a go.

Thanks again,
Glenn

Frank Moore

unread,
Mar 14, 2024, 6:04:26 AMMar 14
to maca...@googlegroups.com
> 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.

Glenn Davis

unread,
Mar 21, 2024, 10:29:26 PMMar 21
to Macaulay2
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:
    stdio:544:6:(3)error: expected all degrees to have length 
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

mypreimage.m2

Glenn Davis

unread,
Apr 23, 2024, 10:04:47 PMApr 23
to Macaulay2
I found a stupid mistake in my function  mypreimage(). It was a counting error.

I have fixed it and I  *think*  it's correct now.  The new file is attached.
It is a straightforward generalization of 
    Proposition 7.  p. 369,   in Cox-Little-O'Shea
to the case where the target is a fraction field.

mypreimage() now correctly computes the example in my previous post.

But unfortunately I found another example where the new   mypreimage() fails.

F = frac( QQ[u1,v1,u2,v2,u3,v3] )

p   = u1*u2*v1*v2*u3*v3 ;
s   = (v1*v2*v3 - u1*u2*u3) / 2 ;
c   = (v1*v2*v3 + u1*u2*u3) / 2 ;
z1  = (v1 - u1) + (v2 - u2) + (v3 - u3) ;
z1c = (1/v1 - 1/u1) + (1/v2 - 1/u2) + (1/v3 - 1/u3) ;
z2  = ( (v1^2 - u1^2) + (v2^2 - u2^2) + (v3^2 - u3^2) ) / 2 ;
z2c = ( (1/v1^2 - 1/u1^2) + (1/v2^2 - 1/u2^2) + (1/v3^2 - 1/u3^2) ) / 2;

R = QQ[S,C,Z1,Z1C,Z2,Z2C,P]

f = map( F, R, {s,c,z1,z1c,z2,z2c,p} )

b = (v1 - u1)*(v2 - u1)*(v3 - u1) * (v1 - u2)*(v2 - u2)*(v3 - u2) * (v1 - u3)*(v2 - u3)*(v3 - u3) ;

--  this X was computed by other means
X = -(1/2)*P*S*(Z1*Z1C)^2  +  8*S*C^2  +  4*P*S*Z1*Z1C  +  P*C*( Z1C^2*Z2 - Z1^2*Z2C )  - 8*P*S  +  2*P*S*Z2*Z2C

f( X ) == b
--   true,   so  the preimage of b is NOT empty

mypreimage( f, b )
--  this returns a result with v1,v2,v3,
--  which would imply that the preimage of b is empty



Glenn Davis

mypreimage2.m2
Reply all
Reply to author
Forward
0 new messages