pk-groeb.tex 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  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{Switch}{groebopt}
  282. If \name{groebopt} is set ON, the sequence of variables is optimized
  283. with respect to execution speed of \name{groebner} calculations;
  284. note that the final list of variables is available in \nameref{gvarslast}.
  285. By default \name{groebopt} is off, conserving the original variable
  286. sequence.
  287. An explicitly declared dependency using the \nameref{depend}
  288. declaration supersedes the variable optimization.
  289. \begin{Examples}
  290. depend a, x, y;
  291. \end{Examples}
  292. guarantees that a will be placed in front of x and y.
  293. \end{Switch}
  294. %-------------------------------------------------------
  295. \begin{Variable}{gvarslast}
  296. After a \nameref{groebner} or \nameref{groebnerf} calculation
  297. the actual variable sequence is stored in the variable
  298. \name{gvarslast}. If \nameref{groebopt} is \name{on}
  299. \name{gvarslast} shows the variable sequence after reordering.
  300. \end{Variable}
  301. %--------------------------------------------------------------
  302. \begin{Switch}{groebprereduce}
  303. If \name{groebprereduce} set ON, \nameref{groebner}
  304. and \nameref{groebnerf} try to simplify the
  305. input expressions: if the head term of an input expression is a
  306. multiple of the head term of another expression, it can be reduced;
  307. these reductions are done cyclicly as long as possible in order to
  308. shorten the main part of the algorithm.
  309. By default \name{groebprereduce} is off.
  310. \end{Switch}
  311. %---------------------------------------------------------------
  312. \begin{Switch}{groebfullreduction}
  313. If \name{groebfullreduction} set off, the polynomial reduction steps during
  314. \nameref{groebner} and \nameref{groebnerf} are limited to the pure head
  315. term reduction; subsequent terms are reduced otherwise.
  316. By default \name{groebfullreduction} is on.
  317. \end{Switch}
  318. %----------------------------------------------------------------
  319. \begin{Switch}{gltbasis}
  320. If \name{gltbasis} set on, the leading terms of the result basis
  321. of a \nameref{groebner} or \nameref{groebnerf} calculation are
  322. extracted. They are collected as a basis of monomials, which is
  323. available as value of the global variable \nameref{gltb}.
  324. \end{Switch}
  325. %------------------------------------------------------------------
  326. \begin{Variable}{gltb}
  327. See \nameref{gltbasis}
  328. \end{Variable}
  329. %------------------------------------------------------------------
  330. \begin{Variable}{glterms}
  331. If the expressions in a \nameref{groebner} or \nameref{groebnerf}
  332. call contain parameters (symbols
  333. which are not member of the variable list), the share variable
  334. \name{glterms} is set to a list of expression which during the
  335. calculation were assumed to be nonzero. The calculated bases
  336. are valid only under the assumption that all these expressions do
  337. not vanish.
  338. \end{Variable}
  339. %-----------------------------------------------------------
  340. \begin{Switch}{groebstat}
  341. if \name{groebstat} is on, a summary of the
  342. \nameref{groebner} or \nameref{groebnerf} computation is printed
  343. at the end
  344. including the computing time, the number of intermediate
  345. H polynomials and the counters for the criteria hits.
  346. \end{Switch}
  347. %-----------------------------------------------------------
  348. \begin{Switch}{trgroeb}
  349. if \name{trgroeb} is on, intermediate H polynomials are
  350. printed during a \nameref{groebner}
  351. or \nameref{groebnerf} calculation.
  352. \end{Switch}
  353. %-----------------------------------------------------------
  354. \begin{Switch}{trgroebs}
  355. if \name{trgroebs} is on, intermediate H and S polynomials are
  356. printed during a \nameref{groebner} or \nameref{groebnerf} calculation.
  357. \end{Switch}
  358. %-----------------------------------------------------------
  359. \begin{Operator}{gzerodim?}
  360. \begin{Syntax}
  361. \name{gzerodim!?}\(\meta{basis}\)
  362. \end{Syntax}
  363. where \meta{bas} is a Groebner basis in the current
  364. \nameref{term order} with the actual setting
  365. (see \nameref{ideal parameters}).
  366. \name{gzerodim!?} tests whether the ideal spanned by the given basis
  367. has dimension zero. If yes, the number of zeros is returned,
  368. \nameref{nil} otherwise.
  369. \end{Operator}
  370. %---------------------------------------------------------------
  371. \begin{Operator}{gdimension}
  372. \index{ideal dimension}\index{groebner}
  373. \begin{Syntax}
  374. \name{gdimension}\(\meta{bas}\)
  375. \end{Syntax}
  376. where \meta{bas} is a \nameref{groebner} basis in the current
  377. term order (see \nameref{ideal parameters}).
  378. \name{gdimension} computes the dimension of the ideal
  379. spanned by the given basis and returns the dimension as an integer
  380. number. The Kredel-Weispfenning algorithm is used: the dimension
  381. is the length of the longest independent variable set,
  382. see \nameref{gindependent\_sets}
  383. \end{Operator}
  384. %---------------------------------------------------------------
  385. \begin{Operator}{gindependent\_sets}
  386. \index{ideal variables}\index{ideal dimension}\index{groebner}
  387. \index{Kredel-Weispfenning algorithm}
  388. \begin{Syntax}
  389. \name{gindependent\_sets}\(\meta{bas}\)
  390. \end{Syntax}
  391. where \meta{bas} is a \nameref{groebner} basis in any \name{term order}
  392. (which must be the current \name{term order}) with the specified
  393. variables (see \nameref{ideal parameters}).
  394. \name{Gindependent_sets} computes the maximal
  395. left independent variable sets of the ideal, that are
  396. the variable sets which play the role of free parameters in the
  397. current ideal basis. Each set is a list which is a subset of the
  398. variable list. The result is a list of these sets. For an
  399. ideal with dimension zero the list is empty.
  400. The Kredel-Weispfenning algorithm is used.
  401. \end{Operator}
  402. %--------------------------------------------------------------
  403. \begin{Operator}{dd_groebner}
  404. For a homogeneous system of polynomials under
  405. \nameref{graded term order}, \nameref{gradlex term order},
  406. \nameref{revgradlex term order}
  407. or \nameref{weighted term order}
  408. a Groebner Base can be computed with limiting the grade
  409. of the intermediate S polynomials:
  410. \begin{Syntax}
  411. \name{dd_groebner}\(\meta{d1},\meta{d2},\meta{plist}\)
  412. \end{Syntax}
  413. where \meta{d1} is a non negative integer and \meta{d2} is an integer
  414. or ``infinity". A pair of polynomials is considered
  415. only if the grade of the lcm of their head terms is between
  416. \meta{d1} and \meta{d2}.
  417. For the term orders \name{graded} or \name{weighted} the (first) weight
  418. vector is used for the grade computation. Otherwise the total
  419. degree of a term is used.
  420. \end{Operator}
  421. %--------------------------------------------------------------
  422. \begin{Operator}{glexconvert}
  423. \index{ideal variables}\index{term order}
  424. \begin{Syntax}
  425. \name{glexconvert}\(\meta{bas}[,\meta{vars}][,MAXDEG=\meta{mx}]
  426. [,NEWVARS=\meta{nv}]\)
  427. \end{Syntax}
  428. where \meta{bas} is a \nameref{groebner} basis
  429. in the current term order, \meta{mx} (optional) is a positive
  430. integer and \meta{nvl} (optional) is a list of variables
  431. (see \nameref{ideal parameters}).
  432. The operator \name{glexconvert} converts the basis
  433. of a zero-dimensional ideal (finite number
  434. of isolated solutions) from arbitrary ordering into a basis under
  435. \nameref{lex term order}.
  436. The parameter \meta{newvars} defines the new variable sequence.
  437. If omitted, the
  438. original variable sequence is used. If only a subset of variables is
  439. specified here, the partial ideal basis is evaluated.
  440. If \meta{newvars} is a list with one element, the minimal
  441. \nameindex{univariate polynomial} is computed.
  442. \meta{maxdeg} is an upper limit for the degrees. The algorithm stops with
  443. an error message, if this limit is reached.
  444. A warning occurs, if the ideal is not zero dimensional.
  445. \begin{Comments}
  446. During the call the \name{term order} of the input basis must
  447. be active.
  448. \end{Comments}
  449. \end{Operator}
  450. %--------------------------------------------------------------
  451. \begin{Operator}{greduce}
  452. \begin{Syntax}
  453. \name{greduce}\(exp, \{exp1, exp2, \ldots , expm\}\)
  454. \end{Syntax}
  455. where exp is an expression, and \{exp1, exp2, ... , expm\} is
  456. a list of expressions or equations.
  457. \name{greduce} is functionally equivalent with a call to
  458. \nameref{groebner} and then a call to \nameref{preduce}.
  459. \end{Operator}
  460. %---------------------------------------------------------
  461. \begin{Operator}{preduce}
  462. \begin{Syntax}
  463. \name{preduce}\(\meta{p}, \{\meta{exp}, \ldots \}\)
  464. \end{Syntax}
  465. where \meta{p} is an expression, and \{\meta{exp}, ... \} is
  466. a list of expressions or equations.
  467. \name{preduce} computes the remainder of \name{exp}
  468. modulo the given set of polynomials resp. equations.
  469. This result is unique (canonical) only if the given set
  470. is a \name{groebner} basis under the current \nameref{term order}
  471. see also: \nameref{preducet} operator.
  472. \end{Operator}
  473. %-------------------------------------------
  474. \begin{Operator}{idealquotient}
  475. \begin{Syntax}
  476. \name{idealquotient}\(\{\meta{exp}, ...\}, \meta{d}\)
  477. \end{Syntax}
  478. where \{\meta{exp},...\} is a list of
  479. expressions or equations, \meta{d} is a single expression or equation.
  480. \name{idealquotient} computes the ideal quotient:
  481. ideal spanned by the expressions \{\meta{exp},...\}
  482. divided by the single polynomial/expression \meta{f}. The result
  483. is the \nameref{groebner} basis of the quotient ideal.
  484. \end{Operator}
  485. %-------------------------------------------------------------
  486. \begin{Operator}{hilbertpolynomial}
  487. \index{Hollmann algorithm}
  488. \begin{Syntax}
  489. hilbertpolynomial\(\meta{bas}\)
  490. \end{Syntax}
  491. where \meta{bas} is a \nameref{groebner} basis in the
  492. current \nameref{term order}.
  493. The degree of the \name{Hilbert polynomial} is the
  494. dimension of the ideal spanned by the basis. For an
  495. ideal of dimension zero the Hilbert polynomial is a
  496. constant which is the number of common zeros of the
  497. ideal (including eventual multiplicities).
  498. The \name{Hollmann algorithm} is used.
  499. \end{Operator}
  500. %-------------------------------------------------------------
  501. \subsection{Factorizing Groebner bases}
  502. %-------------------------------------------------------------
  503. \begin{Operator}{groebnerf}
  504. \begin{Syntax}
  505. \name{groebnerf}\(\{\meta{exp}, ...\}[,\{\},\{\meta{nz}, ... \}]\);
  506. \end{Syntax}
  507. where \{\meta{exp}, ... \} is a list of expressions or
  508. equations, and \{\meta{nz},... \} is
  509. an optional list of polynomials to be considered as non zero
  510. for this calculation. An empty list must be passed as second argument
  511. if the non-zero list is specified.
  512. \name{groebnerf} tries to separate polynomials into individual factors and
  513. to branch the computation in a recursive manner (factorization tree).
  514. The result is a list of partial Groebner bases.
  515. Multiplicities (one factor with a higher power, the same partial basis
  516. twice) are deleted as early as possible in order to speed up the
  517. calculation.
  518. The third parameter of \name{groebnerf} declares some polynomials
  519. nonzero. If any of these is found in a branch of the calculation
  520. the branch is canceled.
  521. \begin{Bigexample}
  522. groebnerf({ 3*x**2*y+2*x*y+y+9*x**2+5*x = 3,
  523. 2*x**3*y-x*y-y+6*x**3-2*x**2-3*x = -3,
  524. x**3*y+x**2*y+3*x**3+2*x**2 }, {y,x});
  525. {{Y - 3,X},
  526. 2
  527. {2*Y + 2*X - 1,2*X - 5*X - 5}}
  528. \end{Bigexample}
  529. \begin{Related}
  530. \item[ \nameref{groebresmax} variable]
  531. \item[ \nameref{groebmonfac} variable]
  532. \item[ \nameref{groebrestriction} variable]
  533. \item[ \nameref{groebner} operator]
  534. \item[ \nameref{gvarslast} variable]
  535. \item[ \nameref{groebopt} switch]
  536. \item[ \nameref{groebprereduce} switch]
  537. \item[ \nameref{groebfullreduction} switch]
  538. \item[ \nameref{gltbasis} switch]
  539. \item[ \nameref{gltb} variable]
  540. \item[ \nameref{glterms} variable]
  541. \item[ \nameref{groebstat} switch]
  542. \item[ \nameref{trgroeb} switch]
  543. \item[ \nameref{trgroebs} switch]
  544. \item[ \nameref{groebnert} operator]
  545. \end{Related}
  546. \end{Operator}
  547. % ------------------------------------------------------------------
  548. \begin{Variable}{groebmonfac}
  549. The variable \name{groebmonfac} is connected to
  550. the handling of monomial factors. A monomial factor is a product
  551. of variable powers as a factor, e.g. x**2*y in x**3*y -
  552. 2*x**2*y**2. A monomial factor represents a solution of the type
  553. x = 0 or y = 0 with a certain multiplicity. With
  554. \nameref{groebnerf} the multiplicity of monomial factors is lowered
  555. to the value of the shared variable \name{groebmonfac}
  556. which by default is 1 (= monomial factors remain present, but their
  557. multiplicity is brought down). With
  558. \name{groebmonfac}:= 0
  559. the monomial factors are suppressed completely.
  560. \end{Variable}
  561. % ----------------------------------------------------------------
  562. \begin{Variable}{groebresmax}
  563. The variable \name{groebresmax}
  564. controls during \nameref{groebnerf} calculations
  565. the number of partial results. Its default value is 300. If
  566. more partial results are calculated, the calculation is
  567. terminated.
  568. \end{Variable}
  569. % ----------------------------------------------------------------
  570. \begin{Variable}{groebrestriction}
  571. During \nameref{groebnerf} calculations
  572. irrelevant branches can be excluded
  573. by setting the variable \name{groebrestriction}. The
  574. following restrictions are implemented:
  575. \begin{Syntax}
  576. \name{groebrestriction} := \name{nonnegative} \\
  577. \name{groebrestriction} := \name{positive}\\
  578. \name{groebrestriction} := \name{zeropoint}
  579. \end{Syntax}
  580. With \name{nonnegative} branches are excluded where one
  581. polynomial has no nonnegative real zeros; with \name{positive}
  582. the restriction is sharpened to positive zeros only.
  583. The restriction \name{zeropoint} excludes all branches
  584. which do not have the origin (0,0,...0) in their solution
  585. set.
  586. \end{Variable}
  587. %---------------------------------------------------------
  588. \subsection{Tracing Groebner bases}
  589. %---------------------------------------------------------
  590. \index{tracing Groebner}
  591. \begin{Switch}{groebprot}
  592. If \name{groebprot} is \name{ON} the computation steps during
  593. \nameref{preduce}, \nameref{greduce} and \nameref{groebner}
  594. are collected in a list which is assigned to the variable
  595. \nameref{groebprotfile}.
  596. \end{Switch}
  597. %----------------------------------------------------------
  598. \begin{Variable}{groebprotfile}
  599. See \nameref{groebprot} switch.
  600. \end{Variable}
  601. %----------------------------------------------------------
  602. \begin{Operator}{groebnert}
  603. \begin{Syntax}
  604. \name{groebnert}\(\{\meta{v}=\meta{exp},...\}\)
  605. \end{Syntax}
  606. where \meta{v} are \nameref{kernel}\name{s} (simple or indexed variables),
  607. \meta{exp} are polynomials.
  608. \name{groebnert} is functionally equivalent to a \nameref{groebner}
  609. call for \{\meta{exp},...\}, but the result is a set of
  610. equations where the left-hand sides are the basis elements while
  611. the right-hand sides are the same values expressed as combinations
  612. of the input formulas, expressed in terms of the names \meta{v}
  613. \begin{Bigexample}
  614. groebnert({p1=2*x**2+4*y**2-100,p2=2*x-y+1});
  615. GB1 := {2*X - Y + 1=P2,
  616. 2
  617. 9*Y - 2*Y - 199= - 2*X*P2 - Y*P2 + 2*P1 + P2}
  618. \end{Bigexample}
  619. \end{Operator}
  620. %----------------------------------------------------------
  621. \begin{Operator}{preducet}
  622. \begin{Syntax}
  623. \name{preduce}\(\meta{p},\{\meta{v}=\meta{exp}...\}\)
  624. \end{Syntax}
  625. where \meta{p} is an expression, \meta{v} are kernels
  626. (simple or indexed variables),
  627. \name{exp} are polynomials.
  628. \name{preducet} computes the remainder of \meta{p} modulo \{\meta{exp},...\}
  629. similar to \nameref{preduce}, but the result is an equation
  630. which expresses the remainder as combination of the polynomials.
  631. \begin{Bigexample}
  632. GB2 := {G1=2*X - Y + 1,G2=9*Y**2 - 2*Y - 199}
  633. preducet(q=x**2,gb2);
  634. - 16*Y + 208= - 18*X*G1 - 9*Y*G1 + 36*Q + 9*G1 - G2
  635. \end{Bigexample}
  636. \end{Operator}
  637. %------------------------------------------------------------
  638. \subsection{Groebner Bases for Modules}
  639. %------------------------------------------------------------
  640. \begin{Concept}{Module}
  641. Given a polynomial ring, e.g. R=Z[x,y,...] and an integer n>1.
  642. The vectors with n elements of R form a free MODULE under
  643. elementwise addition and multiplication with elements of R.
  644. For a submodule given by a finite basis a Groebner basis
  645. can be computed, and the facilities of the GROEBNER package
  646. are available except the operators \nameref{groebnerf}
  647. and \name{groesolve}. The vectors are encoded using auxiliary
  648. variables which represent the unit vectors in the module.
  649. These are declared in the share variable \nameref{gmodule}.
  650. \end{Concept}
  651. \begin{Variable}{gmodule}
  652. The vectors of a free \nameref{module} over a polynomial ring R
  653. are encoded as linear combinations with unit vectors of
  654. M which are represented by auxiliary variables. These
  655. must be collected in the variable \name{gmodule} before
  656. any call to an operator of the Groebner package.
  657. \begin{verbatim}
  658. torder({x,y,v1,v2,v3})$
  659. gmodule := {v1,v2,v3}$
  660. g:=groebner({x^2*v1 + y*v2,x*y*v1 - v3,2y*v1 + y*v3});
  661. \end{verbatim}
  662. compute the Groebner basis of the submodule
  663. \begin{verbatim}
  664. ([x^2,y,0],[xy,0,-1],[0,2y,y])
  665. \end{verbatim}
  666. The members of the list \name{gmodule} are automatically
  667. appended to the end of the variable list, if they are not
  668. yet members there. They take part in the actual term ordering.
  669. \end{Variable}
  670. %------------------------------------------------------------
  671. \subsection{Computing with distributive polynomials}
  672. %------------------------------------------------------------
  673. \begin{Operator}{gsort}
  674. \index{distributive polynomials}
  675. \begin{Syntax}
  676. \name{gsort}\(\meta{p}\)
  677. \end{Syntax}
  678. where \meta{p} is a polynomial or a list of polynomials.
  679. The polynomials are reordered and sorted corresponding to
  680. the current \nameref{term order}.
  681. \begin{Examples}
  682. torder lex;\\
  683. gsort(x**2+2x*y+y**2,{y,x}); & {y**2+2y*x+x**2}
  684. \end{Examples}
  685. \end{Operator}
  686. %------------------------------------------------------------
  687. \begin{Operator}{gsplit}
  688. \index{distributive polynomials}
  689. \begin{Syntax}
  690. \name{gsplit}\(\meta{p}[,\meta{vars}]\);
  691. \end{Syntax}
  692. where \meta{p} is a polynomial or a list of polynomials.
  693. The polynomial is reordered corresponding to the
  694. the current \nameref{term order} and then
  695. separated into leading term and reductum. Result is
  696. a list with the leading term as first and the reductum
  697. as second element.
  698. \begin{Examples}
  699. torder lex;\\
  700. gsplit(x**2+2x*y+y**2,{y,x}); & \{y**2,2y*x+x**2\}
  701. \end{Examples}
  702. \end{Operator}
  703. %-------------------------------------------------------
  704. \begin{Operator}{gspoly}
  705. \index{distributive polynomials}
  706. \begin{Syntax}
  707. \name{gspoly}\(\meta{p1},\meta{p2}\);
  708. \end{Syntax}
  709. where \meta{p1} and \meta{p2} are polynomials.
  710. The \name{subtraction} polynomial of p1 and p2 is computed
  711. corresponding to the method of the Buchberger algorithm for
  712. computing \name{groebner bases}: p1 and p2 are multiplied
  713. with terms such that when subtracting them the leading terms
  714. cancel each other.
  715. \end{Operator}