Is there an easy way to determine whether a set of elements in a field generates the whole field or only a subfield?


Specifically, I have a subfield of $k(x,y)$ described in terms of a canonical set of generators, and I have two other elements of this ring that I think should be sufficient to generate the whole thing but I need to prove it.


In particular, Muller-Quade and Steinwandt's paper "Basic Algorithms for Rational Function Fields" (<http://www.sciencedirect.com/science/article/pii/S0747717198902462>) seems to describe exactly what I'd like to do (check if the canonical generators are inside the field generated by my two elements, and write one in terms of the other) but I'm not familiar enough with the notation they use in their algorithms to really follow them.


Has this sort of algorithm been implemented in a computer algebra program (eg Magma or Maple) that I could use, or is there another way to do it?


If anyone could shed some light on what's happening in the paper above that would also be appreciated, as I'd be interested in generalizing the approach to the q-division ring (i.e. rational functions in two $q$-commuting variables, $q \in k^{\times}$) if possible.



Solving the field membership problem using Grobner bases
In theory, Groebner basis software can do this. I don't know whether there is a standard package for this purpose, or what practical issues may arise. Here is the theory:


Your goal is the following. You are given rational functions $r\_1$, $r\_2$, ..., $r\_n$ in $x$ and $y$. You would like know whether there are polynomials $f(t\_1, \ldots, t\_n)$ and $g(t\_1,\ldots, t\_n)$ such that $f(r\_1, \ldots, r\_n) - g(r\_1, \ldots, r\_n) x =0$, and similarly for $y$ in place of $x$. 


Our strategy will be the following: Map $k[t\_1, \ldots, t\_n, u] \to k(x,y)$ by $t\_i \mapsto r\_i$, $u \mapsto x$. Let $I$ be the kernel of this map. 


We will test whether $I$ contains an element whose degree in $u$ is $1$. Actually we need to do slightly more than that: we need to find an element $f u - g$ where $f$ and $g$ are not in $I$, but the Grobner technology will do that for us.


The problem breaks into two parts


**Getting the ideal $I$** If the $r\_i$ are themselves polynomials in $x$ and $y$, you can see a worked example of doing this with Grobner bases in the Macualay documentation [here](http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.4/share/doc/Macaulay2/Macaulay2Doc/html/_elimination_spof_spvariables.html). Macaulay also provides a function [kernel](http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.4/share/doc/Macaulay2/Macaulay2Doc/html/_kernel_lp__Ring__Map_rp.html) which does this; I don't know what the advantages are of using kernel or doing it by hand.


If $r\_i=p\_i/q\_i$, my first idea is to define the ring $S = k[x,y,s\_1, \ldots, s\_n]/(q\_i(x,y) s\_i -1)$, and map $k[t\_1, \ldots, t\_n]$ to $S$ by $t\_i \mapsto p\_i(x,y) s\_i$, and adapt the Grobner basis methods to this case. If you are working in Macaulay specifically, then Macaualy has a class [FractionField](http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.4/share/doc/Macaulay2/Macaulay2Doc/html/___Fraction__Field.html), with Ring as an ancestor class, meaning you should be able to directly talk about maps $k[t\_1, \ldots, t\_n,u] \to k(x,y)$, and not just about maps to quotients of polynomial rings. However, the documentation of FractionField warns that using it is a performance hit; so you might still be better off only inverting the elements you need to invert.


**Testing whether $I$ contains an element of degree $1$ in $u$** The way to do this in theory is to compute a Grobner basis of $I$ in lex order, putting the variable $u$ first. If the answer contains an element $fu-g$ of degree $1$, then this is your answer; if not, then $x$ cannot be written as a rational expression in the $r\_i$. Note that $f$ and $g$ will not be in $I$ as, if they were, $fu-g$ would be eliminated from the Grobner basis as redundant.


But lex term orders are notoriously slow, so there might be a better way to do this in practice. Hopefully, someone will show up soon who understands these issues.


