pk-groeb.tex 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. \section{Groebner package}
  2. \begin{Introduction}{Groebner bases}
  3. The GROEBNER package calculates \nameindex{Groebner bases} using the
  4. \nameindex{Buchberger algorithm} and provides related algorithms
  5. for arithmetic with ideal bases, such as ideal quotients,
  6. Hilbert polynomials (\nameindex{Hollmann algorithm}),
  7. basis conversion (
  8. \nameindex{Faugere-Gianni-Lazard-Mora algorithm}), independent
  9. variable set (\nameindex{Kredel-Weispfenning algorithm}).
  10. Some routines of the Groebner package are used by \nameref{solve} - in
  11. that context the package is loaded automatically. However, if you
  12. want to use the package by explicit calls you must load it by
  13. \begin{verbatim}
  14. load_package groebner;
  15. \end{verbatim}
  16. For the common parameter setting of most operators in this package
  17. see \nameref{ideal parameters}.
  18. \end{Introduction}
  19. \begin{Concept}{Ideal Parameters}
  20. \index{polynomial}
  21. Most operators of the \name{Groebner} package compute expressions in a
  22. polynomial ring which given as \meta{R}[\meta{var},\meta{var},...] where
  23. \meta{R} is the current REDUCE coefficient domain. All algebraically
  24. exact domains of REDUCE are supported. The package can operate over rings
  25. and fields. The operation mode is distinguished automatically. In
  26. general the ring mode is a bit faster than the field mode. The factoring
  27. variant can be applied only over domains which allow you factoring of
  28. multivariate polynomials.
  29. The variable sequence \meta{var} is either declared explicitly as argument
  30. in form of a \nameref{list} in \nameref{torder}, or it is extracted
  31. automatically from the expressions. In the second case the current REDUCE
  32. system order is used (see \nameref{korder}) for arranging the variables.
  33. If some kernels should play the role of formal parameters (the ground
  34. domain \meta{R} then is the polynomial ring over these), the variable
  35. sequences must be given explicitly.
  36. All REDUCE \nameref{kernel}s can be used as variables. But please note,
  37. that all variables are considered as independent. E.g. when using
  38. \name{sin(a)} and \name{cos(a)} as variables, the basic relation
  39. \name{sin(a)^2+cos(a)^2-1=0} must be explicitly added to an equation set
  40. because the Groebner operators don't include such knowledge automatically.
  41. The terms (monomials) in polynomials are arranged according to the current
  42. \nameref{term order}. Note that the algebraic properties of the computed
  43. results only are valid as long as neither the ordering nor the variable
  44. sequence changes.
  45. The input expressions \meta{exp} can be polynomials \meta{p}, rational
  46. functions \meta{n}/\meta{d} or equations \meta{lh}=\meta{rh} built from
  47. polynomials or rational functions. Apart from the \name{tracing}
  48. algorithms \nameref{groebnert} and \nameref{preducet}, where the equations
  49. have a specific meaning, equations are converted to simple expressions by
  50. taking the difference of the left-hand and right-hand sides
  51. \meta{lh}-\meta{rh}=>\meta{p}. Rational functions are converted to
  52. polynomials by converting the expression to a common denominator form
  53. first, and then using the numerator only \meta{n}=>\meta{p}. So eventual
  54. zeros of the denominators are ignored.
  55. A basis on input or output of an algorithm is coded as \nameref{list} of
  56. expressions \{\meta{exp},\meta{exp},...\} . \end{Concept}
  57. %-----------------------------------------------------------------
  58. \subsection{Term order}
  59. %-----------------------------------------------------------------
  60. \begin{Introduction}{Term order}
  61. \index{distributive polynomials}
  62. For all \name{Groebner} operations the polynomials are
  63. represented in distributive form: a sum of terms (monomials).
  64. The terms are ordered corresponding to the actual \name{term order}
  65. which is set by the \nameref{torder} operator, and to the
  66. actual variable sequence which is either given as explicit
  67. parameter or by the system \nameref{kernel} order.
  68. \end{Introduction}
  69. \begin{Operator}{torder}
  70. The operator \name{torder} sets the actual variable sequence and term order.
  71. 1. simple term order:
  72. \begin{Syntax}
  73. \name{torder}\(\meta{vl}, \meta{m}\)
  74. \end{Syntax}
  75. where \meta{vl} is a \nameref{list} of variables (\nameref{kernel}s) and
  76. \meta{m} is the name of a simple \nameref{term order} mode
  77. \ref{lex term order}, \ref{gradlex term order},
  78. \ref{revgradlex term order} or another implemented parameterless mode.
  79. 2. stepped term order:
  80. \begin{Syntax}
  81. \name{torder} \(\meta{vl},\meta{m},\meta{n}\)
  82. \end{Syntax}
  83. where \meta{m} is the name of a two step term order, one of
  84. \nameref{gradlexgradlex term order}, \nameref{gradlexrevgradlex term order},
  85. \nameref{lexgradlex term order} or \nameref{lexrevgradlex term order}, and
  86. \meta{n} is a positive integer.
  87. 3. weighted term order
  88. \begin{Syntax}
  89. \name{torder} \(\meta{vl}, \name{weighted}, \meta{n},\meta{n},...\);
  90. \end{Syntax}
  91. where the \meta{n} are positive integers, see \nameref{weighted term order}.
  92. 4. matrix term order
  93. \begin{Syntax}
  94. \name{torder} \(\meta{vl}, \name{matrix}, \meta{m}\);
  95. \end{Syntax}
  96. where \meta{m} is a matrix with integer elements, see
  97. \nameref{torder_compile}.
  98. 5. compiled term order
  99. \begin{Syntax}
  100. \name{torder} \(\meta{vl}, \name{co}\);
  101. \end{Syntax}
  102. where \meta{co} is the name of a routine generated by
  103. \nameref{torder_compile}.
  104. \name{torder} sets the variable sequence and the term order mode. If the
  105. an empty list is used as variable sequence, the automatic variable extraction
  106. is activated. The defaults are the empty variable list an the
  107. \nameref{lex term order}.
  108. The previous setting is returned as a list.
  109. Alternatively to the above syntax the arguments of \name{torder} may be
  110. collected in a \nameref{list} and passed as one argument to
  111. \name{torder}.
  112. \end{Operator}
  113. %------------------------------------------------------------
  114. \begin{Operator}{torder_compile}
  115. \index{term order}
  116. A matrix can be converted into
  117. a compilable LISP program for faster execution by using
  118. \begin{Syntax}
  119. \name{torder\_compile}\(\meta{name},\meta{mat}\)
  120. \end{Syntax}
  121. where \meta{name} is an identifier for the new term order and \meta{mat}
  122. is an integer matrix to be used as \nameref{matrix term order}. Afterwards
  123. the term order can be activated by using \meta{name} in a \nameref{torder}
  124. expression. The resulting program is compiled if the switch \nameref{comp}
  125. is on, or if the \name{torder\_compile} expression is part of a compiled
  126. module.
  127. \end{Operator}
  128. %------------------------------------------------------------
  129. \begin{Concept}{lex term order}
  130. \index{term order}\index{variable elimination}
  131. The terms are ordered lexicographically: two terms t1 t2
  132. are compared for their degrees
  133. along the fixed variable sequence: t1 is higher than t2
  134. if the first different degree is higher in t1.
  135. This order has the \name{elimination property}
  136. for \name{groebner basis} calculations.
  137. If the ideal has a univariate polynomial in the last
  138. variable the groebner basis will contain
  139. such polynomial. \name{Lex} is best
  140. suited for solving of polynomial equation systems.
  141. \end{Concept}
  142. %------------------------------------------------------------
  143. \begin{Concept}{gradlex term order}
  144. \index{term order}
  145. The terms are ordered first with their total
  146. degree, and if the total degree is identical
  147. the comparison is \nameref{lex term order}.
  148. With \name{groebner} basis calculations this term order
  149. produces polynomials of lowest degree.
  150. \end{Concept}
  151. %------------------------------------------------------------
  152. \begin{Concept}{revgradlex term order}
  153. \index{term order}
  154. The terms are ordered first with their total
  155. degree (degree sum), and if the total degree is identical
  156. the comparison is the inverse of \nameref{lex term order}.
  157. With \nameref{groebner} and \nameref{groebnerf}
  158. calculations this term order
  159. is similar to \nameref{gradlex term order}; it is known
  160. as most efficient ordering with respect to computing time.
  161. \end{Concept}
  162. %------------------------------------------------------------
  163. \begin{Concept}{gradlexgradlex term order}
  164. \index{term order}
  165. The terms are separated into two groups where the
  166. second parameter of the \nameref{torder} call determines
  167. the length of the first group. For a comparison first
  168. the total degrees of both variable groups are compared.
  169. If both are equal
  170. \nameref{gradlex term order} comparison is applied to the first
  171. group, and if that does not decide \nameref{gradlex term order}
  172. is applied for the second group. This order has the elimination
  173. property for the variable groups. It can be used e.g. for
  174. separating variables from parameters.
  175. \end{Concept}
  176. %------------------------------------------------------------
  177. \begin{Concept}{gradlexrevgradlex term order}
  178. \index{term order}
  179. Similar to \nameref{gradlexgradlex term order}, but using
  180. \nameref{revgradlex term order} for the second group.
  181. \end{Concept}
  182. %------------------------------------------------------------
  183. \begin{Concept}{lexgradlex term order}
  184. \index{term order}
  185. Similar to \nameref{gradlexgradlex term order}, but using
  186. \nameref{lex term order} for the first group.
  187. \end{Concept}
  188. %------------------------------------------------------------
  189. \begin{Concept}{lexrevgradlex term order}
  190. \index{term order}
  191. Similar to \nameref{gradlexgradlex term order}, but using
  192. \nameref{lex term order} for the first group
  193. \nameref{revgradlex term order} for the second group.
  194. \end{Concept}
  195. %------------------------------------------------------------
  196. \begin{Concept}{weighted term order}
  197. \index{term order}
  198. establishes a graduated ordering
  199. similar to \nameref{gradlex term order}, where the exponents first are
  200. multiplied by the given weights. If there are less weight values than
  201. variables, the weight list is extended by ones. If the weighted degree
  202. comparison is not decidable, the
  203. \nameref{lex term order} is used.
  204. \end{Concept}
  205. %------------------------------------------------------------
  206. \begin{Concept}{graded term order}
  207. \index{term order}
  208. establishes a cascaded term ordering: first a graduated ordering
  209. similar to \nameref{gradlex term order} is used, where the exponents first are
  210. multiplied by the given weights. If there are less weight values than
  211. variables, the weight list is extended by ones. If the weighted degree
  212. comparison is not decidable, the term ordering described in the following
  213. parameters of the \nameref{torder} command is used.
  214. \end{Concept}
  215. %------------------------------------------------------------
  216. \begin{Concept}{matrix term order}
  217. \index{term order}
  218. Any arbitrary term order mode can be installed by a matrix with
  219. integer elements where the row length corresponds to the variable
  220. number. The matrix must have at least as many rows as columns.
  221. It must have full rank, and the top nonzero element of each column
  222. must be positive.
  223. The matrix \name{term order mode}
  224. defines a term order where the exponent vectors of the monomials are
  225. first multiplied by the matrix and the resulting vectors are compared
  226. lexicographically.
  227. If the switch \nameref{comp} is on, the matrix is converted into
  228. a compiled LISP program for faster execution. A matrix can also be
  229. compiled explicitly, see \nameref{torder_compile}.
  230. \end{Concept}
  231. %---------------------------------------------------------------
  232. %------------------------------------------------------------
  233. \subsection{Basic Groebner operators}
  234. %-------------------------------------------------------------
  235. \begin{Operator}{gvars}
  236. \begin{Syntax}
  237. \name{gvars}\(\{\meta{exp},\meta{exp},... \}\)
  238. \end{Syntax}
  239. where \meta{exp} are expressions or \nameref{equation}s.
  240. \name{gvars} extracts from the expressions the \nameref{kernel}\name{s}
  241. which can
  242. play the role of variables for a \nameref{groebner} or \nameref{groebnerf}
  243. calculation.
  244. \end{Operator}
  245. %---------------------------------------------------------------
  246. \begin{Operator}{groebner}
  247. \index{Buchberger algorithm}
  248. \begin{Syntax}
  249. \name{groebner}\(\{\name{exp}, ...\}\)
  250. \end{Syntax}
  251. where \{\name{exp}, ... \} is a list of
  252. expressions or equations.
  253. The operator \name{groebner} implements the Buchberger algorithm
  254. for computing Groebner bases for a given set of
  255. expressions with respect to the given set of variables in the order
  256. given. As a side effect, the sequence of variables is stored as a REDUCE list
  257. in the shared variable \nameref{gvarslast} - this is important in cases
  258. where the algorithm rearranges the variable sequence because \nameref{groebopt}
  259. is \name{on}.
  260. \begin{Examples}
  261. groebner({x**2+y**2-1,x-y}) & \{X - Y,2*Y**2 -1\}
  262. \end{Examples}
  263. \begin{Related}
  264. \item[ \nameref{groebnerf} operator]
  265. \item[ \nameref{gvarslast} variable]
  266. \item[ \nameref{groebopt} switch]
  267. \item[ \nameref{groebprereduce} switch]
  268. \item[ \nameref{groebfullreduction} switch]
  269. \item[ \nameref{gltbasis} switch]
  270. \item[ \nameref{gltb} variable]
  271. \item[ \nameref{glterms} variable]
  272. \item[ \nameref{groebstat} switch]
  273. \item[ \nameref{trgroeb} switch]
  274. \item[ \nameref{trgroebs} switch]
  275. \item[ \nameref{groebprot} switch]
  276. \item[ \nameref{groebprotfile} variable]
  277. \item[ \nameref{groebnert} operator]
  278. \end{Related}
  279. \end{Operator}
  280. %-------------------------------------------------------
  281. \begin{Operator}{groebner\_walk}
  282. The operator \name{groebner\_walk} computes a \nameref{lex} basis
  283. from a given \nameref{graded} (or \nameref{weighted}) one.
  284. \begin{Syntax}
  285. \name{groebner\_walk}\(\meta{g}\)
  286. \end{Syntax}
  287. where \meta{g} is a \nameref{graded} basis (or \nameref{weighted} basis
  288. with a weight vector with one repeated element) of the polynomial ideal.
  289. \name{Groebner\_walk} computes a sequence of monomial bases, each
  290. time lifting the full system to a complete basis. \name{Groebner\_walk}
  291. should be called only in cases, where a normal \nameref{kex} computation
  292. would take too much computer time.
  293. The operator \nameref{torder} has to be called before in order to
  294. define the variable sequence and the term order mode of \meta{g}.
  295. The variable \nameref{gvarslast} is not set.
  296. Do not call \name{groebner\_walk} with \name{on} \nameref{groebopt}.
  297. \name{Groebner\_walk} includes some overhead (such as e. g.
  298. computation with division). On the other hand, sometimes
  299. \name{groebner\_walk} is faster than a direct \nameref{lex} computation.
  300. \end{Operator}
  301. %-------------------------------------------------------
  302. \begin{Switch}{groebopt}
  303. If \name{groebopt} is set ON, the sequence of variables is optimized
  304. with respect to execution speed of \name{groebner} calculations;
  305. note that the final list of variables is available in \nameref{gvarslast}.
  306. By default \name{groebopt} is off, conserving the original variable
  307. sequence.
  308. An explicitly declared dependency using the \nameref{depend}
  309. declaration supersedes the variable optimization.
  310. \begin{Examples}
  311. depend a, x, y;
  312. \end{Examples}
  313. guarantees that a will be placed in front of x and y.
  314. \end{Switch}
  315. %-------------------------------------------------------
  316. \begin{Variable}{gvarslast}
  317. After a \nameref{groebner} or \nameref{groebnerf} calculation
  318. the actual variable sequence is stored in the variable
  319. \name{gvarslast}. If \nameref{groebopt} is \name{on}
  320. \name{gvarslast} shows the variable sequence after reordering.
  321. \end{Variable}
  322. %--------------------------------------------------------------
  323. \begin{Switch}{groebprereduce}
  324. If \name{groebprereduce} set ON, \nameref{groebner}
  325. and \nameref{groebnerf} try to simplify the
  326. input expressions: if the head term of an input expression is a
  327. multiple of the head term of another expression, it can be reduced;
  328. these reductions are done cyclicly as long as possible in order to
  329. shorten the main part of the algorithm.
  330. By default \name{groebprereduce} is off.
  331. \end{Switch}
  332. %---------------------------------------------------------------
  333. \begin{Switch}{groebfullreduction}
  334. If \name{groebfullreduction} set off, the polynomial reduction steps during
  335. \nameref{groebner} and \nameref{groebnerf} are limited to the pure head
  336. term reduction; subsequent terms are reduced otherwise.
  337. By default \name{groebfullreduction} is on.
  338. \end{Switch}
  339. %----------------------------------------------------------------
  340. \begin{Switch}{gltbasis}
  341. If \name{gltbasis} set on, the leading terms of the result basis
  342. of a \nameref{groebner} or \nameref{groebnerf} calculation are
  343. extracted. They are collected as a basis of monomials, which is
  344. available as value of the global variable \nameref{gltb}.
  345. \end{Switch}
  346. %------------------------------------------------------------------
  347. \begin{Variable}{gltb}
  348. See \nameref{gltbasis}
  349. \end{Variable}
  350. %------------------------------------------------------------------
  351. \begin{Variable}{glterms}
  352. If the expressions in a \nameref{groebner} or \nameref{groebnerf}
  353. call contain parameters (symbols
  354. which are not member of the variable list), the share variable
  355. \name{glterms} is set to a list of expression which during the
  356. calculation were assumed to be nonzero. The calculated bases
  357. are valid only under the assumption that all these expressions do
  358. not vanish.
  359. \end{Variable}
  360. %-----------------------------------------------------------
  361. \begin{Switch}{groebstat}
  362. if \name{groebstat} is on, a summary of the
  363. \nameref{groebner} or \nameref{groebnerf} computation is printed
  364. at the end
  365. including the computing time, the number of intermediate
  366. H polynomials and the counters for the criteria hits.
  367. \end{Switch}
  368. %-----------------------------------------------------------
  369. \begin{Switch}{trgroeb}
  370. if \name{trgroeb} is on, intermediate H polynomials are
  371. printed during a \nameref{groebner}
  372. or \nameref{groebnerf} calculation.
  373. \end{Switch}
  374. %-----------------------------------------------------------
  375. \begin{Switch}{trgroebs}
  376. if \name{trgroebs} is on, intermediate H and S polynomials are
  377. printed during a \nameref{groebner} or \nameref{groebnerf} calculation.
  378. \end{Switch}
  379. %-----------------------------------------------------------
  380. \begin{Operator}{gzerodim?}
  381. \begin{Syntax}
  382. \name{gzerodim!?}\(\meta{basis}\)
  383. \end{Syntax}
  384. where \meta{bas} is a Groebner basis in the current
  385. \nameref{term order} with the actual setting
  386. (see \nameref{ideal parameters}).
  387. \name{gzerodim!?} tests whether the ideal spanned by the given basis
  388. has dimension zero. If yes, the number of zeros is returned,
  389. \nameref{nil} otherwise.
  390. \end{Operator}
  391. %---------------------------------------------------------------
  392. \begin{Operator}{gdimension}
  393. \index{ideal dimension}\index{groebner}
  394. \begin{Syntax}
  395. \name{gdimension}\(\meta{bas}\)
  396. \end{Syntax}
  397. where \meta{bas} is a \nameref{groebner} basis in the current
  398. term order (see \nameref{ideal parameters}).
  399. \name{gdimension} computes the dimension of the ideal
  400. spanned by the given basis and returns the dimension as an integer
  401. number. The Kredel-Weispfenning algorithm is used: the dimension
  402. is the length of the longest independent variable set,
  403. see \nameref{gindependent\_sets}
  404. \end{Operator}
  405. %---------------------------------------------------------------
  406. \begin{Operator}{gindependent\_sets}
  407. \index{ideal variables}\index{ideal dimension}\index{groebner}
  408. \index{Kredel-Weispfenning algorithm}
  409. \begin{Syntax}
  410. \name{gindependent\_sets}\(\meta{bas}\)
  411. \end{Syntax}
  412. where \meta{bas} is a \nameref{groebner} basis in any \name{term order}
  413. (which must be the current \name{term order}) with the specified
  414. variables (see \nameref{ideal parameters}).
  415. \name{Gindependent_sets} computes the maximal
  416. left independent variable sets of the ideal, that are
  417. the variable sets which play the role of free parameters in the
  418. current ideal basis. Each set is a list which is a subset of the
  419. variable list. The result is a list of these sets. For an
  420. ideal with dimension zero the list is empty.
  421. The Kredel-Weispfenning algorithm is used.
  422. \end{Operator}
  423. %--------------------------------------------------------------
  424. \begin{Operator}{dd_groebner}
  425. For a homogeneous system of polynomials under
  426. \nameref{graded term order}, \nameref{gradlex term order},
  427. \nameref{revgradlex term order}
  428. or \nameref{weighted term order}
  429. a Groebner Base can be computed with limiting the grade
  430. of the intermediate S polynomials:
  431. \begin{Syntax}
  432. \name{dd_groebner}\(\meta{d1},\meta{d2},\meta{plist}\)
  433. \end{Syntax}
  434. where \meta{d1} is a non negative integer and \meta{d2} is an integer
  435. or ``infinity". A pair of polynomials is considered
  436. only if the grade of the lcm of their head terms is between
  437. \meta{d1} and \meta{d2}.
  438. For the term orders \name{graded} or \name{weighted} the (first) weight
  439. vector is used for the grade computation. Otherwise the total
  440. degree of a term is used.
  441. \end{Operator}
  442. %--------------------------------------------------------------
  443. \begin{Operator}{glexconvert}
  444. \index{ideal variables}\index{term order}
  445. \begin{Syntax}
  446. \name{glexconvert}\(\meta{bas}[,\meta{vars}][,MAXDEG=\meta{mx}]
  447. [,NEWVARS=\meta{nv}]\)
  448. \end{Syntax}
  449. where \meta{bas} is a \nameref{groebner} basis
  450. in the current term order, \meta{mx} (optional) is a positive
  451. integer and \meta{nvl} (optional) is a list of variables
  452. (see \nameref{ideal parameters}).
  453. The operator \name{glexconvert} converts the basis
  454. of a zero-dimensional ideal (finite number
  455. of isolated solutions) from arbitrary ordering into a basis under
  456. \nameref{lex term order}.
  457. The parameter \meta{newvars} defines the new variable sequence.
  458. If omitted, the
  459. original variable sequence is used. If only a subset of variables is
  460. specified here, the partial ideal basis is evaluated.
  461. If \meta{newvars} is a list with one element, the minimal
  462. \nameindex{univariate polynomial} is computed.
  463. \meta{maxdeg} is an upper limit for the degrees. The algorithm stops with
  464. an error message, if this limit is reached.
  465. A warning occurs, if the ideal is not zero dimensional.
  466. \begin{Comments}
  467. During the call the \name{term order} of the input basis must
  468. be active.
  469. \end{Comments}
  470. \end{Operator}
  471. %--------------------------------------------------------------
  472. \begin{Operator}{greduce}
  473. \begin{Syntax}
  474. \name{greduce}\(exp, \{exp1, exp2, \ldots , expm\}\)
  475. \end{Syntax}
  476. where exp is an expression, and \{exp1, exp2, ... , expm\} is
  477. a list of expressions or equations.
  478. \name{greduce} is functionally equivalent with a call to
  479. \nameref{groebner} and then a call to \nameref{preduce}.
  480. \end{Operator}
  481. %---------------------------------------------------------
  482. \begin{Operator}{preduce}
  483. \begin{Syntax}
  484. \name{preduce}\(\meta{p}, \{\meta{exp}, \ldots \}\)
  485. \end{Syntax}
  486. where \meta{p} is an expression, and \{\meta{exp}, ... \} is
  487. a list of expressions or equations.
  488. \name{preduce} computes the remainder of \name{exp}
  489. modulo the given set of polynomials resp. equations.
  490. This result is unique (canonical) only if the given set
  491. is a \name{groebner} basis under the current \nameref{term order}
  492. see also: \nameref{preducet} operator.
  493. \end{Operator}
  494. %-------------------------------------------
  495. \begin{Operator}{idealquotient}
  496. \begin{Syntax}
  497. \name{idealquotient}\(\{\meta{exp}, ...\}, \meta{d}\)
  498. \end{Syntax}
  499. where \{\meta{exp},...\} is a list of
  500. expressions or equations, \meta{d} is a single expression or equation.
  501. \name{idealquotient} computes the ideal quotient:
  502. ideal spanned by the expressions \{\meta{exp},...\}
  503. divided by the single polynomial/expression \meta{f}. The result
  504. is the \nameref{groebner} basis of the quotient ideal.
  505. \end{Operator}
  506. %-------------------------------------------------------------
  507. \begin{Operator}{hilbertpolynomial}
  508. \index{Hollmann algorithm}
  509. \begin{Syntax}
  510. hilbertpolynomial\(\meta{bas}\)
  511. \end{Syntax}
  512. where \meta{bas} is a \nameref{groebner} basis in the
  513. current \nameref{term order}.
  514. The degree of the \name{Hilbert polynomial} is the
  515. dimension of the ideal spanned by the basis. For an
  516. ideal of dimension zero the Hilbert polynomial is a
  517. constant which is the number of common zeros of the
  518. ideal (including eventual multiplicities).
  519. The \name{Hollmann algorithm} is used.
  520. \end{Operator}
  521. %-------------------------------------------------------------
  522. \subsection{Factorizing Groebner bases}
  523. %-------------------------------------------------------------
  524. \begin{Operator}{groebnerf}
  525. \begin{Syntax}
  526. \name{groebnerf}\(\{\meta{exp}, ...\}[,\{\},\{\meta{nz}, ... \}]\);
  527. \end{Syntax}
  528. where \{\meta{exp}, ... \} is a list of expressions or
  529. equations, and \{\meta{nz},... \} is
  530. an optional list of polynomials to be considered as non zero
  531. for this calculation. An empty list must be passed as second argument
  532. if the non-zero list is specified.
  533. \name{groebnerf} tries to separate polynomials into individual factors and
  534. to branch the computation in a recursive manner (factorization tree).
  535. The result is a list of partial Groebner bases.
  536. Multiplicities (one factor with a higher power, the same partial basis
  537. twice) are deleted as early as possible in order to speed up the
  538. calculation.
  539. The third parameter of \name{groebnerf} declares some polynomials
  540. nonzero. If any of these is found in a branch of the calculation
  541. the branch is canceled.
  542. \begin{Bigexample}
  543. groebnerf({ 3*x**2*y+2*x*y+y+9*x**2+5*x = 3,
  544. 2*x**3*y-x*y-y+6*x**3-2*x**2-3*x = -3,
  545. x**3*y+x**2*y+3*x**3+2*x**2 }, {y,x});
  546. {{Y - 3,X},
  547. 2
  548. {2*Y + 2*X - 1,2*X - 5*X - 5}}
  549. \end{Bigexample}
  550. \begin{Related}
  551. \item[ \nameref{groebresmax} variable]
  552. \item[ \nameref{groebmonfac} variable]
  553. \item[ \nameref{groebrestriction} variable]
  554. \item[ \nameref{groebner} operator]
  555. \item[ \nameref{gvarslast} variable]
  556. \item[ \nameref{groebopt} switch]
  557. \item[ \nameref{groebprereduce} switch]
  558. \item[ \nameref{groebfullreduction} switch]
  559. \item[ \nameref{gltbasis} switch]
  560. \item[ \nameref{gltb} variable]
  561. \item[ \nameref{glterms} variable]
  562. \item[ \nameref{groebstat} switch]
  563. \item[ \nameref{trgroeb} switch]
  564. \item[ \nameref{trgroebs} switch]
  565. \item[ \nameref{groebnert} operator]
  566. \end{Related}
  567. \end{Operator}
  568. % ------------------------------------------------------------------
  569. \begin{Variable}{groebmonfac}
  570. The variable \name{groebmonfac} is connected to
  571. the handling of monomial factors. A monomial factor is a product
  572. of variable powers as a factor, e.g. x**2*y in x**3*y -
  573. 2*x**2*y**2. A monomial factor represents a solution of the type
  574. x = 0 or y = 0 with a certain multiplicity. With
  575. \nameref{groebnerf} the multiplicity of monomial factors is lowered
  576. to the value of the shared variable \name{groebmonfac}
  577. which by default is 1 (= monomial factors remain present, but their
  578. multiplicity is brought down). With
  579. \name{groebmonfac}:= 0
  580. the monomial factors are suppressed completely.
  581. \end{Variable}
  582. % ----------------------------------------------------------------
  583. \begin{Variable}{groebresmax}
  584. The variable \name{groebresmax}
  585. controls during \nameref{groebnerf} calculations
  586. the number of partial results. Its default value is 300. If
  587. more partial results are calculated, the calculation is
  588. terminated.
  589. \end{Variable}
  590. % ----------------------------------------------------------------
  591. \begin{Variable}{groebrestriction}
  592. During \nameref{groebnerf} calculations
  593. irrelevant branches can be excluded
  594. by setting the variable \name{groebrestriction}. The
  595. following restrictions are implemented:
  596. \begin{Syntax}
  597. \name{groebrestriction} := \name{nonnegative} \\
  598. \name{groebrestriction} := \name{positive}\\
  599. \name{groebrestriction} := \name{zeropoint}
  600. \end{Syntax}
  601. With \name{nonnegative} branches are excluded where one
  602. polynomial has no nonnegative real zeros; with \name{positive}
  603. the restriction is sharpened to positive zeros only.
  604. The restriction \name{zeropoint} excludes all branches
  605. which do not have the origin (0,0,...0) in their solution
  606. set.
  607. \end{Variable}
  608. %---------------------------------------------------------
  609. \subsection{Tracing Groebner bases}
  610. %---------------------------------------------------------
  611. \index{tracing Groebner}
  612. \begin{Switch}{groebprot}
  613. If \name{groebprot} is \name{ON} the computation steps during
  614. \nameref{preduce}, \nameref{greduce} and \nameref{groebner}
  615. are collected in a list which is assigned to the variable
  616. \nameref{groebprotfile}.
  617. \end{Switch}
  618. %----------------------------------------------------------
  619. \begin{Variable}{groebprotfile}
  620. See \nameref{groebprot} switch.
  621. \end{Variable}
  622. %----------------------------------------------------------
  623. \begin{Operator}{groebnert}
  624. \begin{Syntax}
  625. \name{groebnert}\(\{\meta{v}=\meta{exp},...\}\)
  626. \end{Syntax}
  627. where \meta{v} are \nameref{kernel}\name{s} (simple or indexed variables),
  628. \meta{exp} are polynomials.
  629. \name{groebnert} is functionally equivalent to a \nameref{groebner}
  630. call for \{\meta{exp},...\}, but the result is a set of
  631. equations where the left-hand sides are the basis elements while
  632. the right-hand sides are the same values expressed as combinations
  633. of the input formulas, expressed in terms of the names \meta{v}
  634. \begin{Bigexample}
  635. groebnert({p1=2*x**2+4*y**2-100,p2=2*x-y+1});
  636. GB1 := {2*X - Y + 1=P2,
  637. 2
  638. 9*Y - 2*Y - 199= - 2*X*P2 - Y*P2 + 2*P1 + P2}
  639. \end{Bigexample}
  640. \end{Operator}
  641. %----------------------------------------------------------
  642. \begin{Operator}{preducet}
  643. \begin{Syntax}
  644. \name{preduce}\(\meta{p},\{\meta{v}=\meta{exp}...\}\)
  645. \end{Syntax}
  646. where \meta{p} is an expression, \meta{v} are kernels
  647. (simple or indexed variables),
  648. \name{exp} are polynomials.
  649. \name{preducet} computes the remainder of \meta{p} modulo \{\meta{exp},...\}
  650. similar to \nameref{preduce}, but the result is an equation
  651. which expresses the remainder as combination of the polynomials.
  652. \begin{Bigexample}
  653. GB2 := {G1=2*X - Y + 1,G2=9*Y**2 - 2*Y - 199}
  654. preducet(q=x**2,gb2);
  655. - 16*Y + 208= - 18*X*G1 - 9*Y*G1 + 36*Q + 9*G1 - G2
  656. \end{Bigexample}
  657. \end{Operator}
  658. %------------------------------------------------------------
  659. \subsection{Groebner Bases for Modules}
  660. %------------------------------------------------------------
  661. \begin{Concept}{Module}
  662. Given a polynomial ring, e.g. R=Z[x,y,...] and an integer n>1.
  663. The vectors with n elements of R form a free MODULE under
  664. elementwise addition and multiplication with elements of R.
  665. For a submodule given by a finite basis a Groebner basis
  666. can be computed, and the facilities of the GROEBNER package
  667. are available except the operators \nameref{groebnerf}
  668. and \name{groesolve}. The vectors are encoded using auxiliary
  669. variables which represent the unit vectors in the module.
  670. These are declared in the share variable \nameref{gmodule}.
  671. \end{Concept}
  672. \begin{Variable}{gmodule}
  673. The vectors of a free \nameref{module} over a polynomial ring R
  674. are encoded as linear combinations with unit vectors of
  675. M which are represented by auxiliary variables. These
  676. must be collected in the variable \name{gmodule} before
  677. any call to an operator of the Groebner package.
  678. \begin{verbatim}
  679. torder({x,y,v1,v2,v3})$
  680. gmodule := {v1,v2,v3}$
  681. g:=groebner({x^2*v1 + y*v2,x*y*v1 - v3,2y*v1 + y*v3});
  682. \end{verbatim}
  683. compute the Groebner basis of the submodule
  684. \begin{verbatim}
  685. ([x^2,y,0],[xy,0,-1],[0,2y,y])
  686. \end{verbatim}
  687. The members of the list \name{gmodule} are automatically
  688. appended to the end of the variable list, if they are not
  689. yet members there. They take part in the actual term ordering.
  690. \end{Variable}
  691. %------------------------------------------------------------
  692. \subsection{Computing with distributive polynomials}
  693. %------------------------------------------------------------
  694. \begin{Operator}{gsort}
  695. \index{distributive polynomials}
  696. \begin{Syntax}
  697. \name{gsort}\(\meta{p}\)
  698. \end{Syntax}
  699. where \meta{p} is a polynomial or a list of polynomials.
  700. The polynomials are reordered and sorted corresponding to
  701. the current \nameref{term order}.
  702. \begin{Examples}
  703. torder lex;\\
  704. gsort(x**2+2x*y+y**2,{y,x}); & {y**2+2y*x+x**2}
  705. \end{Examples}
  706. \end{Operator}
  707. %------------------------------------------------------------
  708. \begin{Operator}{gsplit}
  709. \index{distributive polynomials}
  710. \begin{Syntax}
  711. \name{gsplit}\(\meta{p}[,\meta{vars}]\);
  712. \end{Syntax}
  713. where \meta{p} is a polynomial or a list of polynomials.
  714. The polynomial is reordered corresponding to the
  715. the current \nameref{term order} and then
  716. separated into leading term and reductum. Result is
  717. a list with the leading term as first and the reductum
  718. as second element.
  719. \begin{Examples}
  720. torder lex;\\
  721. gsplit(x**2+2x*y+y**2,{y,x}); & \{y**2,2y*x+x**2\}
  722. \end{Examples}
  723. \end{Operator}
  724. %-------------------------------------------------------
  725. \begin{Operator}{gspoly}
  726. \index{distributive polynomials}
  727. \begin{Syntax}
  728. \name{gspoly}\(\meta{p1},\meta{p2}\);
  729. \end{Syntax}
  730. where \meta{p1} and \meta{p2} are polynomials.
  731. The \name{subtraction} polynomial of p1 and p2 is computed
  732. corresponding to the method of the Buchberger algorithm for
  733. computing \name{groebner bases}: p1 and p2 are multiplied
  734. with terms such that when subtracting them the leading terms
  735. cancel each other.
  736. \end{Operator}