Solving the Field Membership Problem using Grobner Bases - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-24T07:14:10Z http://mathoverflow.net/feeds/question/104846 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/104846/solving-the-field-membership-problem-using-grobner-bases Solving the Field Membership Problem using Grobner Bases eithil 2012-08-16T15:11:22Z 2012-08-17T10:50:18Z <p>Is there an easy way to determine whether a set of elements in a field generates the whole field or only a subfield?</p> <p>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.</p> <p>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.</p> <p>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?</p> <p>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.</p> http://mathoverflow.net/questions/104846/solving-the-field-membership-problem-using-grobner-bases/104853#104853 Answer by David Speyer for Solving the Field Membership Problem using Grobner Bases David Speyer 2012-08-16T15:54:38Z 2012-08-16T15:54:38Z <p>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:</p> <p>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$. </p> <p>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. </p> <p>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.</p> <p>The problem breaks into two parts</p> <p><b>Getting the ideal $I$</b> 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 <a href="http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.4/share/doc/Macaulay2/Macaulay2Doc/html/_elimination_spof_spvariables.html" rel="nofollow">here</a>. Macaulay also provides a function <a href="http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.4/share/doc/Macaulay2/Macaulay2Doc/html/_kernel_lp__Ring__Map_rp.html" rel="nofollow">kernel</a> which does this; I don't know what the advantages are of using kernel or doing it by hand.</p> <p>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 <a href="http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.4/share/doc/Macaulay2/Macaulay2Doc/html/___Fraction__Field.html" rel="nofollow">FractionField</a>, 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.</p> <p><b>Testing whether $I$ contains an element of degree $1$ in $u$</b> 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.</p> <p>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.</p> http://mathoverflow.net/questions/104846/solving-the-field-membership-problem-using-grobner-bases/104907#104907 Answer by eithil for Solving the Field Membership Problem using Grobner Bases eithil 2012-08-17T10:50:18Z 2012-08-17T10:50:18Z <p>Between David's answer and much staring at the paper I linked to above, I think I've mostly figured out what's going on there so I thought I'd post a summary of their method here as well in case anyone else had a similar problem. I'm focusing here on $how$ to use their algorithm, not $why$ it works: I found it was a lot easier to follow the theory once I knew where I was going!</p> <p>Their setup is: given a field $k(x_1,\dots, x_n) = k(\mathbf{x})$ and a set of elements $\mathbf{g} = \{g_1, \dots, g_m\}\subset k(\mathbf{x})$, we can form the field $k(\mathbf{g})$ generated by the elements of $\mathbf{g}$ and then ask: given $f \in k(\mathbf{x})$, do we have $f \in k(\mathbf{g})$ and if so, how can we write $f$ in terms of the generators? The authors' aim is to answer this without resorting to using the lex ordering, which as mentioned above can be very slow.</p> <p>So let $g_i = n_i/d_i$, and introduce a new variable $T_i$ for each $g_i$. Collect together all of the prime divisors of each of the denominators $d_i$ into a set $\{p_1, \dots, p_r\}$ (eliminate any repeats) and introduce a new variable $Y_i$ for each $p_i$.</p> <p>In the polynomial ring $k[Y_1, \dots, Y_r, x_1, \dots, x_n, T_1, \dots, T_m]$ define the ideal $I=\langle n_1-T_1d_1, \dots, n_m-T_md_m, Y_1p_1-1,\dots,Y_rp_r-1\rangle$ and compute a Groebner basis of $I$. The only restriction on ordering is that you should have $\textbf{Y} >> \textbf{x} >> \textbf{T}$, within each block they can be ordered however you like.</p> <p>Eliminate all terms involving any $Y_i$ from the Groebner basis; call the resulting set $G$. Let $H$ be the subset of $G$ involving terms only in the $T_i$: this may be empty. (This step seems to deal with syzygies between the generators, giving you the simplest result at the end and avoiding dividing by zero at any point.)</p> <p>Let $S=\langle H \rangle$ and define $L = Q(k[\mathbf{T}]/S)$, so if $H$ was empty this is just $k(\mathbf{T})$. Let $\pi$ be the natural embedding $k[\mathbf{T}][\mathbf{x}] \hookrightarrow L[\mathbf{x}]$ and $G' := \pi(G)$.</p> <p>If $f=n_f/d_f \in k(\mathbf{x})$ is the element of interest then introduce a new variable $A$ (so we're now in the ring $L[\mathbf{x},A]$) and reduce the polynomial $n_f-Ad_f$ to normal form wrt the Groebner basis $G'$: you should obtain an expression $N-AD$.</p> <p>Optionally at this point, you can reduce $N$ and $D$ to their simplest form by reducing their numerators wrt $\pi(H)$; recall that $N,D \in L[\mathbf{x}]$ where $L$ is a localization of $k[\mathbf{T}]$ so they could be rational functions in the $T_i$.</p> <p>If $D = 0$ then $f \not\in k(\mathbf{x})$. If $D \neq 0$ then solve $N-AD = 0$, i.e. $A=N/D$. If $N/D \not\in k(\mathbf{T})$ then $f \not\in k(\mathbf{g})$, otherwise $f=N(g_1, \dots, g_m)/D(g_1,\dots,g_m)$.</p> <hr> <p>Whew! I hope that's fairly clear if you just want to apply the algorithm; if you want to understand why each step works, the paper I linked to in the question has all the technical details. I suspect it's essentially the same approach as David's answer, with a few tweaks to avoid necessarily using the lex ordering and to deal with relations between the set of generators.</p>