ncpoly.tex 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. \chapter[NCPOLY: Ideals in non--comm case]%
  2. {NCPOLY: Non--commutative polynomial ideals}
  3. \label{NCPOLY}
  4. \typeout{{NCPOLY: Non--commutative polynomial ideals}}
  5. {\footnotesize
  6. \begin{center}
  7. Herbert Melenk\\
  8. Konrad--Zuse--Zentrum f\"ur Informationstechnik Berlin \\
  9. Takustra\"se 7 \\
  10. D--14195 Berlin--Dahlem, Germany \\[0.05in]
  11. e--mail: melenk@zib.de \\[0.1in]
  12. Joachim Apel\\
  13. Institut f\"ur Informatik, Universit\"at Leipzig \\
  14. Augustusplatz 10--11\\
  15. D--04109 Leipzig, Germany \\[0.05in]
  16. e--mail: apel@informatik.uni--leipzig.de
  17. \end{center}
  18. }
  19. \ttindex{NCPOLY}\index{Groebner Bases}
  20. \REDUCE\ supports a very general mechanism for computing with objects
  21. under a non--commutative multiplication, where commutator relations
  22. must be introduced explicitly by rule sets when needed. The package
  23. {\bf NCPOLY} allows the user to set up automatically a consistent
  24. environment for computing in an algebra where the non--commutativity
  25. is defined by Lie-bracket commutators. The package uses the \REDUCE\
  26. {\bf noncom} mechanism for elementary polynomial arithmetic; the
  27. commutator rules are automatically computed from the Lie brackets.
  28. Polynomial arithmetic may be performed directly, including {\bf
  29. division} and {\bf factorisation}. Additionally {\bf NCPOLY} supports
  30. computations in a one sided ideal (left or right), especially one
  31. sided {\bf Gr\"obner} bases and {\bf polynomial reduction}.
  32. \section{Setup, Cleanup}
  33. Before the computations can start the environment for a
  34. non--commutative computation must be defined by a
  35. call to {\tt nc\_setup}:\ttindex{nc\_setup}
  36. \begin{verbatim}
  37. nc_setup(<vars>[,<comms>][,<dir>]);
  38. \end{verbatim}
  39. where
  40. $<vars>$ is a list of variables; these must include the
  41. non--commutative quantities.
  42. $<comms>$ is a list of equations \verb&<u>*<v> - <v>*<u>=<rh>&
  43. where $<u>$ and $<v>$ are members of $<vars>$, and $<rh>$ is
  44. a polynomial.
  45. $<dir>$ is either $left$ or $right$ selecting a left or a
  46. right one sided ideal. The initial direction is $left$.
  47. {\tt nc\_setup} generates from $<comms>$ the necessary
  48. rules to support an algebra where all monomials are
  49. ordered corresponding to the given variable sequence.
  50. All pairs of variables which are not explicitly covered in
  51. the commutator set are considered as commutative and the
  52. corresponding rules are also activated.
  53. The second parameter in {\tt nc\_setup} may be
  54. omitted if the operator is called for the second time,
  55. {\em e.g.\ } with a reordered variable sequence. In such a case
  56. the last commutator set is used again.
  57. Remarks: \begin{itemize}
  58. \item The variables need not be declared {\bf noncom} -
  59. {\bf nc\_setup} performs all necessary declarations.
  60. \item The variables need not be formal operator expressions;
  61. {\bf nc\_setup} encapsulates a variable $x$ internally
  62. as \verb+nc!*(!_x)+ expressions anyway where the operator $nc!*$
  63. keeps the noncom property.
  64. \item The commands {\bf order} and {\bf korder} should be avoided
  65. because {\bf nc\_setup} sets these such that the computation
  66. results are printed in the correct term order.
  67. \end{itemize}
  68. Example:
  69. \begin{verbatim}
  70. nc_setup({KK,NN,k,n},
  71. {NN*n-n*NN= NN, KK*k-k*KK= KK});
  72. NN*N; -> NN*N
  73. N*NN; -> NN*N - NN
  74. nc_setup({k,n,KK,NN});
  75. NN*N - NN -> N*NN;
  76. \end{verbatim}
  77. Here $KK,NN,k,n$ are non--commutative variables where
  78. the commutators are described as $[NN,n]=NN$, $[KK,k]=KK$.
  79. The current term order must be compatible with the commutators:
  80. the product $<u>*<v>$ must precede all terms on the right hand
  81. side $<rh>$ under the current term order. Consequently
  82. \begin{itemize}
  83. \item the maximal degree of $<u>$ or $<v>$ in $<rh>$ is 1,
  84. \item in a total degree ordering the total degree of $<rh>$ may be not
  85. higher than 1,
  86. \item in an elimination degree order ({\em e.g.\ }$lex$) all variables in
  87. $<rh>$ must be below the minimum of $<u>$ and $<v>$.
  88. \item If $<rh>$ does not contain any variables or has at most $<u>$ or
  89. $<v>$, any term order can be selected.
  90. \end{itemize}
  91. To use the non--commutative variables or results from
  92. non--commutative computations later in commutative operations
  93. it might be necessary to switch off the non--commutative
  94. evaluation mode because not
  95. all operators in \REDUCE\ are prepared for that environment. In
  96. such a case use the command\ttindex{nc\_cleanup}
  97. \begin{verbatim}
  98. nc_cleanup;
  99. \end{verbatim}
  100. without parameters. It removes all internal rules and definitions
  101. which {\tt nc\_setup} had introduced. To reactive non--commutative
  102. call {\tt nc\_setup} again.
  103. \section{Left and right ideals}
  104. A (polynomial) left ideal $L$ is defined by the axioms
  105. $u \in L, v \in L \Longrightarrow u+v \in L$
  106. $u \in L \Longrightarrow k*u \in L$ for an arbitrary polynomial $k$
  107. where ``*'' is the non--commutative multiplication. Correspondingly,
  108. a right ideal $R$ is defined by
  109. $u \in R, v \in R \Longrightarrow u+v \in R$
  110. $u \in R \Longrightarrow u*k \in R$ for an arbitrary polynomial $k$
  111. \section{Gr\"obner bases}
  112. When a non--commutative environment has been set up
  113. by {\tt nc\_setup}, a basis for a left or right polynomial ideal
  114. can be transformed into a Gr\"obner basis by the operator
  115. {\tt nc\_groebner}\ttindex{nc\_groebner}
  116. \begin{verbatim}
  117. nc_groebner(<plist>);
  118. \end{verbatim}
  119. Note that the variable set and variable sequence must be
  120. defined before in the {\tt nc\_setup} call. The term order
  121. for the Gr\"obner calculation can be set by using the
  122. {\tt torder} declaration.
  123. For details about {\tt torder}
  124. see the {\bf \REDUCE\ GROEBNER} manual, or chapter~\ref{GROEBNER}.
  125. \begin{verbatim}
  126. 2: nc_setup({k,n,NN,KK},{NN*n-n*NN=NN,KK*k-k*KK=KK},left);
  127. 3: p1 := (n-k+1)*NN - (n+1);
  128. p1 := - k*nn + n*nn - n + nn - 1
  129. 4: p2 := (k+1)*KK -(n-k);
  130. p2 := k*kk + k - n + kk
  131. 5: nc_groebner ({p1,p2});
  132. {k*nn - n*nn + n - nn + 1,
  133. k*kk + k - n + kk,
  134. n*nn*kk - n*kk - n + nn*kk - kk - 1}
  135. \end{verbatim}
  136. Important: Do not use the operators of the GROEBNER
  137. package directly as they would not consider the non--commutative
  138. multiplication.
  139. \section{Left or right polynomial division}
  140. The operator {\tt nc\_divide}\ttindex{nc\_divide} computes the one
  141. sided quotient and remainder of two polynomials:
  142. \begin{verbatim}
  143. nc_divide(<p1>,<p2>);
  144. \end{verbatim}
  145. The result is a list with quotient and remainder.
  146. The division is performed as a pseudo--division, multiplying
  147. $<p1>$ by coefficients if necessary. The result $\{<q>,<r>\}$
  148. is defined by the relation
  149. $<c>*<p1>=<q>*<p2> + <r>$ for direction $left$ and
  150. $<c>*<p1>=<p2>*<q> + <r>$ for direction $right$,
  151. where $<c>$ is an expression that does not contain any of the
  152. ideal variables, and the leading term of $<r>$ is lower than
  153. the leading term of $<p2>$ according to the actual term order.
  154. \section{Left or right polynomial reduction}
  155. For the computation of the one sided remainder of a polynomial
  156. modulo a given set of other polynomials the operator
  157. {\tt nc\_preduce} may be used:\ttindex{nc\_preduce}
  158. \begin{verbatim}
  159. nc_preduce(<polynomial>,<plist>);
  160. \end{verbatim}
  161. The result of the reduction is unique (canonical) if
  162. and only if $<plist>$ is a one sided Gr\"obner basis.
  163. Then the computation is at the same time an ideal
  164. membership test: if the result is zero, the
  165. polynomial is member of the ideal, otherwise not.
  166. \section{Factorisation}
  167. Polynomials in a non--commutative ring cannot be factored
  168. using the ordinary {\tt factorize} command of \REDUCE.
  169. Instead one of the operators of this section must be
  170. used:\ttindex{nc\_factorize}
  171. \begin{verbatim}
  172. nc_factorize(<polynomial>);
  173. \end{verbatim}
  174. The result is a list of factors of $<polynomial>$. A list
  175. with the input expression is returned if it is irreducible.
  176. As non--commutative factorisation is not unique, there is
  177. an additional operator which computes all possible
  178. factorisations\ttindex{nc\_factorize\_all}
  179. \begin{verbatim}
  180. nc_factorize_all(<polynomial>);
  181. \end{verbatim}
  182. The result is a list of factor decompositions of $<polynomial>$.
  183. If there are no factors at all the result list has only one
  184. member which is a list containing the input polynomial.
  185. \section{Output of expressions}
  186. It is often desirable to have the commutative parts (coefficients)
  187. in a non--commutative operation condensed by factorisation. The
  188. operator\ttindex{nc\_compact}
  189. \begin{verbatim}
  190. nc_compact(<polynomial>)
  191. \end{verbatim}
  192. collects the coefficients to the powers of the lowest possible
  193. non-commutative variable.
  194. \begin{verbatim}
  195. load_package ncpoly;
  196. nc_setup({n,NN},{NN*n-n*NN=NN})$
  197. p1 := n**4 + n**2*nn + 4*n**2 + 4*n*nn + 4*nn + 4;
  198. 4 2 2
  199. p1 := n + n *nn + 4*n + 4*n*nn + 4*nn + 4
  200. nc_compact p1;
  201. 2 2 2
  202. (n + 2) + (n + 2) *nn
  203. \end{verbatim}