NCPOLY.TEX 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. \documentstyle[11pt,reduce]{article}
  2. \title{NCPOLY: Computation in non--commutative polynomial ideals}
  3. \date{}
  4. \author{
  5. Herbert Melenk\\[0.05in]
  6. Konrad--Zuse--Zentrum f\"ur Informationstechnik Berlin \\
  7. Heilbronner Strasse 10 \\
  8. D--10711 Berlin -- Wilmersdorf \\
  9. Federal Republic of Germany \\[0.05in]
  10. E--mail: melenk@zib--berlin.de \\[0.1in]
  11. Joachim Apel\\[0.05in]
  12. Institut f\"ur Informatik \\[0.05in]
  13. Universit\"at Leipzig \\[0.05in]
  14. Augustusplatz 10--11\\[0.05in]
  15. D--04109 Leipzig \\[0.05in]
  16. Federal Republic of Germany \\[0.05in]
  17. E--mail: apel@informatik.uni--leipzig.de \\[0.05in]
  18. }
  19. \begin{document}
  20. \maketitle
  21. \index{Groebner Bases}
  22. \section{Introduction}
  23. {\small REDUCE} supports a very general mechanism for computing
  24. with objects under a non--commutative multiplication, where
  25. commutator relations must be introduced explicitly by rule
  26. sets when needed. The package {\bf NCPOLY} allows you to
  27. set up automatically a consistent environment for computing in an algebra
  28. where the non--commutativity is defined by Lie-bracket commutators.
  29. The package uses the {\small REDUCE} {\bf noncom}
  30. mechanism for elementary polynomial arithmetic; the commutator
  31. rules are automatically computed from the Lie brackets.
  32. You can perform polynomial arithmetic directly, including
  33. {\bf division} and {\bf factorization}.
  34. Additionally {\bf NCPOLY} supports computations in a one sided ideal (left or right),
  35. especially one sided {\bf Gr\"obner} bases and {\bf polynomial reduction}.
  36. \section{Setup, Cleanup}
  37. Before the computations can start the environment for a
  38. non--commutative computation must be defined by a
  39. call to {\bf nc\_setup}:
  40. \begin{verbatim}
  41. nc_setup(<vars>[,<comms>][,<dir>]);
  42. \end{verbatim}
  43. where
  44. $<vars>$ is a list of variables; these must include the
  45. non--commutative quantities.
  46. $<comms>$ is a list of equations \verb&<u>*<v> - <v>*<u>=<rh>&
  47. where $<u>$ and $<v>$ are members of $<vars>$, and $<rh>$ is
  48. a polynomial.
  49. $<dir>$ is either $left$ or $right$ selecting a left or a
  50. right one sided ideal. The initial direction is $left$.
  51. {\bf nc\_setup} generates from $<comms>$ the necessary
  52. rules to support an algebra where all monomials are
  53. ordered corresponding to the given variable sequence.
  54. All pairs of variables which are not explicitly covered in
  55. the commutator set are considered as commutative and the
  56. corresponding rules are also activated.
  57. The second parameter in {\bf nc\_setup} may be
  58. omitted if the operator is called for the second time,
  59. e.g. with a reordered variable sequence. In such a case
  60. the last commutator set is used again.
  61. Remarks: \begin{itemize}
  62. \item The variables need not be declared {\bf noncom} -
  63. {\bf nc\_setup} performs all necessary declarations.
  64. \item The variables need not be formal operator expressions;
  65. {\bf nc\_setup} encapsulates a variable $x$ internally
  66. as \verb+nc!*(!_x)+ expressions anyway where the operator $nc!*$
  67. keeps the noncom property.
  68. \item The commands {\bf order} and {\bf korder} should be avoided
  69. because {\bf nc\_setup} sets these such that the computation
  70. results are printed in the correct term order.
  71. \end{itemize}
  72. Example:
  73. \begin {verbatim}
  74. nc_setup({KK,NN,k,n},
  75. {NN*n-n*NN= NN, KK*k-k*KK= KK});
  76. NN*n; -> NN*n
  77. n*NN; -> NN*n - NN
  78. nc_setup({k,n,KK,NN});
  79. NN*n - NN -> n*NN;
  80. \end{verbatim}
  81. Here $KK,NN,k,n$ are non--commutative variables where
  82. the commutators are described as $[NN,n]=NN$, $[KK,k]=KK$.
  83. The current term order must be compatible with the commutators:
  84. the product $<u>*<v>$ must precede all terms on the right hand
  85. side $<rh>$ under the current term order. Consequently
  86. \begin{itemize}
  87. \item the maximal degree of $<u>$ or $<v>$ in $<rh>$ is 1,
  88. \item in a total degree ordering the total degree of $<rh>$ may be
  89. not higher than 1,
  90. \item in an elimination degree order (e.g. $lex$) all variables in
  91. $<rh>$ must be below the minimum of $<u>$ and $<v>$.
  92. \item If $<rh>$ does not contain any variables or has at most $<u>$ or
  93. $<v>$, any term order can be selected.
  94. \end{itemize}
  95. If you want to use the non--commutative variables or results from
  96. non--commutative computations later in commutative operations
  97. it might be necessary to switch off the non--commutative
  98. evaluation mode because not
  99. all operators in REDUCE are prepared for that environment. In
  100. such a case use the command
  101. \begin{verbatim}
  102. nc_cleanup;
  103. \end{verbatim}
  104. without parameters. It removes all internal rules and definitions
  105. which {\bf nc\_setup} had introduced. To reactive non--commutative
  106. call {\bf nc\_setup} again.
  107. \section{Left and right ideals}
  108. A (polynomial) left ideal $L$ is defined by the axioms
  109. $u \in L, v \in L \Longrightarrow u+v \in L$
  110. $u \in L \Longrightarrow k*u \in L$ for an arbitrary polynomial $k$
  111. where ``*'' is the non--commutative multiplication. Correspondingly,
  112. a right ideal $R$ is defined by
  113. $u \in R, v \in R \Longrightarrow u+v \in R$
  114. $u \in R \Longrightarrow u*k \in R$ for an arbitrary polynomial $k$
  115. \section{Gr\"obner bases}
  116. When a non--commutative environment has been set up
  117. by {\bf nc\_setup}, a basis for a left or right polynomial ideal
  118. can be transformed into a Gr\"obner basis by the operator
  119. {\bf nc\_groebner}:
  120. \begin{verbatim}
  121. nc_groebner(<plist>);
  122. \end{verbatim}
  123. Note that the variable set and variable sequence must be
  124. defined before in the {\bf nc\_setup} call. The term order
  125. for the Gr\"obner calculation can be set by using the
  126. {\bf torder} declaration. The internal steps of the
  127. Gr\"obner calculation can be watched by setting the
  128. switches {\bf trgroeb} (=list all internal basis polynomials)
  129. or {\bf trgroebs} (=list additionally the $S$-polynomials)
  130. \footnote{The command \verb+lisp(!*trgroebfull:=t);+ causes additionally
  131. all elementary polynomial operations to be printed.}.
  132. For details about {\bf torder}, {\bf trgroeb} and {\bf trgroebs}
  133. see the {\bf {\small REDUCE} GROEBNER} manual.
  134. \begin{verbatim}
  135. 2: nc_setup({k,n,NN,KK},{NN*n-n*NN=NN,KK*k-k*KK=KK},left);
  136. 3: p1 := (n-k+1)*NN - (n+1);
  137. p1 := - k*nn + n*nn - n + nn - 1
  138. 4: p2 := (k+1)*KK -(n-k);
  139. p2 := k*kk + k - n + kk
  140. 5: nc_groebner ({p1,p2});
  141. {k*nn - n*nn + n - nn + 1,
  142. k*kk + k - n + kk,
  143. n*nn*kk - n*kk - n + nn*kk - kk - 1}
  144. \end{verbatim}
  145. Important: Do not use the operators of the GROEBNER
  146. package directly as they would not consider the non--commutative
  147. multiplication.
  148. \section{Left or right polynomial division}
  149. The operator {\bf nc\_divide} computes the one sided quotient and remainder of
  150. two polynomials:
  151. \begin{verbatim}
  152. nc_divide(<p1>,<p2>);
  153. \end{verbatim}
  154. The result is a list with quotient and remainder.
  155. The division is performed as a pseudo--division, multiplying
  156. $<p1>$ by coefficients if necessary. The result $\{<q>,<r>\}$
  157. is defined by the relation
  158. $<c>*<p1>=<q>*<p2> + <r>$ for direction $left$ and
  159. $<c>*<p1>=<p2>*<q> + <r>$ for direction $right$,
  160. where $<c>$ is an expression that does not contain any of the
  161. ideal variables, and the leading term of $<r>$ is lower than
  162. the leading term of $<p2>$ according to the actual term order.
  163. \section{Left or right polynomial reduction}
  164. For the computation of the one sided remainder of a polynomial
  165. modulo a given set of other polynomials the operator
  166. {\bf nc\_preduce} may be used:
  167. \begin{verbatim}
  168. nc_preduce(<polynomial>,<plist>);
  169. \end{verbatim}
  170. The result of the reduction is unique (canonical) if
  171. and only if $<plist>$ is a one sided Gr\"obner basis.
  172. Then the computation is at the same time an ideal
  173. membership test: if the result is zero, the
  174. polynomial is member of the ideal, otherwise not.
  175. \section{Factorization}
  176. Polynomials in a non--commutative ring cannot be factored
  177. using the ordinary {\bf factorize} command of {\small REDUCE}.
  178. Instead one of the operators of this section must be used:
  179. \begin{verbatim}
  180. nc_factorize(<polynomial>);
  181. \end{verbatim}
  182. The result is a list of factors of $<polynomial>$. A list
  183. with the input expression is returned if it is irreducible.
  184. As non--commutative factorization is not unique, there is
  185. an additional operator which computes all possible factorizations
  186. \begin{verbatim}
  187. nc_factorize_all(<polynomial>);
  188. \end{verbatim}
  189. The result is a list of factor decompositions of $<polynomial>$.
  190. If there are no factors at all the result list has only one
  191. member which is a list containing the input polynomial.
  192. In contrast to factoring in commutative polynomial rings, the non--commutative
  193. factorization is rather time consuming. Therefore two additional
  194. operators allow you to reduce the amount of computing time when
  195. you look only for isolated factors in special context, e.g. factors
  196. with a limited degree or factors which contain only explicitly
  197. specified variables:
  198. \begin{verbatim}
  199. left_factor(<polynomial>[,<deg>[,<vars>]])
  200. right_factor(<polynomial>[,<deg>[,<vars>]])
  201. left_factors(<polynomial>[,<deg>[,<vars>]])
  202. right_factors(<polynomial>[,<deg>[,<vars>]])
  203. \end{verbatim}
  204. where $<polynomial>$ is the form under investigation,
  205. $<vars>$ is an optional list of variables which must appear in the
  206. factor, and $<deg>$
  207. is an optional integer degree bound for the total degree of the
  208. factor, a zero for an unbounded search, or a monomial
  209. (product of powers of the variables) where each exponent
  210. is an individual degree bound for its base variable; unmentioned
  211. variables are allowed in arbitrary degree. The operators
  212. $*\_factor$ stop when they have found one factor, while
  213. the operators $*\_factors$ select all one--sided factors
  214. within the given range. If there is no factor of the
  215. desired type, an empty list is returned by $*\_factors$
  216. while the routines $*\_factor$ return the input polynomial.
  217. The share variable $nc\_factor\_time$ sets an upper limit
  218. for the time to be spent for a call to the non--commutative
  219. factorizer. If the value is a positive integer, a
  220. factorization is terminated with an error message as soon
  221. as the time limit is reached. The time units are milliseconds.
  222. \section{Output of expressions}
  223. It is often desirable to have the commutative parts (coefficients)
  224. in a non--commutative operation condensed by factorization. The operator
  225. \begin{verbatim}
  226. nc_compact(<polynomial>)
  227. \end{verbatim}
  228. collects the coefficients to the powers of the lowest possible
  229. non-commutative variable.
  230. \begin{verbatim}
  231. load ncpoly;
  232. nc_setup({n,NN},{NN*n-n*NN=NN})$
  233. p1 := n**4 + n**2*nn + 4*n**2 + 4*n*nn + 4*nn + 4;
  234. 4 2 2
  235. p1 := n + n *nn + 4*n + 4*n*nn + 4*nn + 4
  236. nc_compact p1;
  237. 2 2 2
  238. (n + 2) + (n + 2) *nn
  239. \end{verbatim}
  240. \end{document}