GROEBNER.TEX 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547
  1. \documentstyle[11pt,reduce]{article}
  2. \title{GROEBNER: A Package for Calculating Gr\"obner Bases}
  3. \date{}
  4. \author{
  5. H. Melenk \& W. Neun \\[0.05in]
  6. Konrad--Zuse--Zentrum \\
  7. f\"ur Informationstechnik Berlin \\
  8. Heilbronner Strasse 10 \\
  9. D--10711 Berlin-Wilmersdorf \\
  10. Germany \\[0.05in]
  11. Email: melenk@sc.zib--berlin.de \\[0.05in]
  12. and \\[0.05in]
  13. H.M. M\"oller \\[0.05in]
  14. Fernuniversit\"at Hagen \\
  15. FB Math und Informatik\\
  16. Postfach 940 \\
  17. D--58084 Hagen \\
  18. Germany\\[0.05in]
  19. Email: Michael.Moeller@fernuni-hagen.de}
  20. \begin{document}
  21. \maketitle
  22. \index{Gr\"obner Bases}
  23. Gr\"obner bases are a valuable tool for solving problems in
  24. connection with multivariate polynomials, such as solving systems of
  25. algebraic equations and analyzing polynomial ideals. For a definition
  26. of Gr\"obner bases, a survey of possible applications and further
  27. references, see~\cite{Buchberger:85}. Examples are given in \cite{Boege:86},
  28. in \cite{Buchberger:88} and also in the test file for this package.
  29. \index{GROEBNER package} \index{Buchberger's Algorithm}
  30. The GROEBNER package calculates Gr\"obner bases using the
  31. Buchberger algorithm. It can be used over a variety of different
  32. coefficient domains, and for different variable and term orderings.
  33. The current version of the package uses parts of the previous
  34. version, written by R. Gebauer, A.C. Hearn, H. Kredel and M.
  35. M\"oller. The algorithms implemented in the current version are
  36. documented in \cite{Faugere:89}, \cite{Gebauer:88},
  37. \cite{Kredel:88a} and \cite{Giovini:91}.
  38. \section{Compatibility}
  39. Important modifications of the present GROEBNER package compared
  40. with the REDUCE 3.5 GROEBNER package:
  41. \begin{itemize}
  42. \item The variables of the polynomial ring are now declared in the
  43. $TORDER$ statement together with the term order mode. The old
  44. style (including the variable list in the function calls)
  45. is still accepted, but will not be supported in future versions.
  46. \item The term order mode $private$ has been eliminated. Instead the
  47. mode $matrix$ has been introduced, which allows you to
  48. define any compatible term order. For optimal efficiency
  49. a matrix can be compiled.
  50. \item Polynomial side relations in the parameter domain are now
  51. considered inside the Gr\"obner calculations. You can enter
  52. them as ordinary $LET$ rules.
  53. \item There is an extension $NCPOLY$ for computing with
  54. non--commutative ideals of solvable type. $NCPOLY$ is loaded
  55. as a separate module, but it uses internally the functions
  56. of $GROEBNER$.
  57. \end{itemize}
  58. \section{Background}
  59. \subsection{Variables, Domains and Polynomials}
  60. The various functions of the GROEBNER package manipulate
  61. equations and/or polynomials; equations are internally
  62. transformed into polynomials by forming the difference of
  63. left-hand side and right-hand side.
  64. All manipulations take place in a ring of polynomials in some
  65. variables $x1, \ldots , xn$ over a coefficient domain $D$:
  66. \[
  67. D [x1,\ldots , xn],
  68. \]
  69. where $D$ is a field or at least a ring without zero divisors.
  70. The set of variables $x1,\ldots ,xn$ can be given explicitly by the
  71. user or it is extracted automatically from the
  72. input expressions.
  73. All REDUCE kernels can play the role of ``variables'' in this context;
  74. examples are
  75. %{\small
  76. \begin{verbatim}
  77. X Y Z22 SIN(ALPHA) COS(ALPHA) C(1,2,3) C(1,3,2) FARINA4711
  78. \end{verbatim}
  79. %}
  80. The domain $D$ is the current REDUCE domain with those kernels
  81. adjoined that are not members of the list of variables. So the
  82. elements of $D$ may be complicated polynomials themselves over
  83. kernels not in the list of variables; if, however, the variables are
  84. extracted automatically from the input expressions, $D$ is identical
  85. with the current REDUCE domain. It is useful to regard kernels not
  86. being members of the list of variables as ``parameters'', e.g.
  87. \[
  88. \begin{array}{c}
  89. a * x + (a - b) * y**2 \;\mbox{ with ``variables''}\ \{x,y\} \\
  90. \mbox{and ``parameters'' $\;a\;$ and $\;b\;$}\;.
  91. \end{array}
  92. \]
  93. The current version of the Buchberger algorithm has two internal
  94. modes, a field mode and a ring mode. In the starting phase the
  95. algorithm analyzes the domain type; if it recognizes $D$ as being a
  96. ring it uses the ring mode, otherwise the field mode is needed.
  97. Normally field calculations occur only if all coefficients are numbers
  98. and if the current REDUCE domain is a field (e.g. rational numbers,
  99. modular numbers). In general, the ring mode is faster. When no specific
  100. REDUCE domain is selected, the ring mode is used, even if the input
  101. formulas contain fractional coefficients: they are multiplied by their
  102. common denominators so that they become integer polynomials.
  103. \subsection{Term Ordering} \par
  104. In the theory of Gr\"obner bases, the terms of polynomials are
  105. considered as ordered. Several order modes are available in
  106. the current package, including the basic modes:
  107. \index{LEX ! term order} \index{GRADLEX ! term order}
  108. \index{REVGRADLEX ! term order}
  109. \begin{center}
  110. LEX, GRADLEX, REVGRADLEX
  111. \end{center}
  112. All orderings are based on an ordering among the variables. For
  113. each pair of variables $(a,b)$ an order relation must be defined, e.g.
  114. ``$ a\gg b $''. The greater sign $\gg$ does not represent a numerical
  115. relation among the variables; it can be interpreted only in terms of
  116. formula representation: ``$a$'' will be placed in front of ``$b$'' or
  117. ``$a$'' is more complicated than ``$b$''.
  118. The sequence of variables constitutes this order base. So the notion
  119. of
  120. \[
  121. \{x1,x2,x3\}
  122. \]
  123. as a list of variables at the same time means
  124. \[
  125. x1 \gg x2 \gg x3
  126. \]
  127. with respect to the term order.
  128. If terms (products of powers of variables) are compared with LEX,
  129. that term is chosen which has a greater variable or a higher degree
  130. if the greatest variable is the first in both. With GRADLEX the sum of
  131. all exponents (the total degree) is compared first, and if that does
  132. not lead to a decision, the LEX method is taken for the final decision.
  133. The REVGRADLEX method also compares the total degree first, but
  134. afterward it uses the LEX method in the reverse direction; this is the
  135. method originally used by Buchberger.
  136. \example \ with $\{x,y,z\}$: \index{GROEBNER package ! example}
  137. \[
  138. \begin{array}{rlll}
  139. \multicolumn{2}{l}{\hspace*{-1cm}\mbox{\bf LEX:}}\\
  140. x * y **3 & \gg & y ** 48 & \mbox{(heavier variable)} \\
  141. x**4 * y**2 & \gg & x**3 * y**10 & \mbox{(higher degree in 1st
  142. variable)} \vspace*{2mm} \\
  143. \multicolumn{2}{l}{\hspace*{-1cm}\mbox{\bf GRADLEX:}} \\
  144. y**3 * z**4 & \gg & x**3 * y**3 & \mbox{(higher total degree)} \\
  145. x*z & \gg & y**2 & \mbox{(equal total degree)}
  146. \vspace*{2mm}\\
  147. \multicolumn{2}{l}{\hspace*{-1cm}\mbox{\bf
  148. REVGRADLEX:}} \\
  149. y**3 * z**4 & \gg & x**3 * y**3 & \mbox{(higher total degree)} \\
  150. x*z & \ll & y**2 & \mbox{(equal total degree,} \\
  151. & & & \mbox{so reverse order of LEX)}
  152. \end{array}
  153. \]
  154. The formal description of the term order modes is similar to
  155. \cite{Kredel:88}; this description regards only the exponents of a term,
  156. which are written as vectors of integers with $0$ for exponents of a
  157. variable which does not occur:
  158. \[
  159. \begin{array}{l}
  160. (e) = (e1,\ldots , en) \;\mbox{ representing }\; x1**e1 \ x2**e2 \cdots
  161. xn**en. \\
  162. \deg(e) \; \mbox{ is the sum over all elements of } \;(e) \\
  163. (e) \gg (l) \Longleftrightarrow (e)-(l)\gg (0) = (0,\ldots ,0)
  164. \end{array}
  165. \]
  166. \[
  167. \begin{array}{rll}
  168. \multicolumn{1}{l}{\hspace*{-.5cm}\mbox{\bf LEX:}} \\
  169. (e) > lex > (0) & \Longrightarrow & e_k > 0 \mbox{ and } e_j =0
  170. \mbox{ for }\; j=1,\ldots , k-1\vspace*{2mm} \\
  171. \multicolumn{1}{l}{\hspace*{-.5cm}\mbox{\bf
  172. GRADLEX:}} \\
  173. (e) >gl> (0) & \Longrightarrow & \deg(e)>0 \mbox { or } (e) >lex>
  174. (0)\vspace*{2mm} \\
  175. \multicolumn{1}{l}{\hspace*{-.5cm}\mbox{\bf
  176. REVGRADLEX:}}\\
  177. (e) >rgl> (0) & \Longrightarrow & \deg(e)>0 \mbox{ or }(e) <lex<
  178. (0)
  179. \end{array}
  180. \]
  181. Note that the LEX ordering is identical to the standard REDUCE
  182. kernel ordering, when KORDER is set explicitly to the sequence of
  183. variables.
  184. \index{default ! term order}
  185. LEX is the default term order mode in the GROEBNER package.
  186. It is beyond the scope of this manual to discuss the functionality of
  187. the term order modes. See \cite{Buchberger:88}.
  188. The list of variables is declared as an optional parameter of the
  189. TORDER statement (see below). If this declaration is missing
  190. or if the empty list has been used, the variables are extracted from
  191. the expressions automatically and the REDUCE system order defines
  192. their sequence; this can be influenced by setting an explicit order
  193. via the KORDER statement.
  194. The result of a Gr\"obner calculation is algebraically correct only
  195. with respect to the term order mode and the variable sequence
  196. which was in effect during the calculation. This is important if
  197. several calls to the GROEBNER package are done with the result of the
  198. first being the input of the second call. Therefore we recommend
  199. that you declare the variable list and the order mode explicitly.
  200. Once declared it remains valid until you enter a new TORDER
  201. statement. The operator GVARS helps you extract the variables
  202. from a given set of polynomials.
  203. \subsection{The Buchberger Algorithm}
  204. \index{Buchberger's Algorithm}
  205. The Buchberger algorithm of the package is based on {\sc
  206. Gebauer/M\"oller} \cite{Gebauer:88}.
  207. Extensions are documented in \cite{Melenk:88} and \cite{Giovini:91}.
  208. % Chapter 2
  209. \section{Loading of the Package}
  210. The following command loads the package into
  211. REDUCE (this syntax may vary according to implementation):
  212. \begin{center}
  213. load groebner;
  214. \end{center}
  215. The package contains various operators, and switches for control
  216. over the reduction process. These are discussed in the following.
  217. % Chapter 3
  218. \section{The Basic Operators}
  219. % Section 3.1
  220. \subsection{Term Ordering Mode}
  221. \begin{description}
  222. \ttindex{TORDER}
  223. \item [{\it TORDER}]($vl$,$m$,$[p_1,p_2,\ldots]$);
  224. where $vl$ is a variable list (or the empty list if
  225. no variables are declared explicitly),
  226. $m$ is the name of a term ordering mode LEX, GRADLEX,
  227. REV\-GRAD\-LEX (or another implemented mode) and
  228. $[p_1,p_2,\ldots]$ are additional parameters for the
  229. term ordering mode (not needed for the basic modes).
  230. TORDER sets variable set and the term ordering mode.
  231. The default mode is LEX. The previous description is returned
  232. as a list with corresponding elements. Such a list can
  233. alternatively passed as sole argument to TORDER.
  234. If the variable list is empty or if the TORDER declaration
  235. is omitted, the automatic variable extraction is activated.
  236. \ttindex{GVARS}
  237. \item[{\it GVARS}] ({\it\{exp$1$, exp$2$, $ \ldots$, exp$n$\}});
  238. where $\{exp1, exp2, \ldots , expn\}$ is a list of expressions or
  239. equations.
  240. GVARS extracts from the expressions $\{exp1, exp2, \ldots , expn\}$
  241. the kernels, which can play the role of variables for a Gr\"obner
  242. calculation. This can be used e.g. in a TORDER declaration.
  243. \end{description}
  244. \subsection{GROEBNER: Calculation of a Gr\"obner Basis}
  245. \begin{description}
  246. \ttindex{GROEBNER}
  247. \item[{\it GROEBNER}] $\{exp1, exp2, \ldots , expm\}; $
  248. where $\{exp1, exp2, \ldots , expm\}$ is a list of
  249. expressions or equations.
  250. GROEBNER calculates the Gr\"obner basis of the given set of
  251. expressions with respect to the current TORDER setting.
  252. The Gr\"obner basis $\{1\}$ means that the ideal generated by the
  253. input polynomials is the whole polynomial ring, or equivalently, that
  254. the input polynomials have no zeros in common.
  255. As a side effect, the sequence of variables is stored as a REDUCE list
  256. in the shared variable
  257. \ttindex{gvarslast}
  258. \begin{center}
  259. gvarslast .
  260. \end{center}
  261. This is important if the variables are reordered because of optimization:
  262. you must set them afterwards explicitly as the current variable sequence
  263. if you want to use the Gr\"obner basis in the sequel, e.g. for a
  264. PREDUCE call. A basis has the property ``Gr\"obner'' only with respect
  265. to the variable sequences which had been active during its computation.
  266. \end{description}
  267. \example \index{GROEBNER package ! example}
  268. \begin{verbatim}
  269. torder({},lex)$
  270. groebner{3*x**2*y + 2*x*y + y + 9*x**2 + 5*x - 3,
  271. 2*x**3*y - x*y - y + 6*x**3 - 2*x**2 - 3*x + 3,
  272. x**3*y + x**2*y + 3*x**3 + 2*x**2 };
  273. 2
  274. {8*X - 2*Y + 5*Y + 3,
  275. 3 2
  276. 2*Y - 3*Y - 16*Y + 21}
  277. \end{verbatim}
  278. This example used the default system variable ordering, which was
  279. $\{x,y\}$. With the other variable ordering, a different basis results:
  280. \begin{verbatim}
  281. torder({y,x},lex)$
  282. groebner{3*x**2*y + 2*x*y + y + 9*x**2 + 5*x - 3,
  283. 2*x**3*y - x*y - y + 6*x**3 - 2*x**2 - 3*x + 3,
  284. x**3*y + x**2*y + 3*x**3 + 2*x**2 };
  285. 2
  286. {2*Y + 2*X - 3*X - 6,
  287. 3 2
  288. 2*X - 5*X - 5*X}
  289. \end{verbatim}
  290. Another basis yet again results with a different term ordering:
  291. \begin{verbatim}
  292. torder({x,y},revgradlex)$
  293. groebner{3*x**2*y + 2*x*y + y + 9*x**2 + 5*x - 3,
  294. 2*x**3*y - x*y - y + 6*x**3 - 2*x**2 - 3*x + 3,
  295. x**3*y + x**2*y + 3*x**3 + 2*x**2 };
  296. 2
  297. {2*y - 5*y - 8*x - 3,
  298. y*x - y + x + 3,
  299. 2
  300. 2*x + 2*y - 3*x - 6}
  301. \end{verbatim}
  302. The operation of GROEBNER can be controlled by the following
  303. switches:
  304. \begin{description}
  305. \ttindex{GROEBOPT}
  306. \item[GROEBOPT] -- If set ON, the sequence of variables is optimized
  307. with respect to execution speed; the algorithm involved is described
  308. in~\cite{Boege:86}; note that the final list of variables is available in
  309. \ttindex{GVARSLAST}
  310. GVARSLAST.
  311. An explicitly declared dependency supersedes the
  312. variable optimization. For example
  313. \begin{center}
  314. {\it depend} $a$, $x$, $y$;
  315. \end{center}
  316. guarantees that $a$ will be placed in front of $x$ and $y$. So
  317. GROEBOPT can be used even in cases where elimination of variables is
  318. desired.
  319. By default GROEBOPT is off, conserving the original variable
  320. sequence.
  321. \ttindex{GROEBFULLREDUCTION}
  322. \item[GROEBFULLREDUCTION] -- If set off, the reduction steps during
  323. the \linebreak[4] GROEBNER operation are limited to the pure head
  324. term reduction; subsequent terms are reduced otherwise.
  325. By default GROEBFULLREDUCTION is on.
  326. \ttindex{GLTBASIS}
  327. \item[GLTBASIS] -- If set on, the leading terms of the result basis are
  328. extracted. They are collected in a basis of monomials, which is
  329. available as value of the global variable with the name GLTB.
  330. \item[GLTERMS] -- If $\{exp_1, \ldots , exp_m\} $ contain parameters
  331. (symbols which are not member of the variable list), the share variable
  332. {\tt GLTERMS} contains a list of expression which during the
  333. calculation were assumed to be nonzero. A Gr\"obner basis
  334. is valid only under the assumption that all these expressions do
  335. not vanish.
  336. \end{description}
  337. The following switches control the print output of GROEBNER; by
  338. default all these switches are set OFF and nothing is printed.
  339. \begin{description}
  340. \ttindex{GROEBSTAT}
  341. \item[GROEBSTAT] -- A summary of the computation is printed
  342. including the computing time, the number of intermediate
  343. $H$--polynomials and the counters for the hits of the criteria.
  344. \ttindex{TRGROEB}
  345. \item[TRGROEB] -- Includes GROEBSTAT and the printing of the
  346. intermediate $H$-polynomials.
  347. \ttindex{TRGROEBS}
  348. \item[TRGROEBS] -- Includes TRGROEB and the printing of
  349. intermediate $S$--poly\-nomials.
  350. \ttindex{TRGROEB1}
  351. \item[TRGROEB1] -- The internal pairlist is printed when modified.
  352. \end{description}
  353. \subsection{GZERODIM?: Test of $\dim = 0$}
  354. \begin{description}
  355. \ttindex{GZERODIM?}
  356. \item[{\it GZERODIM}!?] $bas$ \\
  357. where {\it bas} is a Gr\"obner basis in the current setting.
  358. The result is {\it NIL}, if {\it bas} is the
  359. basis of an ideal of polynomials with more than finitely many common zeros.
  360. If the ideal is zero dimensional, i. e. the polynomials of the ideal have only
  361. finitely many zeros in common, the result is an integer $k$ which is the number
  362. of these common zeros (counted with multiplicities).
  363. \end{description}
  364. \subsection{GDIMENSION, GINDEPENDENT\_SETS: compute dimension and
  365. independent variables}
  366. The following operators can be used to compute the dimension
  367. and the independent variable sets of an ideal which has the
  368. Gr\"obner basis {\it bas} with arbitrary term order:
  369. \begin{description}
  370. \ttindex{GDIMENSION}\ttindex{GINDEPENDENT\_SETS}
  371. \ttindex{ideal dimension}\ttindex{independent sets}
  372. \item[Gdimension]$bas$
  373. \item[Gindependent\_sets]$bas$
  374. {\it Gindependent\_sets} computes the maximal
  375. left independent variable sets of the ideal, that are
  376. the variable sets which play the role of free parameters in the
  377. current ideal basis. Each set is a list which is a subset of the
  378. variable list. The result is a list of these sets. For an
  379. ideal with dimension zero the list is empty.
  380. {\it GDimension} computes the dimension of the ideal,
  381. which is the maximum length of the independent sets.
  382. \end{description}
  383. The ``Kredel-Weispfenning" algorithm is used (see \cite{Kredel:88a},
  384. extended to general ordering in \cite{BeWei:93}.
  385. \subsection{GLEXCONVERT: Conversion of an Arbitrary Gr\"obner Basis
  386. into a Lexical One}
  387. \begin{description}
  388. \ttindex{GLEXCONVERT}
  389. \item[{\it GLEXCONVERT}] $ \left(\{exp,\ldots , expm\} \left[,\{var1
  390. \ldots , varn\}\right]\left[,MAXDEG=mx\right]\right.$ \\
  391. $\left.\left[,NEWVARS=\{nv1, \ldots , nvk\}\right]\right) $ \\
  392. where $\{exp1, \ldots , expm\}$ is a Gr\"obner basis with
  393. $\{var1, \ldots , varn\}$ as variables in the current term order mode,
  394. $mx$ is an integer, and
  395. $\{nv1, \ldots , nvk\}$ is a subset of the basis variables.
  396. For this operator the source and target variable sets must be specified
  397. explicitly.
  398. \end{description}
  399. GLEXCONVERT converts a basis of a zero-dimensional ideal (finite number
  400. of isolated solutions) from arbitrary ordering into a basis under {\it
  401. lex} ordering. During the call of GLEXCONVERT the original ordering of
  402. the input basis must be still active!
  403. NEWVARS defines the new variable sequence. If omitted, the
  404. original variable sequence is used. If only a subset of variables is
  405. specified here, the partial ideal basis is evaluated. For the
  406. calculation of a univariate polynomial, NEW\-VARS should be a list
  407. with one element.
  408. MAXDEG is an upper limit for the degrees. The algorithm stops with
  409. an error message, if this limit is reached.
  410. A warning occurs if the ideal is not zero dimensional.
  411. GLEXCONVERT is an implementation of the FLGM algorithm by
  412. \linebreak[4] {\sc Faug{\`e}re}, {\sc Gianni}, {\sc Lazard} and {\sc
  413. Mora} \cite{Faugere:89}. Often, the calculation of a Gr\"obner basis
  414. with a graded ordering and subsequent conversion to {\it lex} is
  415. faster than a direct {\it lex} calculation. Additionally, GLEXCONVERT
  416. can be used to transform a {\it lex} basis into one with different
  417. variable sequence, and it supports the calculation of a univariate
  418. polynomial. If the latter exists, the algorithm is even applicable in
  419. the non zero-dimensional case, if such a polynomial exists.
  420. \begin{verbatim}
  421. torder({{w,p,z,t,s,b},gradlex)
  422. g := groebner { f1 := 45*p + 35*s -165*b -36,
  423. 35*p + 40*z + 25*t - 27*s, 15*w + 25*p*s +30*z -18*t
  424. -165*b**2, -9*w + 15*p*t + 20*z*s,
  425. w*p + 2*z*t - 11*b**3, 99*w - 11*s*b +3*b**2,
  426. b**2 + 33/50*b + 2673/10000};
  427. G := {60000*W + 9500*B + 3969,
  428. 1800*P - 3100*B - 1377,
  429. 18000*Z + 24500*B + 10287,
  430. 750*T - 1850*B + 81,
  431. 200*S - 500*B - 9,
  432. 2
  433. 10000*B + 6600*B + 2673}
  434. glexconvert(g,{w,p,z,t,s,b},maxdeg=5,newvars={w});
  435. 2
  436. 100000000*W + 2780000*W + 416421
  437. glexconvert(g,{w,p,z,t,s,b},maxdeg=5,newvars={p});
  438. 2
  439. 6000*P - 2360*P + 3051
  440. \end{verbatim}
  441. \subsection{GROEBNERF: Factorizing Gr\"obner Bases}
  442. % Subsection 3.4.1
  443. \subsubsection{Background}
  444. If Gr\"obner bases are computed in order to solve systems of
  445. equations or to find the common roots of systems of polynomials,
  446. the factorizing version of the Buchberger algorithm can be used.
  447. The theoretical background is simple: if a polynomial $p$ can be
  448. represented as a product of two (or more) polynomials, e.g. $h= f*g$,
  449. then $h$ vanishes if and only if one of the factors vanishes. So if
  450. during the calculation of a Gr\"obner basis $h$ of the above form is
  451. detected, the whole problem can be split into two (or more)
  452. disjoint branches. Each of the branches is simpler than the complete
  453. problem; this saves computing time and space. The result of this
  454. type of computation is a list of (partial) Gr\"obner bases; the
  455. solution set of the original problem is the union of the solutions of
  456. the partial problems, ignoring the multiplicity of an individual
  457. solution. If a branch results in a basis $\{1\}$, then there is no
  458. common zero, i.e. no additional solution for the original problem,
  459. contributed by this branch.
  460. % Subsection 3.4.2
  461. \subsubsection{GROEBNERF Call}
  462. \ttindex{GROEBNERF}
  463. The syntax of GROEBNERF is the same as for GROEBNER.
  464. \[
  465. \mbox{\it GROEBNERF}(\{exp1, exp2, \ldots , expm\}
  466. [,\{\},\{nz1, \ldots nzk\});
  467. \]
  468. where $\{exp1, exp2, \ldots , expm\} $ is a given list of expressions or
  469. equations, and $\{nz1, \ldots nzk\}$ is
  470. an optional list of polynomials known to be non-zero.
  471. GROEBNERF tries to separate polynomials into individual factors and
  472. to branch the computation in a recursive manner (factorization tree).
  473. The result is a list of partial Gr\"obner bases. If no factorization can
  474. be found or if all branches but one lead to the trivial basis $\{1\}$,
  475. the result has only one basis; nevertheless it is a list of lists of
  476. polynomials. If no solution is found, the result will be $\{\{1\}\}$.
  477. Multiplicities (one factor with a higher power, the same partial basis
  478. twice) are deleted as early as possible in order to speed up the
  479. calculation. The factorizing is controlled by some switches.
  480. As a side effect, the sequence of variables is stored as a REDUCE list in
  481. the shared variable
  482. \begin{center}
  483. gvarslast .
  484. \end{center}
  485. If GLTBASIS is on, a corresponding list of leading term bases is
  486. also produced and is available in the variable GLTB.
  487. The third parameter of GROEBNERF allows one to declare some polynomials
  488. nonzero. If any of these is found in a branch of the calculation
  489. the branch is cancelled. This can be used to save a substantial amount
  490. of computing time. The second parameter must be included as an
  491. empty list if the third parameter is to be used.
  492. \begin{verbatim}
  493. torder({x,y},lex)$
  494. groebnerf { 3*x**2*y + 2*x*y + y + 9*x**2 + 5*x = 3,
  495. 2*x**3*y - x*y - y + 6*x**3 - 2*x**2 - 3*x = -3,
  496. x**3*y + x**2*y + 3*x**3 + 2*x**2 \};
  497. {{Y - 3,X},
  498. 2
  499. {2*Y + 2*X - 1,2*X - 5*X - 5}}
  500. \end{verbatim}
  501. %}
  502. It is obvious here that the solutions of the equations can be read
  503. off immediately.
  504. All switches from GROEBNER are valid for GROEBNERF as well:
  505. \ttindex{GROEBOPT} \ttindex{GLTBASIS}
  506. \ttindex{GROEBFULLREDUCTION} \ttindex{GROEBSTAT} \ttindex{TRGROEB}
  507. \ttindex{TRGROEBS} \ttindex{TRGROEB1}
  508. \begin{center}
  509. \begin{tabular}{l}
  510. GROEBOPT \\
  511. GLTBASIS \\
  512. GROEBFULLREDUCTION \\
  513. GROEBSTAT \\
  514. TRGROEB \\
  515. TRGROEBS \\
  516. TRGROEB1
  517. \end{tabular}
  518. \end{center}
  519. \subsubsection*{Additional switches for GROEBNERF:}
  520. \begin{description}
  521. \ttindex{GROEBRES}
  522. \item[GROEBRES] -- If ON, a resultant is calculated under certain
  523. circumstances (one bivariate $H$--polynomial is followed by another
  524. one). This sometimes shortens the calculation.
  525. By default GROEBRES is off.
  526. \ttindex{TRGROEBR}
  527. \item[TRGROEBR] -- All intermediate partial basis are printed when
  528. detected.
  529. By default TRGROEBR is off.
  530. \end{description}
  531. {\bf GROEBMONFAC GROEBRESMAX GROEBRESTRICTION} \\
  532. \hspace*{.5cm} These variables are described in the following
  533. paragraphs.
  534. \subsubsection{Suppression of Monomial Factors}
  535. The factorization in GROEBNERF is controlled by the following
  536. \ttindex{GROEBMONFAC}
  537. switches and variables. The variable GROEBMONFAC is connected to
  538. the handling of ``monomial factors''. A monomial factor is a product
  539. of variable powers occurring as a factor, e.g. $ x**2*y$ in $x**3*y -
  540. 2*x**2*y**2$. A monomial factor represents a solution of the type
  541. ``$ x = 0$ or $y = 0$'' with a certain multiplicity. With
  542. GROEB\-NERF \ttindex{GROEBNERF}
  543. the multiplicity of monomial factors is lowered to the value of the
  544. shared variable
  545. \ttindex{GROEBMONFAC}
  546. \begin{center}
  547. GROEBMONFAC
  548. \end{center}
  549. which by default is 1 (= monomial factors remain present, but their
  550. multiplicity is brought down). With
  551. \begin{center}
  552. GROEBMONFAC := 0
  553. \end{center}
  554. the monomial factors are suppressed completely.
  555. \subsubsection{Limitation on the Number of Results}
  556. The shared variable
  557. \ttindex{GROEBRESMAX}
  558. \begin{center}
  559. GROEBRESMAX
  560. \end{center}
  561. controls the number of partial results. Its default value is 300. If
  562. groebresmax partial results are calculated, the calculation is
  563. terminated.
  564. \subsubsection{Restriction of the Solution Space}
  565. In some applications only a subset of the complete solution set
  566. of a given set of equations is relevant, e.g. only
  567. nonnegative values or positive definite values for the variables.
  568. A significant amount of computing time can be saved if
  569. nonrelevant computation branches can be terminated early.
  570. Positivity: If a polynomial has no (strictly) positive zero, then
  571. every system containing it has no nonnegative or strictly positive
  572. solution. Therefore, the Buchberger algorithm tests the coefficients of
  573. the polynomials for equal sign if requested. For example, in $13*x +
  574. 15*y*z $ can be zero with real nonnegative values for $x, y$ and $z$
  575. only if $x=0$ and $y=0$ or $ z=0$; this is a sort of ``factorization by
  576. restriction''. A polynomial $13*x + 15*y*z + 20$ never can vanish
  577. with nonnegative real variable values.
  578. Zero point: If any polynomial in an ideal has an absolute term, the ideal
  579. cannot have the origin point as a common solution.
  580. By setting the shared variable
  581. \ttindex{GROEBRESTRICTION}
  582. \begin{center} GROEBRESTRICTION \end{center}
  583. GROEBNERF is informed of the type of restriction the user wants to
  584. impose on the solutions:
  585. \begin{center}
  586. \begin{tabular}{l}
  587. {\it GROEBRESTRICTION:=NONEGATIVE;} \\
  588. \hspace*{+.5cm} only nonnegative real solutions are of
  589. interest\vspace*{4mm} \\
  590. {\it GROEBRESTRICTION:=POSITIVE;} \\
  591. \hspace*{+.5cm}only nonnegative and nonzero solutions are of
  592. interest\vspace*{4mm} \\
  593. {\it GROEBRESTRICTION:=ZEROPOINT;} \\
  594. \hspace*{+.5cm}only solution sets which contain the point
  595. $\{0,0,\ldots,0\}$ are or interest.
  596. \end{tabular}
  597. \end{center}
  598. If GROEBNERF detects a polynomial which formally conflicts with the
  599. restriction, it either splits the calculation into separate branches, or,
  600. if a violation of the restriction is determined, it cancels the actual
  601. calculation branch.
  602. \subsection{GREDUCE, PREDUCE: Reduction of Polynomials}
  603. \subsubsection{Background} \label{GROEBNER:background}
  604. Reduction of a polynomial ``p'' modulo a given sets of polynomials
  605. ``B'' is done by the reduction algorithm incorporated in the
  606. Buchberger algorithm. Informally it can be described for
  607. polynomials over a field as follows:
  608. \begin{center}
  609. \begin{tabular}{l}
  610. loop1: \hspace*{2mm}\% head term elimination \\
  611. \hspace*{-1cm} if there is one polynomial $b$ in $B$ such that the
  612. leading \\ term of $p$ is a multiple of the leading term of $p$ do \\
  613. $p := p - lt(p)/lt(b) * b$ (the leading term vanishes)\\
  614. \hspace*{-1cm} do this loop as long as possible; \\
  615. loop2: \hspace*{2mm} \% elimination of subsequent terms \\
  616. \hspace*{-1cm} for each term $s$ in $p$ do \\
  617. if there is one polynomial $b$ in $B$ such that $s$ is a\\
  618. multiple of the leading term of $p$ do \\
  619. $p := p - s/lt(b) * b$ (the term $s$ vanishes) \\
  620. \hspace*{-1cm}do this loop as long as possible;
  621. \end{tabular}
  622. \end{center}
  623. If the coefficients are taken from a ring without zero divisors we
  624. cannot divide by each possible number like in the field case. But
  625. using that in the field case, $c*p $ is reduced to $c*q $, if $ p $
  626. is reduced to $ q $, for arbitrary numbers $ c $, the reduction for
  627. the ring case uses the least $ c $ which makes the (field) reduction
  628. for $ c*p $ integer. The result of this reduction is returned as
  629. (ring) reduction of $ p $ eventually after removing the content, i.e.
  630. the greatest common divisor of the coefficients. The result of this
  631. type of reduction is also called a pseudo reduction of $ p $.
  632. % Subsection 3.5.2
  633. \subsubsection{Reduction via Gr\"obner Basis Calculation}
  634. \ttindex{GREDUCE}
  635. \[
  636. \mbox{\it GREDUCE}(exp, \{exp1, exp2, \ldots , expm\}]);
  637. \]
  638. where {\it exp} is an expression, and $\{exp1, exp2,\ldots , expm\}$ is
  639. a list of any number of expressions or equations.
  640. GREDUCE first converts the list of expressions $\{exp1, \ldots ,
  641. expn\}$ to a Gr\"obner basis, and then reduces the given expression
  642. modulo that basis. An error results if the list of expressions is
  643. inconsistent. The returned value is an expression representing the
  644. reduced polynomial. As a side effect, GREDUCE sets the variable {\it
  645. gvarslast} in the same manner as GROEBNER does.
  646. \subsubsection{Reduction with Respect to Arbitrary Polynomials}
  647. \ttindex{PREDUCE}
  648. \[
  649. PREDUCE(exp, \{exp1, exp2,\ldots , expm\});
  650. \]
  651. where $ exp $ is an expression, and $\{exp1, exp2, \ldots ,
  652. expm \}$ is a list of any number of expressions or equations.
  653. PREDUCE reduces the given expression modulo the set $\{exp1,
  654. \ldots , expm\}$. If this set is a Gr\"obner basis, the obtained reduced
  655. expression is uniquely determined. If not, then it depends on the
  656. subsequence of the single reduction steps
  657. (see~\ref{GROEBNER:background}). PREDUCE does not check whether
  658. $\{exp1, exp2, \ldots , expm\}$ is a Gr\"obner basis in the actual
  659. order. Therefore, if the expressions are a Gr\"obner basis calculated
  660. earlier with a variable sequence given explicitly or modified by
  661. optimization, the proper variable sequence and term order must
  662. be activated first.
  663. \example (PREDUCE called with a Gr\"obner basis):
  664. \begin{verbatim}
  665. torder({x,y},lex);
  666. gb:=groebner{3*x**2*y + 2*x*y + y + 9*x**2 + 5*x - 3,
  667. 2*x**3*y - x*y - y + 6*x**3 - 2*x**2 - 3*x + 3,
  668. x**3*y + x**2*y + 3*x**3 + 2*x**2}$
  669. preduce (5*y**2 + 2*x**2*y + 5/2*x*y + 3/2*y
  670. + 8*x**2 + 3/2*x - 9/2, gb);
  671. 2
  672. Y
  673. \end{verbatim}
  674. \subsubsection{Reduction Tree}
  675. In some case not only are the results produced by GREDUCE and
  676. PREDUCE of interest, but the reduction process is of some value
  677. too. If the switch
  678. \ttindex{GROEBPROT}
  679. \begin{center}
  680. GROEBPROT
  681. \end{center}
  682. is set on, GROEBNER, GREDUCE and PREDUCE produce as a side effect a trace of
  683. their work as a REDUCE list of equations in the shared variable
  684. \ttindex{GROEBPROTFILE}
  685. \begin{center}
  686. GROEBPROTFILE.
  687. \end{center}
  688. Its value is a list of equations with a variable ``candidate'' playing
  689. the role of the object to be reduced. The polynomials are cited as
  690. ``$poly1$'', ``$poly2$'', $\ldots\;$. If read as assignments, these equations
  691. form a program which leads from the reduction input to its result.
  692. Note that, due to the pseudo reduction with a ring as the coefficient
  693. domain, the input coefficients may be changed by global factors.
  694. \example \index{GROEBNER package ! example}
  695. {\it on groebprot} \$ \\
  696. {\it preduce} $ (5*y**2 + 2*x**2*y + 5/2*x*y + 3/2*y + 8*x**2 $ \\
  697. \hspace*{+1cm} $+ 3/2*x - 9/2, gb);$
  698. \begin{verbatim}
  699. 2
  700. Y
  701. \end{verbatim}
  702. {\it groebprotfile;}
  703. \begin{verbatim}
  704. 2 2 2
  705. {CANDIDATE=4*X *Y + 16*X + 5*X*Y + 3*X + 10*Y + 3*Y - 9,
  706. 2
  707. POLY1=8*X - 2*Y + 5*Y + 3,
  708. 3 2
  709. POLY2=2*Y - 3*Y - 16*Y + 21,
  710. CANDIDATE=2*CANDIDATE,
  711. CANDIDATE= - X*Y*POLY1 + CANDIDATE,
  712. CANDIDATE= - 4*X*POLY1 + CANDIDATE,
  713. CANDIDATE=4*CANDIDATE,
  714. 3
  715. CANDIDATE= - Y *POLY1 + CANDIDATE,
  716. CANDIDATE=2*CANDIDATE,
  717. 2
  718. CANDIDATE= - 3*Y *POLY1 + CANDIDATE,
  719. CANDIDATE=13*Y*POLY1 + CANDIDATE,
  720. CANDIDATE=CANDIDATE + 6*POLY1,
  721. 2
  722. CANDIDATE= - 2*Y *POLY2 + CANDIDATE,
  723. CANDIDATE= - Y*POLY2 + CANDIDATE,
  724. CANDIDATE=CANDIDATE + 6*POLY2}
  725. \end{verbatim}
  726. This means
  727. \begin{eqnarray*}
  728. \lefteqn{
  729. 16 (5 y^2 + 2 x^2 y + \frac{5}{2} x y + \frac{3}{2} y
  730. + 8 x^2+ \frac{3}{2} x - \frac{9}{2})=} \\ & &
  731. (-8 x y -32 x -2 y^3 -3 y^2 + 13 y + 6) \mbox{POLY1} \\
  732. & & \; + (-2 y^2 -2 y + 6) \mbox{POLY2 } \; + y^2.
  733. \end{eqnarray*}
  734. \subsection{Tracing with GROEBNERT and PREDUCET}
  735. Given a set of polynomials $\{f_1,\ldots ,f_k\}$ and their Gr\"obner
  736. basis $\{g_1,\ldots ,g_l\}$, it is well known that there are matrices of
  737. polynomials $C_{ij}$ and $D_{ji}$ such that
  738. \[
  739. f_i = \displaystyle{\sum\limits_j} C_{ij} g_j \;\mbox{ and } g_j =
  740. \displaystyle{\sum\limits_i} D_{ji} f_i
  741. \]
  742. and these relations are needed explicitly sometimes.
  743. In {\sc Buchberger} \cite{Buchberger:85}, such cases are described in the
  744. context of linear polynomial equations. The standard technique for
  745. computing the above formulae is to perform
  746. Gr\"obner reductions, keeping track of the
  747. computation in terms of the input data. In the current package such
  748. calculations are performed with (an internally hidden) cofactor
  749. technique: the user has to assign unique names to the input
  750. expressions and the arithmetic combinations are done with the
  751. expressions and with their names simultaneously. So the result is
  752. accompanied by an expression which relates it algebraically to the
  753. input values.
  754. \ttindex{GROEBNERT} \ttindex{PREDUCET}
  755. There are two complementary operators with this feature: GROEBNERT
  756. and PREDUCET; functionally they correspond to GROEBNER and PREDUCE.
  757. However, the sets of expressions here {\it {\bf must be}} equations
  758. with unique single identifiers on their left side and the {\it lhs} are
  759. interpreted as names of the expressions. Their results are
  760. sets of equations (GROEBNERT) or equations (PREDUCET), where
  761. a {\it lhs} is the computed value, while the {\it rhs} is its equivalent
  762. in terms of the input names.
  763. \example \index{GROEBNER package ! example}
  764. We calculate the Gr\"obner basis for an ellipse (named ``$p1$'' ) and a
  765. line (named ``$p2$'' ); $p2$ is member of the basis immediately and so
  766. the corresponding first result element is of a very simple form; the
  767. second member is a combination of $p1$ and $p2$ as shown on the
  768. {\it rhs} of this equation:
  769. \begin{verbatim}
  770. gb1:=groebnert {p1=2*x**2+4*y**2-100,p2=2*x-y+1};
  771. GB1 := {2*X - Y + 1=P2,
  772. 2
  773. 9*Y - 2*Y - 199= - 2*X*P2 - Y*P2 + 2*P1 + P2}
  774. \end{verbatim}
  775. \example \index{GROEBNER package ! example}
  776. We want to reduce the polynomial \verb+ x**2+ {\it wrt}
  777. the above Gr\"obner basis and need knowledge about the reduction
  778. formula. We therefore extract the basis polynomials from $GB1$,
  779. assign unique names to them (here $G1$, $G2$) and call PREDUCET.
  780. The polynomial to be reduced here is introduced with the name $Q$,
  781. which then appears on the {\it rhs} of the result. If the name for the
  782. polynomial is omitted, its formal value is used on the right side too.
  783. \begin{verbatim}
  784. gb2 := for k := 1:length gb1 collect
  785. mkid(g,k) = lhs part(gb1,k)$
  786. preducet (q=x**2,gb2);
  787. - 16*Y + 208= - 18*X*G1 - 9*Y*G1 + 36*Q + 9*G1 - G2
  788. \end{verbatim}
  789. This output means
  790. \[
  791. x^2 = (\frac{1}{2} x + \frac{1}{4} y - \frac{1}{4}) G1
  792. + \frac{1}{36} G2 + (-\frac{4}{9} y + \frac{52}{9}).
  793. \]
  794. \example \index{GROEBNER package ! example}
  795. If we reduce a polynomial which is member of the ideal, we
  796. consequently get a result with {\it lhs} zero:
  797. \begin{verbatim}
  798. preducet(q=2*x**2+4*y**2-100,gb2);
  799. 0= - 2*X*G1 - Y*G1 + 2*Q + G1 - G2
  800. \end{verbatim}
  801. This means
  802. \[ Q = ( x + \frac{1}{2} y - \frac{1}{2}) G1 + \frac{1}{2} G2.
  803. \]
  804. With these operators the matrices $C_{ij}$ and $D_{ji}$ are available
  805. implicitly, $D_{ji}$ as side effect of GROEBNERT, $C_{ij}$ by {\it calls}
  806. of PREDUCET of $f_i$ {\it wrt} $\{g_j\}$. The latter by definition will
  807. have the {\it lhs} zero and a {\it rhs} with linear $f_i$.
  808. If $\{1\}$ is the Gr\"obner basis, the GROEBNERT calculation gives
  809. a ``proof'', showing, how $1$ can be computed as combination of the
  810. input polynomials.
  811. \paragraph{Remark:} Compared to the non-tracing algorithms, these
  812. operators are much more time consuming. So they are applicable
  813. only on small sized problems.
  814. % *** SO BESSER ??
  815. \subsection{Gr\"obner Bases for Modules}
  816. Given a polynomial ring, e.g. $R=Z[x_1 \cdots x_k]$ and
  817. an integer $n>1$: the vectors with $n$ elements of $R$
  818. form a $module$ under vector addition (= componentwise addition)
  819. and multiplication with elements of $R$. For a submodule
  820. given by a finite basis a Gr\"obner basis
  821. can be computed, and the facilities of the GROEBNER package
  822. can be used except the operators $GROEBNERF$ and $GROESOLVE$.
  823. The vectors are encoded using auxiliary variables which represent
  824. the unit vectors in the module. E.g. using ${v_1,v_2,v_3}$ the
  825. module element $[x_1^2,0,x_1-x_2]$ is represented as
  826. $x_1^2 v_1 + x_1 v_3 - x_2 v_3$. The use of ${v_1,v_2,v_3}$
  827. as unit vectors is set up by assigning the set of auxiliary variables
  828. to the share variable $GMODULE$, e.g.
  829. \begin{verbatim}
  830. GMODULE := {V1,V2,V3};
  831. \end{verbatim}
  832. After this declaration all monomials built from these variables
  833. are considered as an algebraically independent basis of a vector
  834. space. However, you had best use them only linearly. Once $GMODULE$
  835. has been set, the auxiliary variables automatically will be
  836. added to the end of each variable list (if they are not yet
  837. member there).
  838. Example:
  839. \begin{verbatim}
  840. torder({x,y,v1,v2,v3},lex)$
  841. gmodule := {v1,v2,v3}$
  842. g:=groebner{x^2*v1 + y*v2,x*y*v1 - v3,2y*v1 + y*v3};
  843. 2
  844. G := {X *V1 + Y*V2,
  845. 2
  846. X*V3 + Y *V2,
  847. 3
  848. Y *V2 - 2*V3,
  849. 2*Y*V1 + Y*V3}
  850. preduce((x+y)^3*v1,g);
  851. 1 3 2
  852. - X*Y*V2 - ---*Y *V3 - 3*Y *V2 + 3*Y*V3
  853. 2
  854. \end{verbatim}
  855. In many cases a total degree oriented term order will be adequate
  856. for computations in modules, e.g. for all cases where the
  857. submodule membership is investigated. However, arranging
  858. the auxiliary variables in an elimination oriented term order
  859. can give interesting results. E.g.
  860. \begin{verbatim}
  861. p1:=(x-1)*(x^2-x+3)$ p2:=(x-1)*(x^2+x-5)$
  862. gmodule := {v1,v2,v3};
  863. torder({v1,x,v2,v3},lex)$
  864. gb:=groebner {p1*v1+v2,p2*v1+v3};
  865. GB := {30*V1*X - 30*V1 + X*V2 - X*V3 + 5*V2 - 3*V3,
  866. 2 2
  867. X *V2 - X *V3 + X*V2 + X*V3 - 5*V2 - 3*V3}
  868. g:=coeffn(first gb,v1,1);
  869. G := 30*(X - 1)
  870. c1:=coeffn(first gb,v2,1);
  871. C1 := X + 5
  872. c2:=coeffn(first gb,v3,1);
  873. C2 := - X - 3
  874. c1*p1 + c2*p2;
  875. 30*(X - 1)
  876. \end{verbatim}
  877. Here two polynomials
  878. are entered as vectors $[p_1,1,0]$ and $[p_2,0,1]$. Using a term
  879. ordering such that the first dimension ranges highest and the
  880. other components lowest, a classical cofactor computation is
  881. executed just as in the extended Euclidean algorithm.
  882. Consequently the leading polynomial in the resulting
  883. basis shows the greatest common divisor of $p_1$ and $p_2$,
  884. found as a coefficient of $v_1$ while the coefficients
  885. of $v_2$ and $v_3$ are the cofactors $c_1$ and $c_2$ of the polynomials
  886. $p_1$ and $p_2$ with the relation $gcd(p_1,p_2) = c_1p_1 + c_2p_2$.
  887. \subsection{Additional Orderings}
  888. Besides the basic orderings, there are ordering options that are used for
  889. special purposes.
  890. \subsubsection{Separating the Variables into Groups }
  891. \index{grouped ordering}
  892. It is often desirable to separate variables
  893. and formal parameters in a system of polynomials.
  894. This can be done with a {\it lex} Gr\"obner
  895. basis. That however may be hard to compute as it does more
  896. separation than necessary. The following orderings group the
  897. variables into two (or more) sets, where inside each set a classical
  898. ordering acts, while the sets are handled via their total degrees,
  899. which are compared in elimination style. So the Gr\"obner basis will
  900. eliminate the members of the first set, if algebraically possible.
  901. {\it Torder} here gets an additional parameter which describe the
  902. grouping \ttindex{TORDER}
  903. \begin{center}{\it
  904. \begin{tabular}{l}
  905. TORDER ($vl$,gradlexgradlex, $n$) \\
  906. TORDER ($vl$,gradlexrevgradlex,$n$) \\
  907. TORDER ($vl$,lexgradlex, $n$) \\
  908. TORDER ($vl$,lexrevgradlex, $n$)
  909. \end{tabular}}
  910. \end{center}
  911. Here the integer $n$ is the number of variables in the first group
  912. and the names combine the local ordering for the first and second
  913. group, e.g.
  914. \begin{center}
  915. \begin{tabular}{llll}
  916. \multicolumn{4}{l}{{\it lexgradlex}, 3 for $\{x_1,x_2,x_3,x_4,x_5\}$:} \\
  917. \multicolumn{4}{l}{$x_1^{i_1}\ldots x_5^{i_5} \gg x_1^{j_1}\ldots
  918. x_5^{j_5}$} \\
  919. if & & & $(i_1,i_2,i_3) \gg_{lex}(j_1,j_2,j_3)$ \\
  920. & or & & $(i_1,i_2,i_3) = (j_1,j_2,j_3)$ \\
  921. & & and & $(i_4,i_5) \gg_{gradlex}(j_4,j_5)$
  922. \end{tabular}
  923. \end{center}
  924. Note that in the second place there is no {\it lex} ordering available;
  925. that would not make sense.
  926. \subsubsection{Weighted Ordering}
  927. \ttindex{TORDER} \index{weighted ordering}
  928. The statement
  929. \begin{center}
  930. \begin{tabular}{cl}
  931. {\it TORDER} &($vl$,weighted, $\{n_1,n_2,n_3 \ldots$\}) ; \\
  932. \end{tabular}
  933. \end{center}
  934. establishes a graduated ordering, where the exponents are first
  935. multiplied by the given weights. If there are less weight values than
  936. variables, the weight 1 is added automatically. If the weighted
  937. degree calculation is not decidable, a $lex$ comparison follows.
  938. \subsubsection{Graded Ordering}
  939. \ttindex{TORDER} \index{graded ordering}
  940. The statement
  941. \begin{center}
  942. \begin{tabular}{cl}
  943. {\it TORDER} &($vl$,graded, $\{n_1,n_2,n_3 \ldots\}$,$order_2$) ; \\
  944. \end{tabular}
  945. \end{center}
  946. establishes a graduated ordering, where the exponents are first
  947. multiplied by the given weights. If there are less weight values than
  948. variables, the weight 1 is added automatically. If the weighted
  949. degree calculation is not decidable, the term order $order_2$ specified
  950. in the following argument(s) is used. The ordering $graded$ is designed
  951. primarily for use with the operator $dd\_groebner$.
  952. \subsubsection{Matrix Ordering}
  953. \ttindex{TORDER} \index{matrix ordering}
  954. The statement
  955. \begin{center}
  956. \begin{tabular}{cl}
  957. {\it TORDER} &($vl$,matrix, $M$) ; \\
  958. \end{tabular}
  959. \end{center}
  960. where $M$ is a matrix with integer elements and row length which
  961. corresponds to the variable number. The exponents of each monomial
  962. form a vector; two monomials are compared by multiplying their
  963. exponent vectors first with $M$ and comparing the resulting vector
  964. lexicographically. E.g. the unit matrix establishes the classical
  965. $LEX$ term order mode, a matrix with a first row of ones followed
  966. by the rows of a unit matrix corresponds to the $GRADLEX$ ordering.
  967. The matrix $M$ must have at least as many rows as columns; a non--square
  968. matrix contains redundant rows. The matrix must have full rank, and
  969. the top non--zero element of each column must be positive.
  970. The generality of the matrix based term order has its price: the
  971. computing time spent in the term sorting is significantly higher
  972. than with the specialized term orders. To overcome this problem,
  973. you can compile a matrix term order
  974. if your REDUCE is equipped with a LISP compiler; the
  975. compilation reduces the computing time overhead significantly.
  976. If you set the switch $COMP$ on, any new order matrix is compiled
  977. when any operator of the GROEBNER package accesses it for the
  978. first time. Alternatively you can compile a matrix explicitly
  979. \begin{verbatim}
  980. torder_compile(<n>,<m>);
  981. \end{verbatim}
  982. where $<n>$ is a name (an identifier) and $<m>$ is a term order matrix.
  983. $torder\_compile$ transforms the matrix into a LISP program, which
  984. is compiled by the LISP compiler when $COMP$ is on or when you
  985. generate a fast loadable module. Later you can activate the new term
  986. order by using the name $<n>$ in a $torder$ statement as term ordering
  987. mode.
  988. \subsection{Gr\"obner Bases for Graded Homogeneous Systems}
  989. For a homogeneous system of polynomials under a term order
  990. {\it graded}, {\it gradlex}, {\it revgradlex} or {\it weighted}
  991. a Gr\"obner Base can be computed with limiting the grade
  992. of the intermediate $S$--polynomials:
  993. \begin{description}
  994. \ttindex{dd\_groebner}
  995. \item [{\it dd\_groebner}]($d1$,$d2$,$\{p_1,p_2,\ldots\}$);
  996. \end{description}
  997. where $d1$ is a non--negative integer and $d2$ is an integer
  998. $>$ $d1$ or ``infinity". A pair of polynomials is considered
  999. only if the grade of the lcm of their head terms is between
  1000. $d1$ and $d2$. See \cite{BeWei:93} for the mathematical background.
  1001. For the term orders {\it graded} or {\it weighted} the (first) weight
  1002. vector is used for the grade computation. Otherwise the total
  1003. degree of a term is used.
  1004. \section{Ideal Decomposition \& Equation System Solving}
  1005. Based on the elementary Gr\"obner operations, the GROEBNER package offers
  1006. additional operators, which allow the decomposition of an ideal or of a
  1007. system of equations down to the individual solutions.
  1008. % Section 4.1
  1009. \subsection{Solutions Based on Lex Type Gr\"obner Bases}
  1010. % Subsection 4.1.1
  1011. \subsubsection{GROESOLVE: Solution of a Set of Polynomial Equations}
  1012. \ttindex{GROESOLVE} \ttindex{GROEBNERF}
  1013. The GROESOLVE operator incorporates a macro algorithm;
  1014. lexical Gr\"obner bases are computed by GROEBNERF and decomposed
  1015. into simpler ones by ideal decomposition techniques; if algebraically
  1016. possible, the problem is reduced to univariate polynomials which are
  1017. solved by SOLVE; if ROUNDED is on, numerical approximations are
  1018. computed for the roots of the univariate polynomials.
  1019. \[
  1020. GROESOLVE(\{exp1, exp2, \ldots , expm\}[,\{var1, var2, \ldots ,
  1021. varn\}]); \]
  1022. where $\{exp1, exp2,\ldots , expm\}$ is a list of any number of
  1023. expressions or equations, $\{var1, var2, \ldots , varn\}$ is an
  1024. optional list of variables.
  1025. The result is a set of subsets. The subsets contain the solutions of the
  1026. polynomial equations. If there are only finitely many solutions,
  1027. then each subset is a set of expressions of triangular type
  1028. $\{exp1, exp2,\ldots , expn\},$ where $exp1$ depends only on
  1029. $var1,$ $exp2$ depends only on $var1$ and $var2$ etc. until $expn$ which
  1030. depends on $var1,\ldots,varn.$ This allows a successive determination of
  1031. the solution components. If there are infinitely many solutions,
  1032. some subsets consist in less than $n$ expressions. By considering some
  1033. of the variables as ``free parameters'', these subsets are usually
  1034. again of triangular type.
  1035. \example (intersections of a line with a circle):
  1036. \index{GROEBNER package ! example}
  1037. \[
  1038. GROESOLVE(\{x**2 - y**2 - a, p*x+q*y+s\},\{x,y\});
  1039. \]
  1040. %{\small
  1041. \begin{verbatim}
  1042. 2 2 2 2 2
  1043. {{X=(SQRT( - A*P + A*Q + S )*Q - P*S)/(P - Q ),
  1044. 2 2 2 2 2
  1045. Y= - (SQRT( - A*P + A*Q + S )*P - Q*S)/(P - Q )},
  1046. 2 2 2 2 2
  1047. {X= - (SQRT( - A*P + A*Q + S )*Q + P*S)/(P - Q ),
  1048. 2 2 2 2 2
  1049. Y=(SQRT( - A*P + A*Q + S )*P + Q*S)/(P - Q )}}
  1050. \end{verbatim}
  1051. %}
  1052. % Subsection 4.1.2
  1053. \subsubsection{GROEPOSTPROC: Postprocessing of a Gr\"obner Basis}
  1054. \ttindex{GROEPOSTPROC}
  1055. In many cases, it is difficult to do the general Gr\"obner processing.
  1056. If a Gr\"obner basis with a {\it lex} ordering is calculated already (e.g.,
  1057. by very individual parameter settings), the solutions can be derived
  1058. from it by a call to GROEPOSTPROC. GROESOLVE is functionally
  1059. equivalent to a call to GROEBNERF and subsequent calls to
  1060. GROEPOSTPROC for each partial basis.
  1061. \[
  1062. GROEPOSTPROC(\{exp1, exp2, \ldots , expm\}[,\{var1, var2, \ldots ,
  1063. varn\}]);
  1064. \]
  1065. where $\{exp1, exp2, \ldots , expm\}$ is a list of any number of
  1066. expressions, \linebreak[4] $\{var1, var2, \ldots ,$ $ varn\}$ is an
  1067. optional list of variables. The expressions must be a {\it lex} Gr\"obner
  1068. basis with the given variables; the ordering must be still active.
  1069. The result is the same as with GROESOLVE.
  1070. \begin{verbatim}
  1071. groepostproc({x3**2 + x3 + x2 - 1,
  1072. x2*x3 + x1*x3 + x3 + x1*x2 + x1 + 2,
  1073. x2**2 + 2*x2 - 1,
  1074. x1**2 - 2},{x3,x2,x1});
  1075. {{X3= - SQRT(2),
  1076. X2=SQRT(2) - 1,
  1077. X1=SQRT(2)},
  1078. {X3=SQRT(2),
  1079. X2= - (SQRT(2) + 1),
  1080. X1= - SQRT(2)},
  1081. SQRT(4*SQRT(2) + 9) - 1
  1082. {X3=-------------------------,
  1083. 2
  1084. X2= - (SQRT(2) + 1),
  1085. X1=SQRT(2)},
  1086. - (SQRT(4*SQRT(2) + 9) + 1)
  1087. {X3=------------------------------,
  1088. 2
  1089. X2= - (SQRT(2) + 1),
  1090. X1=SQRT(2)},
  1091. SQRT( - 4*SQRT(2) + 9) - 1
  1092. {X3=----------------------------,
  1093. 2
  1094. X2=SQRT(2) - 1,
  1095. X1= - SQRT(2)},
  1096. - (SQRT( - 4*SQRT(2) + 9) + 1)
  1097. {X3=---------------------------------,
  1098. 2
  1099. X2=SQRT(2) - 1,
  1100. X1= - SQRT(2)}}
  1101. \end{verbatim}
  1102. % Subsection 4.1.3
  1103. \subsubsection{IDEALQUOTIENT: Quotient of an Ideal and an Expression}
  1104. \ttindex{IDEALQUOTIENT} \index{ideal quotient}
  1105. Let $I$ be an ideal and $f$ be a polynomial in the same
  1106. variables. Then the algebraic quotient is defined by
  1107. \[
  1108. I:f = \{ p \;| \; p * f \;\mbox{ member of }\; I\}\;.
  1109. \]
  1110. The ideal quotient $I:f$ contains $I$ and is obviously part of the
  1111. whole polynomial ring, i.e. contained in $\{1\}$. The case $I:f =
  1112. \{1\}$ is equivalent to $f$ being a member of $I$. The other extremal
  1113. case, $I:f=I$, occurs, when $f$ does not vanish at any general zero of $I$.
  1114. The explanation of the notion ``general zero'' introduced by van der
  1115. Waerden, however, is beyond the aim of this manual. The operation
  1116. of GROESOLVE/GROEPOSTPROC is based on nested ideal quotient
  1117. calculations.
  1118. If $I$ is given by a basis and $f$ is given as an expression, the
  1119. quotient can be calculated by
  1120. \[
  1121. IDEALQUOTIENT (\{exp1, \ldots , expm\}, exp); \]
  1122. where $\{exp1, exp2, \ldots , expm\}$ is a list of any number of
  1123. expressions or equations, {\it exp} is a single expression or equation.
  1124. IDEALQUOTIENT calculates the algebraic quotient of the ideal $I$
  1125. with the basis $\{exp1, exp2, \ldots , expm\}$ and {\it exp} with
  1126. respect to the variables given or extracted. $\{exp1, exp2, \ldots ,
  1127. expm\}$ is not necessarily a Gr\"obner basis.
  1128. The result is the Gr\"obner basis of
  1129. the quotient.
  1130. \subsection{Operators for Gr\"obner Bases in all Term Orderings}
  1131. \index{Hilbert polynomial}
  1132. In some cases where no Gr\"obner
  1133. basis with lexical ordering can be calculated, a calculation with a total
  1134. degree ordering is still possible. Then the Hilbert polynomial gives
  1135. information about the dimension of the solutions space and for finite
  1136. sets of solutions univariate polynomials can be calculated. The solutions
  1137. of the equation system then is contained in the cross product of all
  1138. solutions of all univariate polynomials.
  1139. \subsubsection{HILBERTPOLYNOMIAL: Hilbert Polynomial of an Ideal}
  1140. \ttindex{HILBERTPOLYNOMIAL}
  1141. This algorithm was contributed by {\sc Joachim Hollman}, Royal
  1142. Institute of Technology, Stockholm (private communication).
  1143. \[
  1144. HILBERTPOLYNOMIAL (\{exp1, \ldots , expm\})\;;
  1145. \]
  1146. where $\{exp1, exp2, \ldots , expm\}$ is a list of any number of
  1147. expressions or equations.
  1148. HILBERTPOLYNOMIAL calculates the Hilbert polynomial of the ideal
  1149. with basis $\{exp1, exp2, \ldots , expm\}$ with respect to the
  1150. variables given or extracted provided the given term ordering is
  1151. compatible with the degree, such as the GRADLEX- or REVGRADLEX-ordering.
  1152. The term ordering of the basis
  1153. must be active and $\{exp1, exp2,\ldots$, $ expm\}$ should be a
  1154. Gr\"obner basis with respect to this ordering. The Hilbert polynomial
  1155. gives information about the cardinality of solutions of the system
  1156. $\{exp1, exp2, \ldots , expm\}$: if the Hilbert polynomial is an
  1157. integer, the system has only a discrete set of solutions and the
  1158. polynomial is identical with the number of solutions counted with
  1159. their multiplicities. Otherwise the degree of the Hilbert
  1160. polynomial is the dimension of the solution space.
  1161. If the Hilbert polynomial is not a constant, it is constructed with the
  1162. variable ``X'' regardless of whether $x$ is member of $\{var1, var2,
  1163. \ldots , varn\}$ or not. The value of this polynomial at sufficiently
  1164. large numbers ``X''
  1165. is the difference
  1166. of the dimension of the linear vector space of all polynomials of degree
  1167. $ \leq X $ minus the dimension of the subspace of all polynomials of
  1168. degree $\leq X $ which belong also to the ideal.
  1169. \paragraph{Remark:} The number of zeros in an ideal and the
  1170. Hilbert polynomial depend only on the leading terms of the
  1171. Gr\"obner basis. So if a subsequent Hilbert calculation is planned, the
  1172. Gr\"obner calculation should be performed with ON GLTBASIS and
  1173. the value of GLTB (or its elements in a GROEBNERF context) should be
  1174. given to HILBERTPOLYNOMIAL. In this manner, a lot of computing time can be
  1175. saved in the case of large bases.
  1176. % Chapter 5.
  1177. \section{Calculations ``by Hand''}
  1178. The following operators support explicit calculations with
  1179. polynomials in a distributive representation at the REDUCE top level.
  1180. So they allow one to do Gr\"obner type evaluations stepwise by
  1181. separate calls. Note that the normal REDUCE arithmetic can be used
  1182. for arithmetic combinations of monomials and polynomials.
  1183. % Subsection 5.1
  1184. \subsection{Representing Polynomials in Distributive Form}
  1185. \ttindex{GSORT}
  1186. \[
  1187. GSORT (p);
  1188. \]
  1189. where $p$ is a polynomial or a list of polynomials.
  1190. If $p$ is a single polynomial, the result is a reordered version of $p$
  1191. in the distributive representation according to the variables and the
  1192. current term order mode; if $p$ is a list, its members are converted
  1193. into distributive representation and the result is the list sorted by
  1194. the term ordering of the leading terms; zero polynomials are
  1195. eliminated from the result.
  1196. \begin{verbatim}
  1197. torder({alpha,beta,gamma},lex);
  1198. dip := gsort(gamma*(alpha-1)**2*(beta+1)**2);
  1199. 2 2 2
  1200. DIP := ALPHA *BETA *GAMMA + 2*ALPHA *BETA*GAMMA
  1201. 2 2
  1202. + ALPHA *GAMMA - 2*ALPHA*BETA *GAMMA - 4*ALPHA*BETA*GAMMA
  1203. 2
  1204. - 2*ALPHA*GAMMA + BETA *GAMMA + 2*BETA*GAMMA + GAMMA
  1205. \end{verbatim}
  1206. % Subsection 5.2
  1207. \subsection{Splitting of a Polynomial into Leading Term and Reductum}
  1208. \ttindex{GSPLIT}
  1209. \[
  1210. GSPLIT (p);
  1211. \]
  1212. where $p$ is a polynomial.
  1213. GSPLIT converts the polynomial $p$ into distributive representation
  1214. and splits it into leading monomial and reductum. The result is a list
  1215. with two elements, the leading monomial and the reductum.
  1216. \begin{verbatim}
  1217. gslit(dip);
  1218. 2 2
  1219. {ALPHA *BETA *GAMMA,
  1220. 2 2 2
  1221. 2*ALPHA *BETA*GAMMA + ALPHA *GAMMA - 2*ALPHA*BETA *GAMMA
  1222. 2
  1223. - 4*ALPHA*BETA*GAMMA - 2*ALPHA*GAMMA + BETA *GAMMA
  1224. + 2*BETA*GAMMA + GAMMA}
  1225. \end{verbatim}
  1226. \subsection{Calculation of Buchberger's S-polynomial}
  1227. \ttindex{GSPOLY}
  1228. \[
  1229. GSPOLY (p1,p2);
  1230. \]
  1231. where $p1$ and $p2$ are polynomials.
  1232. GSPOLY calculates the $S$-polynomial from $p1$ and $p2$;
  1233. Example for a complete calculation (taken from {\sc Davenport et al.}
  1234. \cite{Davenport:88a}):
  1235. \begin{verbatim}
  1236. torder({x,y,z},lex)$
  1237. g1 := x**3*y*z - x*z**2;
  1238. g2 := x*y**2*z - x*y*z;
  1239. g3 := x**2*y**2 - z;$
  1240. % first S-polynomial
  1241. g4 := gspoly(g2,g3);$
  1242. 2 2
  1243. G4 := X *Y*Z - Z
  1244. % next S-polynomial
  1245. p := gspoly(g2,g4); $
  1246. 2 2
  1247. P := X *Y*Z - Y*Z
  1248. % and reducing, here only by g4
  1249. g5 := preduce(p,{g4});
  1250. 2 2
  1251. G5 := - Y*Z + Z
  1252. % last S-polynomial}
  1253. g6 := gspoly(g4,g5);
  1254. 2 2 3
  1255. G6 := X *Z - Z
  1256. % and the final basis sorted descending
  1257. gsort{g2,g3,g4,g5,g6};
  1258. 2 2
  1259. {X *Y - Z,
  1260. 2 2
  1261. X *Y*Z - Z ,
  1262. 2 2 3
  1263. X *Z - Z ,
  1264. 2
  1265. X*Y *Z - X*Y*Z,
  1266. 2 2
  1267. - Y*Z + Z }
  1268. \end{verbatim}
  1269. \bibliography{groebner}
  1270. \bibliographystyle{plain}
  1271. \end{document}