xideal.rlg 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. Sun Aug 18 18:06:11 2002 run on Windows
  2. *** ^ redefined
  3. % Test file for XIDEAL package (Groebner bases for exterior algebra)
  4. % Declare EXCALC variables
  5. pform {x,y,z,t}=0,f(i)=1,{u,u(i),u(i,j)}=0;
  6. % Reductions with xmodideal (all should be zero)
  7. d x^d y xmodideal {d x - d y};
  8. 0
  9. d x^d y^d z xmodideal {d x^d y - d z^d t};
  10. 0
  11. d x^d z^d t xmodideal {d x^d y - d z^d t};
  12. 0
  13. f(2)^d x^d y xmodideal {d t^f(1) - f(2)^f(3),
  14. f(3)^f(1) - d x^d y};
  15. 0
  16. d t^f(1)^d z xmodideal {d t^f(1) - f(2)^f(3),
  17. f(1)^d z - d x^d y,
  18. d t^d y - d x^f(2)};
  19. 0
  20. f(3)^f(4)^f(5)^f(6)
  21. xmodideal {f(1)^f(2) + f(3)^f(4) + f(5)^f(6)};
  22. 0
  23. f(1)^f(4)^f(5)^f(6)
  24. xmodideal {f(1)^f(2) + f(2)^f(3) + f(3)^f(4)
  25. + f(4)^f(5) + f(5)^f(6)};
  26. 0
  27. d x^d y^d z xmodideal {x**2+y**2+z**2-1,x*d x+y*d y+z*d z};
  28. 0
  29. % Changing the division between exterior variables and parameters
  30. xideal {a*d x+y*d y};
  31. d x*a + d y*y
  32. {---------------}
  33. a
  34. xvars {a};
  35. xideal {a*d x+y*d y};
  36. {d x*a + d y*y,d x^d y}
  37. xideal({a*d x+y*d y},{a,y});
  38. {d x*a + d y*y,
  39. d x^d y*y}
  40. xvars {};
  41. % all 0-forms are coefficients
  42. excoeffs(d u - (a*p - q)*d y);
  43. {1, - a*p + q}
  44. exvars(d u - (a*p - q)*d y);
  45. {d u,d y}
  46. xvars {p,q};
  47. % p,q are no longer coefficients
  48. excoeffs(d u - (a*p - q)*d y);
  49. { - a,1,1}
  50. exvars(d u - (a*p - q)*d y);
  51. {d y*p,d y*q,d u}
  52. xvars nil;
  53. % Exterior system for heat equation on 1st jet bundle
  54. S := {d u - u(-t)*d t - u(-x)*d x,
  55. d u(-t)^d t + d u(-x)^d x,
  56. d u(-x)^d t - u(-t)*d x^d t};
  57. s := { - d t*u + d u - d x*u ,
  58. t x
  59. - (d t^d u + d x^d u ),
  60. t x
  61. u *d t^d x - d t^d u }
  62. t x
  63. % Check that it's closed.
  64. dS := d S xmodideal S;
  65. ds := {}
  66. % Exterior system for a Monge-Ampere equation
  67. korder d u(-y,-y),d u(-x,-y),d u(-x,-x),d u(-y),d u(-x),d u;
  68. M := {u(-x,-x)*u(-y,-y) - u(-x,-y)**2,
  69. d u - u(-x)*d x - u(-y)*d y,
  70. d u(-x) - u(-x,-x)*d x - u(-x,-y)*d y,
  71. d u(-y) - u(-x,-y)*d x - u(-y,-y)*d y}$
  72. % Get the full Groebner basis
  73. gbdeg := xideal M;
  74. 2
  75. gbdeg := {u *u - (u ) ,
  76. x x y y x y
  77. d u - d x*u - d y*u ,
  78. x y
  79. d u - d x*u - d y*u ,
  80. x x x x y
  81. d u - d x*u - d y*u }
  82. y x y y y
  83. % Changing the term ordering can be dramatic
  84. xorder gradlex;
  85. gradlex
  86. gbgrad := xideal M;
  87. 2
  88. gbgrad := {u *u - (u ) ,
  89. x x y y x y
  90. - d u + d x*u + d y*u ,
  91. x y
  92. - d u + d x*u + d y*u ,
  93. y x y y y
  94. - d u + d x*u + d y*u ,
  95. x x x x y
  96. d u ^d x + d u ^d y,
  97. x y
  98. - d u *u + d u *u ,
  99. x y y y x y
  100. - d u *u + d u *u ,
  101. x x y y x x
  102. d u ^d u ,
  103. y x
  104. d u *u - d u*u + d y*u *u - d y*u *u ,
  105. y x x y x y y x y y
  106. d u *u - d u*u + d y*u *u - d y*u *u ,
  107. x x x x x x y x y x
  108. u *d x^d y + d u^d x,
  109. y
  110. u *d x^d y + d u ^d x,
  111. y y y
  112. d u^d x^d y,
  113. - u *d u^d y + u *d u ^d y - d u ^d u,
  114. x y y x x
  115. - u *d u^d y + u *d u ^d y,
  116. x x x x
  117. u *d u^d y + u *d u ^d x + d u ^d u,
  118. y y y x y
  119. d u ^d x^d y,
  120. x
  121. d u ^d u^d y,
  122. x
  123. d u ^d u^d x,
  124. x
  125. - u *d u^d x + u *d u ^d x,
  126. y y y y
  127. d u ^d u^d x}
  128. y
  129. % But the bases are equivalent
  130. gbdeg xmod gbgrad;
  131. {}
  132. xorder deglex;
  133. deglex
  134. gbgrad xmod gbdeg;
  135. {}
  136. % Some Groebner bases
  137. gb := xideal {f(1)^f(2) + f(3)^f(4)};
  138. 1 2 3 4
  139. gb := {f ^f + f ^f ,
  140. 2 3 4
  141. f ^f ^f ,
  142. 1 3 4
  143. f ^f ^f }
  144. gb := xideal {f(1)^f(2), f(1)^f(3)+f(2)^f(4)+f(5)^f(6)};
  145. 1 3 2 4 5 6
  146. gb := {f ^f + f ^f + f ^f ,
  147. 1 2
  148. f ^f ,
  149. 2 5 6
  150. f ^f ^f ,
  151. 2 3 4 3 5 6
  152. f ^f ^f - f ^f ^f ,
  153. 1 5 6
  154. f ^f ^f ,
  155. 3 4 5 6
  156. f ^f ^f ^f }
  157. % Non-graded ideals
  158. % Left and right ideals are not the same
  159. d t^(d z+d x^d y) xmodideal {d z+d x^d y};
  160. 0
  161. (d z+d x^d y)^d t xmodideal {d z+d x^d y};
  162. - 2*d t^d z
  163. % Higher order forms can now reduce lower order ones
  164. d x xmodideal {d y^d z + d x,d x^d y + d z};
  165. 0
  166. % Anything whose even part is a parameter generates the trivial ideal!!
  167. gb := xideal({x + d y},{});
  168. gb := {1}
  169. gb := xideal {1 + f(1) + f(1)^f(2) + f(2)^f(3)^f(4) + f(3)^f(4)^f(5)^f(6)};
  170. gb := {1}
  171. xvars nil;
  172. % Tracing Groebner basis calculations
  173. on trxideal;
  174. gb := xideal {x-y+y*d x-x*d y};
  175. Input Basis
  176. xpoly(1)= - x^d y + d x^y + x - y
  177. New Basis
  178. xpoly(1)=x^d y - d x^y - x + y
  179. wedge_pair{d y,1} -> xpoly(2)=d x^y^d y - x^d y + y^d y
  180. spoly_pair{2,1} -> xpoly(3)=x^x - 2*x^y + y^y
  181. spoly_pair{1,3} -> xpoly(4)=x^d x^y - 2*x^y^d y + y^y^d y + x^x - x^y
  182. spoly_pair{4,3} -> 0
  183. spoly_pair{4,1} -> 0
  184. spoly_pair{2,4} -> criterion 1 hit
  185. wedge_pair{d x,4} -> 0
  186. wedge_pair{d x,2} -> xpoly(5)=x^d x - x^d y - d x^y + y^d y
  187. New Basis
  188. xpoly(1)=x^d y - d x^y - x + y
  189. xpoly(2)=d x^y^d y - x^d y + y^d y
  190. xpoly(3)=x^x - 2*x^y + y^y
  191. xpoly(4)=x^d x - x^d y - d x^y + y^d y
  192. spoly_pair{4,3} -> 0
  193. spoly_pair{4,1} -> 0
  194. spoly_pair{2,4} -> criterion 1 hit
  195. wedge_pair{d x,4} -> 0
  196. 2 2
  197. gb := {x - 2*x*y + y ,
  198. - d x*y + d y*x - x + y,
  199. d x*x - 2*d x*y + d y*y - x + y,
  200. - d x*y + d y*y + d x^d y*y - x + y}
  201. off trxideal;
  202. % Same thing in lexicographic order, without full reduction
  203. xorder lex;
  204. lex
  205. off xfullreduce;
  206. gblex := xideal {x-y+y*d x-x*d y};
  207. gblex := {d x*y - d y*y - d x^d y*y + x - y,
  208. d x*y - d y*x + x - y}
  209. % Manual autoreduction
  210. gblex := xauto gblex;
  211. gblex := {d x*y - d y*y - d x^d y*y + x - y}
  212. % Tracing reduction
  213. on trxmod;
  214. first gb xmod gblex;
  215. x^x - 2*x^y + y^y =
  216. x^(x - d x^y^d y + d x^y - y^d y - y) +
  217. (d x^y^d y)^(x - d x^y^d y + d x^y - y^d y - y) +
  218. ( - d x^y)^(x - d x^y^d y + d x^y - y^d y - y) +
  219. (y^d y)^(x - d x^y^d y + d x^y - y^d y - y) +
  220. ( - y)^(x - d x^y^d y + d x^y - y^d y - y) +
  221. 0
  222. 0
  223. % Restore defaults
  224. on xfullreduce;
  225. off trxideal,trxmod;
  226. xvars nil;
  227. xorder deglex;
  228. deglex
  229. end;
  230. Time for test: 2694 ms