Ask Your Question
1

How to solve a linear equation within a field of rational functions?

asked 2020-04-13 00:32:17 +0200

Bernardo Soares gravatar image

I have a field of rational functions over the rational numbers in 4 variables:

K = Frac(PolynomialRing(QQ,'x,y,z,w'))

and some explicit elements R[0],...,R[n] in K. Is there a way to solve the equation

a[0]R[0] + ... + a[n]R[n] == 0

with a[i] in QQ? That is, I would like to first check if there are any solutions. In the positive case, then I would like an explicit solution.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2020-04-13 15:41:23 +0200

Sébastien gravatar image

updated 2020-04-13 15:42:49 +0200

You may evaluate the list L of rational functions at various random points to get a matrix of at most nrows:

sage: def to_matrix(L, nrows):
....:     rows = []
....:     for _ in range(nrows):
....:         (a,b,c,d) = (QQ^4).random_element()
....:         if all(p.denominator().subs(x=a,y=b,z=c,w=d)!=0 for p in L):
....:             rows.append([p.subs(x=a,y=b,z=c,w=d) for p in L])
....:     return matrix(rows)

and then, if you have a list L of let's say 5 rational functions,

sage: K = Frac(PolynomialRing(QQ,'x,y,z,w'))
sage: L = [K.random_element() for _ in range(5)]
sage: L
[(-5*x*z - 2*y*z - 1/4*w^2 + z - 2)/(y*z + 1/5*z^2 - w^2 + 1/9*x - 4/95*y),
 (97/12*y*z - z^2 + 7*y + 1/114*w + 1/2)/(2*x*y - x*z + 4/5*y*z + 2*x*w + 3*z),
 (4/3*y^2 - 2*z^2 + 3*x*w - 19/12*z)/(-1/5*y*z + 28/3*y*w + z*w - 4*x + 2*z),
 (-x*y - 5/2*x*z + 1/4*z + 1/12)/(1/9*x*y - 4*z^2 - 137/2*z + w),
 (x*y + 1/4*x*z + 1/14*y*z - 1/2*y*w + 33*w^2)/(x*w + 1/14*z)]

You may evaluate each of the rational function at let's say m>5 different random points, giving you a m x 5 matrix. If m=8, it may be:

sage: M = to_matrix(L, 8)
sage: M
[  -403845/186844     136275/60268       78217/2968         -603/107         18217/83]
[      28215/5516        -1709/228            -17/4           -39/22               15]
[  2465820/159503      37355/21804 6298795/15641408   124689/1572500         2553/361]
[        -725/124        -341/2052           -43/26           -1/217             77/6]
[ 1133825/1135924 -2781755/1123584    -58215/205502      -1056/20131      169723/1552]
[    -30305/16636     -104315/1368          505/561           -4/873            165/8]
[       2375/5764        -3055/684        695/13764           -1/339           -29403]
[ -2028915/161732      70027/69084        7073/2275      -2022/79555        -3072/169]

Then, the space of coefficients you are looking for must live inside of the right kernel of the matrix M:

sage: M.right_kernel()
Vector space of degree 5 and dimension 0 over Rational Field
Basis matrix:
[]

If the dimension of the right kernel is 0, then you got your answer. If M.right_kernel() is not of dimension 0, then you should retry again after increasing the number m of rows to make sure this is not an artefact in which case the space of explicit solutions will be given by the basis matrix.

edit flag offensive delete link more

Comments

That's an interesting solution. Thank you!

Bernardo Soares gravatar imageBernardo Soares ( 2020-04-13 16:24:12 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-04-13 00:32:17 +0200

Seen: 232 times

Last updated: Apr 13 '20