=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/algnum.texi,v retrieving revision 1.3 retrieving revision 1.8 diff -u -p -r1.3 -r1.8 --- OpenXM/src/asir-doc/parts/algnum.texi 2000/03/10 07:18:40 1.3 +++ OpenXM/src/asir-doc/parts/algnum.texi 2007/02/15 02:41:38 1.8 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/algnum.texi,v 1.2 1999/12/21 02:47:30 noro Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/algnum.texi,v 1.7 2003/04/20 08:01:24 noro Exp $ \BJP @node 代数的数に関する演算,,, Top @chapter 代数的数に関する演算 @@ -11,12 +11,14 @@ @menu \BJP * 代数的数の表現:: +* 分散多項式による代数的数の表現:: * 代数的数の演算:: * 代数体上での 1 変数多項式の演算:: * 代数的数に関する函数のまとめ:: \E \BEG * Representation of algebraic numbers:: +* Representation of algebraic numbers by distributed polynomials:: * Operations over algebraic numbers:: * Operations for uni-variate polynomials over an algebraic number field:: * Summary of functions for algebraic numbers:: @@ -237,6 +239,10 @@ t#0 [100] @end example + +@example +@end example + \BJP @node 代数的数の演算,,, 代数的数に関する演算 @section 代数的数の演算 @@ -410,13 +416,15 @@ into the @b{root} by @code{rattoalgp()} function. @example [88] rattoalgp(S,[alg(0)]); -(((#0+2)/(#0+2))*t#1^2+((#0^2+2*#0)/(#0+2))*t#1+((2*#0^2+4*#0)/(#0+2)))*x -+((1)/(#0+2))*t#1+((1)/(#0+2)) +(((#0+2)/(#0+2))*t#1^2+((#0^2+2*#0)/(#0+2))*t#1 ++((2*#0^2+4*#0)/(#0+2)))*x+((1)/(#0+2))*t#1+((1)/(#0+2)) [89] rattoalgp(S,[alg(0),alg(1)]); -(((#0^3+6*#0^2+12*#0+8)*#1^2+(#0^4+6*#0^3+12*#0^2+8*#0)*#1+2*#0^4+12*#0^3 -+24*#0^2+16*#0)/(#0^3+6*#0^2+12*#0+8))*x+(((#0+2)*#1+#0+2)/(#0^2+4*#0+4)) +(((#0^3+6*#0^2+12*#0+8)*#1^2+(#0^4+6*#0^3+12*#0^2+8*#0)*#1 ++2*#0^4+12*#0^3+24*#0^2+16*#0)/(#0^3+6*#0^2+12*#0+8))*x ++(((#0+2)*#1+#0+2)/(#0^2+4*#0+4)) [90] rattoalgp(S,[alg(1),alg(0)]); -(((#0+2)*#1^2+(#0^2+2*#0)*#1+2*#0^2+4*#0)/(#0+2))*x+((#1+1)/(#0+2)) +(((#0+2)*#1^2+(#0^2+2*#0)*#1+2*#0^2+4*#0)/(#0+2))*x ++((#1+1)/(#0+2)) [91] simpalg(@@89); (#1^2+#0*#1+2*#0)*x+((-1/5*#0+2/5)*#1-1/5*#0+2/5) [92] simpalg(@@90); @@ -444,6 +452,79 @@ used for your own simplification. \E \BJP +@node 分散多項式による代数的数の表現,,, 代数的数に関する演算 +@section 分散多項式による代数的数の表現 +\E +\BEG +@node Representation of algebraic numbers by distributed polynomials,,, Algebraic numbers +@section Representation of algebraic numbers by distributed polynomials +\E + +@noindent +\BJP +前節で述べたように, @code{root} を含む代数的数に対する簡単化は +ユーザの判断で行う必要がある. これに対し, ここで解説するもう一つの代数的数の +表現については, 加減乗除, ベキなどを行ったあと自動的に簡単化が行われる. +この表現は, 逐次拡大の場合に特に効率よく計算が行われるよう設計されており, +グレブナー基底関係の関数における係数体として用いることができる. この表現は +内部的には, @code{DAlg} と呼ばれるオブジェクトとして定義されている. +@code{DAlg} は分数式の形で保持される. 分母は整数, 分子は整数係数の分散多項式である. +\E +\BEG +Simplification of algebraic numbers containing @code{root} +is not done automatically and should be done by users. +There is another representation of algebraic numbers, for which the +results of fundamental operations are automatically simplified. +This representations are designed so that operations are efficiently +performed especially when the field is a successive extension and +it can be used as a ground field for Groebner basis related functions. +Internally an algebraic number of this type is defined as an object +called @code{DAlg}. A @code{DAlg} is represented as a fraction. The +denominator is an integer and the numerator is a distributed polynomial +with integral coefficients. +\E + +\BJP +@code{DAlg} は,@code{set_field()} によりあらかじめ設定された代数体の +元として生成される. 生成方法は, @code{newalg()} で生成された代数的数を +含む数から @code{algtodalg()} で変換する, あるいは分散多項式から直接 +@code{dptodalg()} で変換する,の 2 通りある. +一旦 @code{DAlg} 形式に変換されれば, 演算後に自動的に簡単化される. +\E +\BEG +@code{DAlg} is generated as an element of an algebraic number field +set by @code{set_field()}. There are two methods to generate a @code{DAlg}. +@code{algtodalg()} converts an algebraic number containing @code{root} +to @code{DAlg}. @code{dptodalg()} directly converts a distributed polynomial to +@code{DAlg}. +\E +@example +[0] A=newalg(x^2+1); +(#0) +[1] B=newalg(x^3+A*x+A); +(#1) +[2] set_field([B,A]); +0 +[3] C=algtodalg(A+B); +((1)*<<1,0>>+(1)*<<0,1>>) +[4] C^5; +((-11)*<<2,1>>+(5)*<<2,0>>+(10)*<<1,1>>+(9)*<<1,0>>+(11)*<<0,1>> ++(-1)*<<0,0>>) +[5] 1/C; +((2)*<<2,1>>+(-1)*<<2,0>>+(1)*<<1,1>>+(2)*<<1,0>>+(-3)*<<0,1>> ++(-1)*<<0,0>>)/5 +@end example +\BJP +この例では, Q(a,b) (a^2+1=0, b^3+ab+b=0) において, (a+b)^5 および 1/(a+b) を +計算 (簡単化) している. 分子である分散多項式の表示は, 分散多項式の表示をそのまま流用している. +\E +\BEG +In this example Q(a,b) (a^2+1=0, b^3+ab+b=0) is set as the current ground field, +and (a+b)^5 and 1/(a+b) are simplified in the field. The numerators of the results +are printed as distributed polynomials. +\E + +\BJP @node 代数体上での 1 変数多項式の演算,,, 代数的数に関する演算 @section 代数体上での 1 変数多項式の演算 \E @@ -499,8 +580,8 @@ where the ground field is a multiple extension. (#0) [64] B=newalg(75*s^2+(10*A^7-175*A^4-470*A)*s+3*A^8-45*A^5-261*A^2); (#1) -[65] P1=75*x^2+(150*B+10*A^7-175*A^4-395*A)*x+(75*B^2+(10*A^7-175*A^4-395*A)*B -+13*A^8-220*A^5-581*A^2)$ +[65] P1=75*x^2+(150*B+10*A^7-175*A^4-395*A)*x ++(75*B^2+(10*A^7-175*A^4-395*A)*B+13*A^8-220*A^5-581*A^2)$ [66] P2=x^2+A*x+A^2$ [67] cr_gcda(P1,P2); 27*x+((#0^6-19*#0^3-65)*#1-#0^7+19*#0^4+38*#0) @@ -531,9 +612,9 @@ The function to do this factorization is @code{asq()}. [116] A=newalg(x^2+x+1); (#4) [117] T=simpalg((x+A+1)*(x^2-2*A-3)^2*(x^3-x-A)^2); -x^11+(#4+1)*x^10+(-4*#4-8)*x^9+(-10*#4-4)*x^8+(16*#4+20)*x^7+(24*#4-6)*x^6 -+(-29*#4-31)*x^5+(-15*#4+28)*x^4+(38*#4+29)*x^3+(#4-23)*x^2+(-21*#4-7)*x -+(3*#4+8) +x^11+(#4+1)*x^10+(-4*#4-8)*x^9+(-10*#4-4)*x^8+(16*#4+20)*x^7 ++(24*#4-6)*x^6+(-29*#4-31)*x^5+(-15*#4+28)*x^4+(38*#4+29)*x^3 ++(#4-23)*x^2+(-21*#4-7)*x+(3*#4+8) [118] asq(T); [[x^5+(-2*#4-4)*x^3+(-#4)*x^2+(2*#4+3)*x+(#4-2),2],[x+(#4+1),1]] @end example @@ -641,9 +722,9 @@ The function is @code{sp()}. @example [103] sp(x^5-2); -[[x+(-#1),2*x+(#0^3*#1^3+#0^4*#1^2+2*#1+2*#0),2*x+(-#0^4*#1^2),2*x -+(-#0^3*#1^3),x+(-#0)],[[(#1),t#1^4+t#0*t#1^3+t#0^2*t#1^2+t#0^3*t#1+t#0^4], -[(#0),t#0^5-2]]] +[[x+(-#1),2*x+(#0^3*#1^3+#0^4*#1^2+2*#1+2*#0),2*x+(-#0^4*#1^2), +2*x+(-#0^3*#1^3),x+(-#0)], +[[(#1),t#1^4+t#0*t#1^3+t#0^2*t#1^2+t#0^3*t#1+t#0^4],[(#0),t#0^5-2]]] @end example @noindent @@ -706,8 +787,10 @@ may yield a polynomial which differs by a constant. * rattoalgp:: * cr_gcda:: * sp_norm:: -* asq af:: -* sp:: +* asq af af_noalg:: +* sp sp_noalg:: +* set_field:: +* algtodalg dalgtoalg dptodalg dalgtodp:: @end menu \JP @node newalg,,, 代数的数に関する函数のまとめ @@ -1083,7 +1166,7 @@ substitutes a @b{root} for the associated indeterminat @item return \JP 多項式 \EG polynomial -@item poly1, poly2 +@item poly1 poly2 \JP 多項式 \EG polynomial @end table @@ -1109,7 +1192,7 @@ x+(-#0) @table @t \JP @item 参照 \EG @item Reference -@fref{gr hgr gr_mod}, @fref{asq af} +@fref{gr hgr gr_mod}, @fref{asq af af_noalg} @end table \JP @node sp_norm,,, 代数的数に関する函数のまとめ @@ -1192,14 +1275,15 @@ x^12+2*x^8+5*x^4+1 @table @t \JP @item 参照 \EG @item Reference -@fref{res}, @fref{asq af} +@fref{res}, @fref{asq af af_noalg} @end table -\JP @node asq af,,, 代数的数に関する函数のまとめ -\EG @node asq af,,, Summary of functions for algebraic numbers -@subsection @code{asq}, @code{af} +\JP @node asq af af_noalg,,, 代数的数に関する函数のまとめ +\EG @node asq af af_noalg,,, Summary of functions for algebraic numbers +@subsection @code{asq}, @code{af}, @code{af_noalg} @findex asq @findex af +@findex af_noalg @table @t @item asq(@var{poly}) @@ -1209,6 +1293,7 @@ x^12+2*x^8+5*x^4+1 algebraic number field. \E @item af(@var{poly},@var{alglist}) +@itemx af_noalg(@var{poly},@var{defpolylist}) \JP :: 代数体上の 1 変数多項式の因数分解 \BEG :: Factorization of polynomial @var{poly} over an @@ -1226,6 +1311,9 @@ algebraic number field. @item alglist \JP @code{root} のリスト \EG @code{root} list +@item defpolylist +\JP @code{root} を表す不定元と定義多項式のペアのリスト +\EG @code{root} list of pairs of an indeterminate and a polynomial @end table @itemize @bullet @@ -1263,10 +1351,57 @@ In the second argument @code{alglist}, @b{root} define first. \E @item -\JP 結果は, 通常の無平方分解, 因数分解と同様 [@b{因子}, @b{重複度}] のリストである. +\BJP +@code{af(F,AL)} において, @code{AL} は代数的数のリストであり, 有理数体の +代数拡大を表す. @code{AL=[An,...,A1]} と書くとき, 各 @code{Ak} は, それより +右にある代数的数を係数とした, モニックな定義多項式で定義されていなければ +ならない. +\E \BEG +In @code{af(F,AL)}, @code{AL} denotes a list of @code{roots} and it +represents an algebraic number field. In @code{AL=[An,...,A1]} each +@code{Ak} should be defined as a root of a defining polynomial +whose coefficients are in @code{Q(A(k+1),...,An)}. +\E + +@example +[1] A1 = newalg(x^2+1); +[2] A2 = newalg(x^2+A1); +[3] A3 = newalg(x^2+A2*x+A1); +[4] af(x^2+A2*x+A1,[A2,A1]); +[[x^2+(#1)*x+(#0),1]] +@end example + +\BJP +@code{af_noalg} では, @var{poly} に含まれる代数的数 @var{ai} を不定元 @var{vi} +で置き換える. @code{defpolylist} は, [[vn,dn(vn,...,v1)],...,[v1,d(v1)]] +なるリストである. ここで @var{di}(vi,...,v1) は @var{ai} の定義多項式において +代数的数を全て @var{vj} に置き換えたものである. +\E +\BEG +To call @code{sp_noalg}, one should replace each algebraic number +@var{ai} in @var{poly} with an indeterminate @var{vi}. @code{defpolylist} +is a list [[vn,dn(vn,...,v1)],...,[v1,d(v1)]]. In this expression +@var{di}(vi,...,v1) is a defining polynomial of @var{ai} represented +as a multivariate polynomial. +\E + +@example +[1] af_noalg(x^2+a2*x+a1,[[a2,a2^2+a1],[a1,a1^2+1]]); +[[x^2+a2*x+a1,1]] +@end example + +@item +\BJP +結果は, 通常の無平方分解, 因数分解と同様 [@b{因子}, @b{重複度}] +のリストである. @code{af_noalg} の場合, @b{因子} に現れる代数的数は, +@var{defpolylist} に従って不定元に置き換えられる. +\E +\BEG The result is a list, as a result of usual factorization, whose elements -is of the form [@b{factor}, @b{multiplicity}]. +is of the form [@b{factor}, @b{multiplicity}]. +In the result of @code{af_noalg}, algebraic numbers in @v{factor} are +replaced by the indeterminates according to @var{defpolylist}. \E @item \JP 重複度を込めた因子の全ての積は, @var{poly} と定数倍の違いがあり得る. @@ -1277,10 +1412,14 @@ the input polynomial by a constant. @end itemize @example +[98] A = newalg(t^2-2); +(#0) [99] asq(-x^4+6*x^3+(2*alg(0)-9)*x^2+(-6*alg(0))*x-2); [[-x^2+3*x+(#0),2]] [100] af(-x^2+3*x+alg(0),[alg(0)]); [[x+(#0-1),1],[-x+(#0+2),1]] +[101] af_noalg(-x^2+3*x+a,[[a,x^2-2]]); +[[x+a-1,1],[-x+a+2,1]] @end example @table @t @@ -1289,13 +1428,14 @@ the input polynomial by a constant. @fref{cr_gcda}, @fref{fctr sqfr} @end table -\JP @node sp,,, 代数的数に関する函数のまとめ -\EG @node sp,,, Summary of functions for algebraic numbers -@subsection @code{sp} +\JP @node sp sp_noalg,,, 代数的数に関する函数のまとめ +\EG @node sp sp_noalg,,, Summary of functions for algebraic numbers +@subsection @code{sp}, @code{sp_noalg} @findex sp @table @t @item sp(@var{poly}) +@itemx sp_noalg(@var{poly}) \JP :: 最小分解体を求める. \EG :: Finds the splitting field of polynomial @var{poly} and splits. @end table @@ -1326,12 +1466,18 @@ over the field. @item \BJP 結果は, @var{poly} の因子のリストと, 最小分解体の, 逐次拡大による表現 -からなるリストである. +からなるリストである. @code{sp_noalg} では, 全ての代数的数が, 対応する +不定元 (即ち @code{#i} に対する @code{t#i}) に置き換えられる. これに +より, @code{sp_noalg} の出力は, 整数係数多変数多項式のリストとなる. \E \BEG The result consists of a two element list: The first element is the list of all linear factors of @var{poly}; the second element is a list which represents the successive extension of the field. +In the result of @code{sp_noalg} all the algebraic numbers are replaced +by the special indeterminate associated with it, that is @code{t#i} +for @code{#i}. By this operation the result of @code{sp_noalg} +is a list containing only integral polynomials. \E @item \BJP @@ -1342,7 +1488,7 @@ a list which represents the successive extension of th \E \BEG The splitting field is represented as a list of pairs of form -@code{[root,algptorat(defpoly(root))]}. +@code{[root,} @code{algptorat(defpoly(root))]}. In more detail, the list is interpreted as a representation of successive extension obtained by adjoining @b{root}'s to the rational number field. Adjoining is performed from the right @@ -1369,9 +1515,10 @@ the builtin function @code{res()} is always used. @example [101] L=sp(x^9-54); -[[x+(-#2),-54*x+(#1^6*#2^4),54*x+(#1^6*#2^4+54*#2),54*x+(-#1^8*#2^2), --54*x+(#1^5*#2^5),54*x+(#1^5*#2^5+#1^8*#2^2),-54*x+(-#1^7*#2^3-54*#1), -54*x+(-#1^7*#2^3),x+(-#1)],[[(#2),t#2^6+t#1^3*t#2^3+t#1^6],[(#1),t#1^9-54]]] +[[x+(-#2),-54*x+(#1^6*#2^4),54*x+(#1^6*#2^4+54*#2), +54*x+(-#1^8*#2^2),-54*x+(#1^5*#2^5),54*x+(#1^5*#2^5+#1^8*#2^2), +-54*x+(-#1^7*#2^3-54*#1),54*x+(-#1^7*#2^3),x+(-#1)], +[[(#2),t#2^6+t#1^3*t#2^3+t#1^6],[(#1),t#1^9-54]]] [102] for(I=0,M=1;I<9;I++)M*=L[0][I]; [111] M=simpalg(M); -1338925209984*x^9+72301961339136 @@ -1382,6 +1529,154 @@ the builtin function @code{res()} is always used. @table @t \JP @item 参照 \EG @item Reference -@fref{asq af}, @fref{defpoly}, @fref{algptorat}, @fref{sp_norm}. +@fref{asq af af_noalg}, @fref{defpoly}, @fref{algptorat}, @fref{sp_norm}. @end table +\JP @node set_field,,, 代数的数に関する函数のまとめ +\EG @node set_field,,, Summary of functions for algebraic numbers +@subsection @code{set_field} +@findex set_field + +@table @t +@item set_field(@var{rootlist}) +\JP :: 代数体を基礎体として設定する. +\EG :: Set an algebraic number field as the currernt ground field. +@end table + +@table @var +@item return +0 +@item rootlist +\JP @code{root} のリスト +\EG A list of @code{root} +@end table + +@itemize @bullet +@item +\JP @code{root} のリスト @var{rootlist} で生成される代数体を基礎体として設定する. +\BEG +@code{set_field()} sets an algebraic number field generated by @code{root} in +@var{rootlist} over Q. +\E +@item +\BJP +@code{root} は内部的に順序づけられているので, @var{rootlist} は集合として指定 +すればよい. (順序は気にしなくてよい.) +\E +\BEG +You don't care about the order of @code{root} in @var{rootlist}, because +@code{root} are automatically ordered internally. +\E +@end itemize + +@example +[0] A=newalg(x^2+1); +(#0) +[1] B=newalg(x^3+A); +(#1) +[2] C=newalg(x^4+B); +(#1) +[3] set_field([C,B,A]); +0 +@end example + +@table @t +\JP @item 参照 +\EG @item Reference +@fref{algtodalg dalgtoalg dptodalg dalgtodp} +@end table + +\JP @node algtodalg dalgtoalg dptodalg dalgtodp,,, 代数的数に関する函数のまとめ +\EG @node algtodalg dalgtoalg dptodalg dalgtodp,,, Summary of functions for algebraic numbers +@subsection @code{algtodalg}, @code{dalgtoalg}, @code{dptodalg}, @code{dalgtodp} +@findex algtodalg +@findex dalgtoalg +@findex dpodalg +@findex dalgtodp + +@table @t +@item algtodalg(@var{alg}) +\JP :: 代数的数 @var{alg} を @code{DAlg} に変換する. +\EG :: Converts an algebraic number @var{alg} to a @code{DAlg}. +@item dalgtoalg(@var{dalg}) +\JP :: @code{DAlg} @code{dalg} を代数的数に変換する. +\EG :: Converts a @code{DAlg} @code{dalg} to an algebraic number. +@item dptodalg(@var{dp}) +\JP :: 分散多項式 @var{dp} を @code{DAlg} に変換する. +\EG :: Converts an algebraic number @var{alg} to a @code{DAlg}. +@item dalgtodp(@var{dalg}) +\JP :: @code{DAlg} @code{dalg} を分散多項式に変換する. +\EG :: Converts a @code{DAlg} @code{dalg} to an algebraic number. +@end table + +@table @var +@item return +\JP 代数的数, @code{DAlg} または [分散多項式,分母] なるリスト +\EG An algebraic number, a @code{DAlg} or a list [distributed polynomial,denominator] +@item alg +\JP @code{root} を含む代数的数 +\EG an algebraic number containing @code{root} +@item dp +\JP 有理数係数分散多項式 +\EG a distributed polynomial over Q +@end table + +@itemize @bullet +@item +\JP @code{root} を含む代数的数, @code{DAlg} および分散多項式間の変換を行う. +\BEG +These functions are converters between @code{DAlg} and an algebraic number +containing @code{root}, or a distributed polynomial. +\E +@item +\BJP +@code{DAlg} が属すべき代数体は, @code{set_field()} により +あらかじめ設定しておく必要がある. +\E +\BEG +A ground field to which a @code{DAlg} belongs must be set by @code{set_field()} +in advance. +\E +@item +\BJP +@code{dalgtodp()} は, 分子である整数係数分散多項式と, 分母である整数を要素に持つ +リストを返す. +\E +\BEG +@code{dalgtodp()} returns a list containing the numerator (a distributed polynomial) +and the denominator (an integer). +\E +@item +\BJP +@code{algtodalg()}, @code{dptodalg()} は簡単化された結果を返す. +\E +\BEG +@code{algtodalg()}, @code{dptodalg()} return the simplified result. +\E +@end itemize + +@example +[0] A=newalg(x^2+1); +(#0) +[1] B=newalg(x^3+A*x+A); +(#1) +[2] set_field([B,A]); +0 +[3] C=algtodalg((A+B)^10); +((408)*<<2,1>>+(103)*<<2,0>>+(-36)*<<1,1>>+(-446)*<<1,0>> ++(-332)*<<0,1>>+(-218)*<<0,0>>) +[4] dalgtoalg(C); +((408*#0+103)*#1^2+(-36*#0-446)*#1-332*#0-218) +[5] D=dptodalg(<<10,10>>/10+2*<<5,5>>+1/3*<<0,0>>); +((-9)*<<2,1>>+(57)*<<2,0>>+(-63)*<<1,1>>+(-12)*<<1,0>> ++(-60)*<<0,1>>+(1)*<<0,0>>)/30 +[6] dalgtodp(D); +[(-9)*<<2,1>>+(57)*<<2,0>>+(-63)*<<1,1>>+(-12)*<<1,0>> ++(-60)*<<0,1>>+(1)*<<0,0>>,30] +@end example + +@table @t +\JP @item 参照 +\EG @item Reference +@fref{set_field} +@end table