pk-groeb.tex 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936
  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. \begin{Operator}{saturation}
  523. \begin{Syntax}
  524. \name{saturation}\(\{\meta{exp}, ...\}, \meta{p}\)
  525. \end{Syntax}
  526. where \{\meta{exp},...\} is a list of
  527. expressions or equations, \meta{p} is a single polynomial.
  528. \name{Saturation} computes the quotient of the polynomial \meta{p}
  529. and a power (with unknown but finite exponent) of the ideal built from
  530. \{\meta{exp}, ...\}. The result is the computed quotient. \name{Saturation}
  531. calls \nameref{idealquotient} several times until the result does not change
  532. any more.
  533. \end{Operator}
  534. %-------------------------------------------------------------
  535. \subsection{Factorizing Groebner bases}
  536. %-------------------------------------------------------------
  537. \begin{Operator}{groebnerf}
  538. \begin{Syntax}
  539. \name{groebnerf}\(\{\meta{exp}, ...\}[,\{\},\{\meta{nz}, ... \}]\);
  540. \end{Syntax}
  541. where \{\meta{exp}, ... \} is a list of expressions or
  542. equations, and \{\meta{nz},... \} is
  543. an optional list of polynomials to be considered as non zero
  544. for this calculation. An empty list must be passed as second argument
  545. if the non-zero list is specified.
  546. \name{groebnerf} tries to separate polynomials into individual factors and
  547. to branch the computation in a recursive manner (factorization tree).
  548. The result is a list of partial Groebner bases.
  549. Multiplicities (one factor with a higher power, the same partial basis
  550. twice) are deleted as early as possible in order to speed up the
  551. calculation.
  552. The third parameter of \name{groebnerf} declares some polynomials
  553. nonzero. If any of these is found in a branch of the calculation
  554. the branch is canceled.
  555. \begin{Bigexample}
  556. groebnerf({ 3*x**2*y+2*x*y+y+9*x**2+5*x = 3,
  557. 2*x**3*y-x*y-y+6*x**3-2*x**2-3*x = -3,
  558. x**3*y+x**2*y+3*x**3+2*x**2 }, {y,x});
  559. {{Y - 3,X},
  560. 2
  561. {2*Y + 2*X - 1,2*X - 5*X - 5}}
  562. \end{Bigexample}
  563. \begin{Related}
  564. \item[ \nameref{groebresmax} variable]
  565. \item[ \nameref{groebmonfac} variable]
  566. \item[ \nameref{groebrestriction} variable]
  567. \item[ \nameref{groebner} operator]
  568. \item[ \nameref{gvarslast} variable]
  569. \item[ \nameref{groebopt} switch]
  570. \item[ \nameref{groebprereduce} switch]
  571. \item[ \nameref{groebfullreduction} switch]
  572. \item[ \nameref{gltbasis} switch]
  573. \item[ \nameref{gltb} variable]
  574. \item[ \nameref{glterms} variable]
  575. \item[ \nameref{groebstat} switch]
  576. \item[ \nameref{trgroeb} switch]
  577. \item[ \nameref{trgroebs} switch]
  578. \item[ \nameref{groebnert} operator]
  579. \end{Related}
  580. \end{Operator}
  581. % ------------------------------------------------------------------
  582. \begin{Variable}{groebmonfac}
  583. The variable \name{groebmonfac} is connected to
  584. the handling of monomial factors. A monomial factor is a product
  585. of variable powers as a factor, e.g. x**2*y in x**3*y -
  586. 2*x**2*y**2. A monomial factor represents a solution of the type
  587. x = 0 or y = 0 with a certain multiplicity. With
  588. \nameref{groebnerf} the multiplicity of monomial factors is lowered
  589. to the value of the shared variable \name{groebmonfac}
  590. which by default is 1 (= monomial factors remain present, but their
  591. multiplicity is brought down). With
  592. \name{groebmonfac}:= 0
  593. the monomial factors are suppressed completely.
  594. \end{Variable}
  595. % ----------------------------------------------------------------
  596. \begin{Variable}{groebresmax}
  597. The variable \name{groebresmax}
  598. controls during \nameref{groebnerf} calculations
  599. the number of partial results. Its default value is 300. If
  600. more partial results are calculated, the calculation is
  601. terminated.
  602. \end{Variable}
  603. % ----------------------------------------------------------------
  604. \begin{Variable}{groebrestriction}
  605. During \nameref{groebnerf} calculations
  606. irrelevant branches can be excluded
  607. by setting the variable \name{groebrestriction}. The
  608. following restrictions are implemented:
  609. \begin{Syntax}
  610. \name{groebrestriction} := \name{nonnegative} \\
  611. \name{groebrestriction} := \name{positive}\\
  612. \name{groebrestriction} := \name{zeropoint}
  613. \end{Syntax}
  614. With \name{nonnegative} branches are excluded where one
  615. polynomial has no nonnegative real zeros; with \name{positive}
  616. the restriction is sharpened to positive zeros only.
  617. The restriction \name{zeropoint} excludes all branches
  618. which do not have the origin (0,0,...0) in their solution
  619. set.
  620. \end{Variable}
  621. %---------------------------------------------------------
  622. \subsection{Tracing Groebner bases}
  623. %---------------------------------------------------------
  624. \index{tracing Groebner}
  625. \begin{Switch}{groebprot}
  626. If \name{groebprot} is \name{ON} the computation steps during
  627. \nameref{preduce}, \nameref{greduce} and \nameref{groebner}
  628. are collected in a list which is assigned to the variable
  629. \nameref{groebprotfile}.
  630. \end{Switch}
  631. %----------------------------------------------------------
  632. \begin{Variable}{groebprotfile}
  633. See \nameref{groebprot} switch.
  634. \end{Variable}
  635. %----------------------------------------------------------
  636. \begin{Operator}{groebnert}
  637. \begin{Syntax}
  638. \name{groebnert}\(\{\meta{v}=\meta{exp},...\}\)
  639. \end{Syntax}
  640. where \meta{v} are \nameref{kernel}\name{s} (simple or indexed variables),
  641. \meta{exp} are polynomials.
  642. \name{groebnert} is functionally equivalent to a \nameref{groebner}
  643. call for \{\meta{exp},...\}, but the result is a set of
  644. equations where the left-hand sides are the basis elements while
  645. the right-hand sides are the same values expressed as combinations
  646. of the input formulas, expressed in terms of the names \meta{v}
  647. \begin{Bigexample}
  648. groebnert({p1=2*x**2+4*y**2-100,p2=2*x-y+1});
  649. GB1 := {2*X - Y + 1=P2,
  650. 2
  651. 9*Y - 2*Y - 199= - 2*X*P2 - Y*P2 + 2*P1 + P2}
  652. \end{Bigexample}
  653. \end{Operator}
  654. %----------------------------------------------------------
  655. \begin{Operator}{preducet}
  656. \begin{Syntax}
  657. \name{preduce}\(\meta{p},\{\meta{v}=\meta{exp}...\}\)
  658. \end{Syntax}
  659. where \meta{p} is an expression, \meta{v} are kernels
  660. (simple or indexed variables),
  661. \name{exp} are polynomials.
  662. \name{preducet} computes the remainder of \meta{p} modulo \{\meta{exp},...\}
  663. similar to \nameref{preduce}, but the result is an equation
  664. which expresses the remainder as combination of the polynomials.
  665. \begin{Bigexample}
  666. GB2 := {G1=2*X - Y + 1,G2=9*Y**2 - 2*Y - 199}
  667. preducet(q=x**2,gb2);
  668. - 16*Y + 208= - 18*X*G1 - 9*Y*G1 + 36*Q + 9*G1 - G2
  669. \end{Bigexample}
  670. \end{Operator}
  671. %------------------------------------------------------------
  672. \subsection{Groebner Bases for Modules}
  673. %------------------------------------------------------------
  674. \begin{Concept}{Module}
  675. Given a polynomial ring, e.g. R=Z[x,y,...] and an integer n>1.
  676. The vectors with n elements of R form a free MODULE under
  677. elementwise addition and multiplication with elements of R.
  678. For a submodule given by a finite basis a Groebner basis
  679. can be computed, and the facilities of the GROEBNER package
  680. are available except the operators \nameref{groebnerf}
  681. and \name{groesolve}. The vectors are encoded using auxiliary
  682. variables which represent the unit vectors in the module.
  683. These are declared in the share variable \nameref{gmodule}.
  684. \end{Concept}
  685. \begin{Variable}{gmodule}
  686. The vectors of a free \nameref{module} over a polynomial ring R
  687. are encoded as linear combinations with unit vectors of
  688. M which are represented by auxiliary variables. These
  689. must be collected in the variable \name{gmodule} before
  690. any call to an operator of the Groebner package.
  691. \begin{verbatim}
  692. torder({x,y,v1,v2,v3})$
  693. gmodule := {v1,v2,v3}$
  694. g:=groebner({x^2*v1 + y*v2,x*y*v1 - v3,2y*v1 + y*v3});
  695. \end{verbatim}
  696. compute the Groebner basis of the submodule
  697. \begin{verbatim}
  698. ([x^2,y,0],[xy,0,-1],[0,2y,y])
  699. \end{verbatim}
  700. The members of the list \name{gmodule} are automatically
  701. appended to the end of the variable list, if they are not
  702. yet members there. They take part in the actual term ordering.
  703. \end{Variable}
  704. %------------------------------------------------------------
  705. \subsection{Computing with distributive polynomials}
  706. %------------------------------------------------------------
  707. \begin{Operator}{gsort}
  708. \index{distributive polynomials}
  709. \begin{Syntax}
  710. \name{gsort}\(\meta{p}\)
  711. \end{Syntax}
  712. where \meta{p} is a polynomial or a list of polynomials.
  713. The polynomials are reordered and sorted corresponding to
  714. the current \nameref{term order}.
  715. \begin{Examples}
  716. torder lex;\\
  717. gsort(x**2+2x*y+y**2,{y,x}); & {y**2+2y*x+x**2}
  718. \end{Examples}
  719. \end{Operator}
  720. %------------------------------------------------------------
  721. \begin{Operator}{gsplit}
  722. \index{distributive polynomials}
  723. \begin{Syntax}
  724. \name{gsplit}\(\meta{p}[,\meta{vars}]\);
  725. \end{Syntax}
  726. where \meta{p} is a polynomial or a list of polynomials.
  727. The polynomial is reordered corresponding to the
  728. the current \nameref{term order} and then
  729. separated into leading term and reductum. Result is
  730. a list with the leading term as first and the reductum
  731. as second element.
  732. \begin{Examples}
  733. torder lex;\\
  734. gsplit(x**2+2x*y+y**2,{y,x}); & \{y**2,2y*x+x**2\}
  735. \end{Examples}
  736. \end{Operator}
  737. %-------------------------------------------------------
  738. \begin{Operator}{gspoly}
  739. \index{distributive polynomials}
  740. \begin{Syntax}
  741. \name{gspoly}\(\meta{p1},\meta{p2}\);
  742. \end{Syntax}
  743. where \meta{p1} and \meta{p2} are polynomials.
  744. The \name{subtraction} polynomial of p1 and p2 is computed
  745. corresponding to the method of the Buchberger algorithm for
  746. computing \name{groebner bases}: p1 and p2 are multiplied
  747. with terms such that when subtracting them the leading terms
  748. cancel each other.
  749. \end{Operator}