passagemath-singular 10.6.31rc3__cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-singular might be problematic. Click here for more details.

Files changed (491) hide show
  1. PySingular.cpython-314-x86_64-linux-gnu.so +0 -0
  2. passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
  3. passagemath_singular-10.6.31rc3.dist-info/RECORD +491 -0
  4. passagemath_singular-10.6.31rc3.dist-info/WHEEL +6 -0
  5. passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
  6. passagemath_singular.libs/libSingular-4-20aec911.4.1.so +0 -0
  7. passagemath_singular.libs/libcddgmp-21acf0c6.so.0.1.3 +0 -0
  8. passagemath_singular.libs/libfactory-4-fcee31da.4.1.so +0 -0
  9. passagemath_singular.libs/libflint-66e12231.so.21.0.0 +0 -0
  10. passagemath_singular.libs/libgf2x-a4cdec90.so.3.0.0 +0 -0
  11. passagemath_singular.libs/libgfortran-83c28eba.so.5.0.0 +0 -0
  12. passagemath_singular.libs/libgmp-6e109695.so.10.5.0 +0 -0
  13. passagemath_singular.libs/libgsl-cda90e79.so.28.0.0 +0 -0
  14. passagemath_singular.libs/libmpfr-82690d50.so.6.2.1 +0 -0
  15. passagemath_singular.libs/libntl-e6f0d543.so.44.0.1 +0 -0
  16. passagemath_singular.libs/libomalloc-0-5c9e866e.9.6.so +0 -0
  17. passagemath_singular.libs/libopenblasp-r0-6dcb67f9.3.29.so +0 -0
  18. passagemath_singular.libs/libpolys-4-5c0a87e0.4.1.so +0 -0
  19. passagemath_singular.libs/libquadmath-2284e583.so.0.0.0 +0 -0
  20. passagemath_singular.libs/libreadline-ea270e21.so.8.2 +0 -0
  21. passagemath_singular.libs/libsingular_resources-4-a1aafc6d.4.1.so +0 -0
  22. passagemath_singular.libs/libtinfo-ceb117d9.so.6.3 +0 -0
  23. sage/algebras/all__sagemath_singular.py +3 -0
  24. sage/algebras/fusion_rings/all.py +19 -0
  25. sage/algebras/fusion_rings/f_matrix.py +2448 -0
  26. sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-x86_64-linux-gnu.so +0 -0
  27. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
  28. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
  29. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-x86_64-linux-gnu.so +0 -0
  30. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
  31. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
  32. sage/algebras/fusion_rings/fusion_double.py +899 -0
  33. sage/algebras/fusion_rings/fusion_ring.py +1580 -0
  34. sage/algebras/fusion_rings/poly_tup_engine.cpython-314-x86_64-linux-gnu.so +0 -0
  35. sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
  36. sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
  37. sage/algebras/fusion_rings/shm_managers.cpython-314-x86_64-linux-gnu.so +0 -0
  38. sage/algebras/fusion_rings/shm_managers.pxd +24 -0
  39. sage/algebras/fusion_rings/shm_managers.pyx +780 -0
  40. sage/algebras/letterplace/all.py +1 -0
  41. sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-x86_64-linux-gnu.so +0 -0
  42. sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
  43. sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
  44. sage/algebras/letterplace/free_algebra_letterplace.cpython-314-x86_64-linux-gnu.so +0 -0
  45. sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
  46. sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
  47. sage/algebras/letterplace/letterplace_ideal.cpython-314-x86_64-linux-gnu.so +0 -0
  48. sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
  49. sage/algebras/quatalg/all.py +2 -0
  50. sage/algebras/quatalg/quaternion_algebra.py +4778 -0
  51. sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-x86_64-linux-gnu.so +0 -0
  52. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  53. sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
  54. sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
  55. sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
  56. sage/all__sagemath_singular.py +11 -0
  57. sage/ext_data/all__sagemath_singular.py +1 -0
  58. sage/ext_data/singular/function_field/core.lib +98 -0
  59. sage/interfaces/all__sagemath_singular.py +1 -0
  60. sage/interfaces/singular.py +2835 -0
  61. sage/libs/all__sagemath_singular.py +1 -0
  62. sage/libs/singular/__init__.py +1 -0
  63. sage/libs/singular/decl.pxd +1168 -0
  64. sage/libs/singular/function.cpython-314-x86_64-linux-gnu.so +0 -0
  65. sage/libs/singular/function.pxd +87 -0
  66. sage/libs/singular/function.pyx +1901 -0
  67. sage/libs/singular/function_factory.py +61 -0
  68. sage/libs/singular/groebner_strategy.cpython-314-x86_64-linux-gnu.so +0 -0
  69. sage/libs/singular/groebner_strategy.pxd +22 -0
  70. sage/libs/singular/groebner_strategy.pyx +582 -0
  71. sage/libs/singular/option.cpython-314-x86_64-linux-gnu.so +0 -0
  72. sage/libs/singular/option.pyx +671 -0
  73. sage/libs/singular/polynomial.cpython-314-x86_64-linux-gnu.so +0 -0
  74. sage/libs/singular/polynomial.pxd +39 -0
  75. sage/libs/singular/polynomial.pyx +661 -0
  76. sage/libs/singular/ring.cpython-314-x86_64-linux-gnu.so +0 -0
  77. sage/libs/singular/ring.pxd +58 -0
  78. sage/libs/singular/ring.pyx +893 -0
  79. sage/libs/singular/singular.cpython-314-x86_64-linux-gnu.so +0 -0
  80. sage/libs/singular/singular.pxd +72 -0
  81. sage/libs/singular/singular.pyx +1944 -0
  82. sage/libs/singular/standard_options.py +145 -0
  83. sage/matrix/all__sagemath_singular.py +1 -0
  84. sage/matrix/matrix_mpolynomial_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  85. sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
  86. sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
  87. sage/rings/all__sagemath_singular.py +1 -0
  88. sage/rings/function_field/all__sagemath_singular.py +1 -0
  89. sage/rings/function_field/derivations_polymod.py +911 -0
  90. sage/rings/function_field/element_polymod.cpython-314-x86_64-linux-gnu.so +0 -0
  91. sage/rings/function_field/element_polymod.pyx +406 -0
  92. sage/rings/function_field/function_field_polymod.py +2611 -0
  93. sage/rings/function_field/ideal_polymod.py +1775 -0
  94. sage/rings/function_field/order_polymod.py +1475 -0
  95. sage/rings/function_field/place_polymod.py +681 -0
  96. sage/rings/polynomial/all__sagemath_singular.py +1 -0
  97. sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-x86_64-linux-gnu.so +0 -0
  98. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
  99. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
  100. sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-x86_64-linux-gnu.so +0 -0
  101. sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
  102. sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
  103. sage/rings/polynomial/plural.cpython-314-x86_64-linux-gnu.so +0 -0
  104. sage/rings/polynomial/plural.pxd +48 -0
  105. sage/rings/polynomial/plural.pyx +3171 -0
  106. sage/symbolic/all__sagemath_singular.py +1 -0
  107. sage/symbolic/comparison_impl.pxi +428 -0
  108. sage/symbolic/constants_c_impl.pxi +178 -0
  109. sage/symbolic/expression.cpython-314-x86_64-linux-gnu.so +0 -0
  110. sage/symbolic/expression.pxd +7 -0
  111. sage/symbolic/expression.pyx +14200 -0
  112. sage/symbolic/getitem_impl.pxi +202 -0
  113. sage/symbolic/pynac.pxi +572 -0
  114. sage/symbolic/pynac_constant_impl.pxi +133 -0
  115. sage/symbolic/pynac_function_impl.pxi +206 -0
  116. sage/symbolic/pynac_impl.pxi +2576 -0
  117. sage/symbolic/pynac_wrap.h +124 -0
  118. sage/symbolic/series_impl.pxi +272 -0
  119. sage/symbolic/substitution_map_impl.pxi +94 -0
  120. sage_wheels/bin/ESingular +0 -0
  121. sage_wheels/bin/Singular +0 -0
  122. sage_wheels/bin/TSingular +0 -0
  123. sage_wheels/lib/singular/MOD/cohomo.la +41 -0
  124. sage_wheels/lib/singular/MOD/cohomo.so +0 -0
  125. sage_wheels/lib/singular/MOD/customstd.la +41 -0
  126. sage_wheels/lib/singular/MOD/customstd.so +0 -0
  127. sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
  128. sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
  129. sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
  130. sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
  131. sage_wheels/lib/singular/MOD/gitfan.la +41 -0
  132. sage_wheels/lib/singular/MOD/gitfan.so +0 -0
  133. sage_wheels/lib/singular/MOD/interval.la +41 -0
  134. sage_wheels/lib/singular/MOD/interval.so +0 -0
  135. sage_wheels/lib/singular/MOD/loctriv.la +41 -0
  136. sage_wheels/lib/singular/MOD/loctriv.so +0 -0
  137. sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
  138. sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
  139. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
  140. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
  141. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
  142. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
  143. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
  144. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
  145. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
  146. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
  147. sage_wheels/lib/singular/MOD/partialgb.la +41 -0
  148. sage_wheels/lib/singular/MOD/partialgb.so +0 -0
  149. sage_wheels/lib/singular/MOD/pyobject.la +41 -0
  150. sage_wheels/lib/singular/MOD/pyobject.so +0 -0
  151. sage_wheels/lib/singular/MOD/singmathic.la +41 -0
  152. sage_wheels/lib/singular/MOD/singmathic.so +0 -0
  153. sage_wheels/lib/singular/MOD/sispasm.la +41 -0
  154. sage_wheels/lib/singular/MOD/sispasm.so +0 -0
  155. sage_wheels/lib/singular/MOD/subsets.la +41 -0
  156. sage_wheels/lib/singular/MOD/subsets.so +0 -0
  157. sage_wheels/lib/singular/MOD/systhreads.la +41 -0
  158. sage_wheels/lib/singular/MOD/systhreads.so +0 -0
  159. sage_wheels/lib/singular/MOD/syzextra.la +41 -0
  160. sage_wheels/lib/singular/MOD/syzextra.so +0 -0
  161. sage_wheels/libexec/singular/MOD/change_cost +0 -0
  162. sage_wheels/libexec/singular/MOD/singularsurf +11 -0
  163. sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
  164. sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
  165. sage_wheels/libexec/singular/MOD/solve_IP +0 -0
  166. sage_wheels/libexec/singular/MOD/surfex +16 -0
  167. sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
  168. sage_wheels/share/factory/gftables/10201 +342 -0
  169. sage_wheels/share/factory/gftables/1024 +37 -0
  170. sage_wheels/share/factory/gftables/10609 +356 -0
  171. sage_wheels/share/factory/gftables/11449 +384 -0
  172. sage_wheels/share/factory/gftables/11881 +398 -0
  173. sage_wheels/share/factory/gftables/121 +6 -0
  174. sage_wheels/share/factory/gftables/12167 +408 -0
  175. sage_wheels/share/factory/gftables/125 +7 -0
  176. sage_wheels/share/factory/gftables/12769 +428 -0
  177. sage_wheels/share/factory/gftables/128 +7 -0
  178. sage_wheels/share/factory/gftables/1331 +47 -0
  179. sage_wheels/share/factory/gftables/1369 +48 -0
  180. sage_wheels/share/factory/gftables/14641 +490 -0
  181. sage_wheels/share/factory/gftables/15625 +523 -0
  182. sage_wheels/share/factory/gftables/16 +3 -0
  183. sage_wheels/share/factory/gftables/16129 +540 -0
  184. sage_wheels/share/factory/gftables/16384 +549 -0
  185. sage_wheels/share/factory/gftables/16807 +563 -0
  186. sage_wheels/share/factory/gftables/1681 +58 -0
  187. sage_wheels/share/factory/gftables/169 +8 -0
  188. sage_wheels/share/factory/gftables/17161 +574 -0
  189. sage_wheels/share/factory/gftables/1849 +64 -0
  190. sage_wheels/share/factory/gftables/18769 +628 -0
  191. sage_wheels/share/factory/gftables/19321 +646 -0
  192. sage_wheels/share/factory/gftables/19683 +659 -0
  193. sage_wheels/share/factory/gftables/2048 +71 -0
  194. sage_wheels/share/factory/gftables/2187 +75 -0
  195. sage_wheels/share/factory/gftables/2197 +76 -0
  196. sage_wheels/share/factory/gftables/2209 +76 -0
  197. sage_wheels/share/factory/gftables/22201 +742 -0
  198. sage_wheels/share/factory/gftables/22801 +762 -0
  199. sage_wheels/share/factory/gftables/2401 +82 -0
  200. sage_wheels/share/factory/gftables/243 +11 -0
  201. sage_wheels/share/factory/gftables/24389 +815 -0
  202. sage_wheels/share/factory/gftables/24649 +824 -0
  203. sage_wheels/share/factory/gftables/25 +3 -0
  204. sage_wheels/share/factory/gftables/256 +11 -0
  205. sage_wheels/share/factory/gftables/26569 +888 -0
  206. sage_wheels/share/factory/gftables/27 +3 -0
  207. sage_wheels/share/factory/gftables/27889 +932 -0
  208. sage_wheels/share/factory/gftables/2809 +96 -0
  209. sage_wheels/share/factory/gftables/28561 +954 -0
  210. sage_wheels/share/factory/gftables/289 +12 -0
  211. sage_wheels/share/factory/gftables/29791 +995 -0
  212. sage_wheels/share/factory/gftables/29929 +1000 -0
  213. sage_wheels/share/factory/gftables/3125 +107 -0
  214. sage_wheels/share/factory/gftables/32 +4 -0
  215. sage_wheels/share/factory/gftables/32041 +1070 -0
  216. sage_wheels/share/factory/gftables/32761 +1094 -0
  217. sage_wheels/share/factory/gftables/32768 +1095 -0
  218. sage_wheels/share/factory/gftables/343 +14 -0
  219. sage_wheels/share/factory/gftables/3481 +118 -0
  220. sage_wheels/share/factory/gftables/361 +14 -0
  221. sage_wheels/share/factory/gftables/36481 +1218 -0
  222. sage_wheels/share/factory/gftables/3721 +126 -0
  223. sage_wheels/share/factory/gftables/37249 +1244 -0
  224. sage_wheels/share/factory/gftables/38809 +1296 -0
  225. sage_wheels/share/factory/gftables/39601 +1322 -0
  226. sage_wheels/share/factory/gftables/4 +3 -0
  227. sage_wheels/share/factory/gftables/4096 +139 -0
  228. sage_wheels/share/factory/gftables/44521 +1486 -0
  229. sage_wheels/share/factory/gftables/4489 +152 -0
  230. sage_wheels/share/factory/gftables/49 +4 -0
  231. sage_wheels/share/factory/gftables/4913 +166 -0
  232. sage_wheels/share/factory/gftables/49729 +1660 -0
  233. sage_wheels/share/factory/gftables/5041 +170 -0
  234. sage_wheels/share/factory/gftables/50653 +1691 -0
  235. sage_wheels/share/factory/gftables/512 +20 -0
  236. sage_wheels/share/factory/gftables/51529 +1720 -0
  237. sage_wheels/share/factory/gftables/52441 +1750 -0
  238. sage_wheels/share/factory/gftables/529 +20 -0
  239. sage_wheels/share/factory/gftables/5329 +180 -0
  240. sage_wheels/share/factory/gftables/54289 +1812 -0
  241. sage_wheels/share/factory/gftables/57121 +1906 -0
  242. sage_wheels/share/factory/gftables/58081 +1938 -0
  243. sage_wheels/share/factory/gftables/59049 +1971 -0
  244. sage_wheels/share/factory/gftables/6241 +210 -0
  245. sage_wheels/share/factory/gftables/625 +23 -0
  246. sage_wheels/share/factory/gftables/63001 +2102 -0
  247. sage_wheels/share/factory/gftables/64 +5 -0
  248. sage_wheels/share/factory/gftables/6561 +221 -0
  249. sage_wheels/share/factory/gftables/6859 +231 -0
  250. sage_wheels/share/factory/gftables/6889 +232 -0
  251. sage_wheels/share/factory/gftables/729 +27 -0
  252. sage_wheels/share/factory/gftables/7921 +266 -0
  253. sage_wheels/share/factory/gftables/8 +3 -0
  254. sage_wheels/share/factory/gftables/81 +5 -0
  255. sage_wheels/share/factory/gftables/8192 +276 -0
  256. sage_wheels/share/factory/gftables/841 +30 -0
  257. sage_wheels/share/factory/gftables/9 +3 -0
  258. sage_wheels/share/factory/gftables/9409 +316 -0
  259. sage_wheels/share/factory/gftables/961 +34 -0
  260. sage_wheels/share/info/singular.info +191898 -0
  261. sage_wheels/share/singular/LIB/GND.lib +1359 -0
  262. sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
  263. sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
  264. sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
  265. sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
  266. sage_wheels/share/singular/LIB/VecField.lib +1542 -0
  267. sage_wheels/share/singular/LIB/absfact.lib +959 -0
  268. sage_wheels/share/singular/LIB/ainvar.lib +730 -0
  269. sage_wheels/share/singular/LIB/aksaka.lib +419 -0
  270. sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
  271. sage_wheels/share/singular/LIB/algebra.lib +1193 -0
  272. sage_wheels/share/singular/LIB/all.lib +136 -0
  273. sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
  274. sage_wheels/share/singular/LIB/arnold.lib +4553 -0
  275. sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
  276. sage_wheels/share/singular/LIB/arr.lib +3486 -0
  277. sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
  278. sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
  279. sage_wheels/share/singular/LIB/bfun.lib +1964 -0
  280. sage_wheels/share/singular/LIB/bimodules.lib +774 -0
  281. sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
  282. sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
  283. sage_wheels/share/singular/LIB/central.lib +2169 -0
  284. sage_wheels/share/singular/LIB/chern.lib +4162 -0
  285. sage_wheels/share/singular/LIB/cimonom.lib +571 -0
  286. sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
  287. sage_wheels/share/singular/LIB/classify.lib +3239 -0
  288. sage_wheels/share/singular/LIB/classify2.lib +1462 -0
  289. sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
  290. sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
  291. sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
  292. sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
  293. sage_wheels/share/singular/LIB/combinat.lib +91 -0
  294. sage_wheels/share/singular/LIB/compregb.lib +276 -0
  295. sage_wheels/share/singular/LIB/control.lib +1636 -0
  296. sage_wheels/share/singular/LIB/crypto.lib +3795 -0
  297. sage_wheels/share/singular/LIB/curveInv.lib +667 -0
  298. sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
  299. sage_wheels/share/singular/LIB/customstd.lib +100 -0
  300. sage_wheels/share/singular/LIB/deRham.lib +5979 -0
  301. sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
  302. sage_wheels/share/singular/LIB/decomp.lib +1655 -0
  303. sage_wheels/share/singular/LIB/deflation.lib +872 -0
  304. sage_wheels/share/singular/LIB/deform.lib +925 -0
  305. sage_wheels/share/singular/LIB/difform.lib +3055 -0
  306. sage_wheels/share/singular/LIB/divisors.lib +750 -0
  307. sage_wheels/share/singular/LIB/dmod.lib +5817 -0
  308. sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
  309. sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
  310. sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
  311. sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
  312. sage_wheels/share/singular/LIB/dummy.lib +17 -0
  313. sage_wheels/share/singular/LIB/elim.lib +1009 -0
  314. sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
  315. sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
  316. sage_wheels/share/singular/LIB/equising.lib +2127 -0
  317. sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
  318. sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
  319. sage_wheels/share/singular/LIB/findifs.lib +778 -0
  320. sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
  321. sage_wheels/share/singular/LIB/finvar.lib +7989 -0
  322. sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
  323. sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
  324. sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
  325. sage_wheels/share/singular/LIB/freegb.lib +3853 -0
  326. sage_wheels/share/singular/LIB/general.lib +1350 -0
  327. sage_wheels/share/singular/LIB/gfan.lib +1768 -0
  328. sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
  329. sage_wheels/share/singular/LIB/gkdim.lib +99 -0
  330. sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
  331. sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
  332. sage_wheels/share/singular/LIB/goettsche.lib +909 -0
  333. sage_wheels/share/singular/LIB/graal.lib +1366 -0
  334. sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
  335. sage_wheels/share/singular/LIB/graphics.lib +360 -0
  336. sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
  337. sage_wheels/share/singular/LIB/groups.lib +1123 -0
  338. sage_wheels/share/singular/LIB/grwalk.lib +507 -0
  339. sage_wheels/share/singular/LIB/hdepth.lib +194 -0
  340. sage_wheels/share/singular/LIB/help.cnf +57 -0
  341. sage_wheels/share/singular/LIB/hess.lib +1946 -0
  342. sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
  343. sage_wheels/share/singular/LIB/hodge.lib +400 -0
  344. sage_wheels/share/singular/LIB/homolog.lib +1965 -0
  345. sage_wheels/share/singular/LIB/hyperel.lib +975 -0
  346. sage_wheels/share/singular/LIB/inout.lib +679 -0
  347. sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
  348. sage_wheels/share/singular/LIB/interval.lib +1418 -0
  349. sage_wheels/share/singular/LIB/intprog.lib +778 -0
  350. sage_wheels/share/singular/LIB/invar.lib +443 -0
  351. sage_wheels/share/singular/LIB/involut.lib +980 -0
  352. sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
  353. sage_wheels/share/singular/LIB/kskernel.lib +534 -0
  354. sage_wheels/share/singular/LIB/latex.lib +3146 -0
  355. sage_wheels/share/singular/LIB/lejeune.lib +651 -0
  356. sage_wheels/share/singular/LIB/linalg.lib +2040 -0
  357. sage_wheels/share/singular/LIB/locnormal.lib +212 -0
  358. sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
  359. sage_wheels/share/singular/LIB/makedbm.lib +294 -0
  360. sage_wheels/share/singular/LIB/mathml.lib +813 -0
  361. sage_wheels/share/singular/LIB/matrix.lib +1372 -0
  362. sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
  363. sage_wheels/share/singular/LIB/methods.lib +212 -0
  364. sage_wheels/share/singular/LIB/moddiq.lib +322 -0
  365. sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
  366. sage_wheels/share/singular/LIB/modnormal.lib +218 -0
  367. sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
  368. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  369. sage_wheels/share/singular/LIB/modstd.lib +1024 -0
  370. sage_wheels/share/singular/LIB/modular.lib +545 -0
  371. sage_wheels/share/singular/LIB/modules.lib +2561 -0
  372. sage_wheels/share/singular/LIB/modwalk.lib +609 -0
  373. sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
  374. sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
  375. sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
  376. sage_wheels/share/singular/LIB/mregular.lib +1863 -0
  377. sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
  378. sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
  379. sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
  380. sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
  381. sage_wheels/share/singular/LIB/ncall.lib +31 -0
  382. sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
  383. sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
  384. sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
  385. sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
  386. sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
  387. sage_wheels/share/singular/LIB/ncloc.lib +361 -0
  388. sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
  389. sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
  390. sage_wheels/share/singular/LIB/nctools.lib +1887 -0
  391. sage_wheels/share/singular/LIB/nets.lib +1456 -0
  392. sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
  393. sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
  394. sage_wheels/share/singular/LIB/noether.lib +1106 -0
  395. sage_wheels/share/singular/LIB/normal.lib +8700 -0
  396. sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
  397. sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
  398. sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
  399. sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
  400. sage_wheels/share/singular/LIB/olga.lib +1933 -0
  401. sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
  402. sage_wheels/share/singular/LIB/parallel.lib +319 -0
  403. sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
  404. sage_wheels/share/singular/LIB/perron.lib +202 -0
  405. sage_wheels/share/singular/LIB/pfd.lib +2223 -0
  406. sage_wheels/share/singular/LIB/phindex.lib +642 -0
  407. sage_wheels/share/singular/LIB/pointid.lib +673 -0
  408. sage_wheels/share/singular/LIB/polybori.lib +1430 -0
  409. sage_wheels/share/singular/LIB/polyclass.lib +525 -0
  410. sage_wheels/share/singular/LIB/polylib.lib +1174 -0
  411. sage_wheels/share/singular/LIB/polymake.lib +1902 -0
  412. sage_wheels/share/singular/LIB/presolve.lib +1533 -0
  413. sage_wheels/share/singular/LIB/primdec.lib +9576 -0
  414. sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
  415. sage_wheels/share/singular/LIB/primitiv.lib +401 -0
  416. sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
  417. sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
  418. sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
  419. sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
  420. sage_wheels/share/singular/LIB/random.lib +455 -0
  421. sage_wheels/share/singular/LIB/ratgb.lib +489 -0
  422. sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
  423. sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
  424. sage_wheels/share/singular/LIB/realrad.lib +1197 -0
  425. sage_wheels/share/singular/LIB/recover.lib +2628 -0
  426. sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
  427. sage_wheels/share/singular/LIB/reesclos.lib +465 -0
  428. sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
  429. sage_wheels/share/singular/LIB/resgraph.lib +789 -0
  430. sage_wheels/share/singular/LIB/resjung.lib +820 -0
  431. sage_wheels/share/singular/LIB/resolve.lib +5110 -0
  432. sage_wheels/share/singular/LIB/resources.lib +170 -0
  433. sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
  434. sage_wheels/share/singular/LIB/ring.lib +1328 -0
  435. sage_wheels/share/singular/LIB/ringgb.lib +343 -0
  436. sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
  437. sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
  438. sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
  439. sage_wheels/share/singular/LIB/rootsur.lib +886 -0
  440. sage_wheels/share/singular/LIB/rstandard.lib +607 -0
  441. sage_wheels/share/singular/LIB/rwalk.lib +336 -0
  442. sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
  443. sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
  444. sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
  445. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  446. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  447. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  448. sage_wheels/share/singular/LIB/sets.lib +524 -0
  449. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  450. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  451. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  452. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  453. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  454. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  455. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  456. sage_wheels/share/singular/LIB/sresext.lib +757 -0
  457. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  458. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  459. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  460. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  461. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  462. sage_wheels/share/singular/LIB/surf.lib +506 -0
  463. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  464. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  465. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  466. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  467. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  468. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  469. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  470. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  471. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  472. sage_wheels/share/singular/LIB/template.lib +116 -0
  473. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  474. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  475. sage_wheels/share/singular/LIB/triang.lib +1197 -0
  476. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  477. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  478. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  479. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  480. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  481. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  482. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  483. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  484. sage_wheels/share/singular/emacs/COPYING +44 -0
  485. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  486. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  487. sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
  488. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  489. sage_wheels/share/singular/emacs/singular.el +4273 -0
  490. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  491. sage_wheels/share/singular/singular.idx +5002 -0
@@ -0,0 +1,1965 @@
1
+ //////////////////////////////////////////////////////////////////////////////
2
+ version="version homolog.lib 4.3.1.3 Feb_2023 "; // $Id: edb4d3f6872be2a174b59bb155ac537334344b34 $
3
+ category="Commutative Algebra";
4
+ info="
5
+ LIBRARY: homolog.lib Procedures for Homological Algebra
6
+ AUTHORS: Gert-Martin Greuel, greuel@mathematik.uni-kl.de,
7
+ @* Bernd Martin, martin@math.tu-cottbus.de
8
+ @* Christoph Lossen, lossen@mathematik.uni-kl.de
9
+
10
+ PROCEDURES:
11
+ canonMap(id); the kernel and the cokernel of the canonical map
12
+ cup(M); cup: Ext^1(M',M') x Ext^1() --> Ext^2()
13
+ cupproduct(M,N,P,p,q); cup: Ext^p(M',N') x Ext^q(N',P') --> Ext^p+q(M',P')
14
+ depth(I,M); depth(I,M'), I ideal, M module, M'=coker(M)
15
+ Ext_R(k,M); Ext^k(M',R), M module, R basering, M'=coker(M)
16
+ Ext(k,M,N); Ext^k(M',N'), M,N modules, M'=coker(M), N'=coker(N)
17
+ fitting(M,n); n-th Fitting ideal of M'=coker(M), M module, n int
18
+ flatteningStrat(M); Flattening stratification of M'=coker(M), M module
19
+ Hom(M,N); Hom(M',N'), M,N modules, M'=coker(M), N'=coker(N)
20
+ homology(A,B,M,N); ker(B)/im(A), homology of complex R^k--A->M'--B->N'
21
+ isCM(M); test if coker(M) is Cohen-Macaulay, M module
22
+ isFlat(M); test if coker(M) is flat, M module
23
+ isLocallyFree(M,r); test if coker(M) is locally free of constant rank r
24
+ isReg(I,M); test if I is coker(M)-sequence, I ideal, M module
25
+ hom_kernel(A,M,N); ker(M'--A->N') M,N modules, A matrix
26
+ kohom(A,k); Hom(R^k,A), A matrix over basering R
27
+ kontrahom(A,k); Hom(A,R^k), A matrix over basering R
28
+ KoszulHomology(I,M,n); n-th Koszul homology H_n(I,coker(M)), I=ideal
29
+ tensorMod(M,N); Tensor product of modules M'=coker(M), N'=coker(N)
30
+ Tor(k,M,N); Tor_k(M',N'), M,N modules, M'=coker(M), N'=coker(N)
31
+ ";
32
+
33
+ LIB "general.lib";
34
+ LIB "deform.lib";
35
+ LIB "matrix.lib";
36
+ LIB "polylib.lib";
37
+ LIB "primdec.lib";
38
+ ///////////////////////////////////////////////////////////////////////////////
39
+
40
+ proc cup (module M,list #)
41
+ "USAGE: cup(M,[,any,any]); M=module
42
+ COMPUTE: cup-product Ext^1(M',M') x Ext^1(M',M') ---> Ext^2(M',M'), where
43
+ M':=R^m/M, if M in R^m, R basering (i.e. M':=coker(matrix(M))).
44
+ @* If called with >= 2 arguments: compute symmetrized cup-product
45
+ ASSUME: all Ext's are finite dimensional
46
+ RETURN: - if called with 1 argument: matrix, the columns of the output present
47
+ the coordinates of b_i&b_j with respect to a kbase of Ext^2, where
48
+ b_1,b_2,... is a kbase of Ext^1 and & denotes cup product;@*
49
+ - if called with 2 arguments: matrix, the columns of the output
50
+ present the coordinates of (1/2)(b_i&b_j + b_j&b_i) with respect to
51
+ a kbase of Ext^2;
52
+ - if called with 3 arguments: list,
53
+ @format
54
+ L[1] = matrix see above (symmetric case, for >=2 arguments)
55
+ L[2] = matrix of kbase of Ext^1
56
+ L[3] = matrix of kbase of Ext^2
57
+ @end format
58
+ NOTE: printlevel >=1; shows what is going on.
59
+ printlevel >=2; shows result in another representation.
60
+ @* For computing cupproduct of M itself, apply proc to syz(M)!
61
+ EXAMPLE: example cup; shows examples
62
+ "
63
+ {
64
+ //---------- initialization ---------------------------------------------------
65
+ int i,j,k,f0,f1,f2,f3,e1,e2;
66
+ module M1,M2,A,B,C,ker,ima,ext1,ext2,ext10,ext20;
67
+ matrix cup[1][0];
68
+ matrix kb1,lift1,kb2,mA,mB,mC;
69
+ ideal tes1,tes2,null;
70
+ int p = printlevel-voice+3; // p=printlevel+1 (default: p=1)
71
+ //-----------------------------------------------------------------------------
72
+ //take a resolution of M<--F(0)<--- ... <---F(3)
73
+ //apply Hom(-,M) and compute the Ext's
74
+ //-----------------------------------------------------------------------------
75
+ list resM = nres(M,3);
76
+ M1 = resM[2];
77
+ M2 = resM[3];
78
+ f0 = nrows(M);
79
+ f1 = ncols(M);
80
+ f2 = ncols(M1);
81
+ f3 = ncols(M2);
82
+ tes1 = simplify(ideal(M),10);
83
+ tes2=simplify(ideal(M1),10);
84
+ if ((tes1[1]*tes2[1]==0) or (tes1[1]==1) or (tes2[1]==1))
85
+ {
86
+ dbprint(p,"// Ext == 0 , hence 'cup' is the zero-map");
87
+ return(@cup);
88
+ }
89
+ //------ compute Ext^1 --------------------------------------------------------
90
+ B = kohom(M,f2);
91
+ A = kontrahom(M1,f0);
92
+ C = intersect(A,B);
93
+ C = reduce(C,std(null));C = simplify(C,10);
94
+ ker = lift(A,C)+syz(A);
95
+ ima = kohom(M,f1);
96
+ ima = ima + kontrahom(M,f0);
97
+ ext1 = modulo(ker,ima);
98
+ ext10 = std(ext1);
99
+ e1 = vdim(ext10);
100
+ dbprint(p-1,"// vdim (Ext^1) = "+string(e1));
101
+ if (e1 < 0)
102
+ {
103
+ "// Ext^1 not of finite dimension";
104
+ return(cup);
105
+ }
106
+ kb1 = kbase(ext10);
107
+ kb1 = matrix(ker)*kb1;
108
+ dbprint(p-1,"// kbase of Ext^1(M,M)",
109
+ "// - the columns present the kbase elements in Hom(F(1),F(0))",
110
+ "// - F(*) a free resolution of M",kb1);
111
+
112
+ //------ compute the liftings of Ext^1 ----------------------------------------
113
+ mC = matrix(A)*kb1;
114
+ lift1 =lift(B,mC);
115
+ dbprint(p-1,"// lift kbase of Ext^1:",
116
+ "// - the columns present liftings of kbase elements into Hom(F(2),F(1))",
117
+ "// - F(*) a free resolution of M ",lift1);
118
+
119
+ //------ compute Ext^2 -------------------------------------------------------
120
+ B = kohom(M,f3);
121
+ A = kontrahom(M2,f0);
122
+ C = intersect(A,B);
123
+ C = reduce(C,std(null));C = simplify(C,10);
124
+ ker = lift(A,C)+syz(A);
125
+ ima = kohom(M,f2);
126
+ ima = ima + kontrahom(M1,f0);
127
+ ext2 = modulo(ker,ima);
128
+ ext20= std(ext2);
129
+ e2 = vdim(ext20);
130
+ if (e2<0)
131
+ {
132
+ "// Ext^2 not of finite dimension";
133
+ return(cup);
134
+ }
135
+ dbprint(p-1,"// vdim (Ext^2) = "+string(e2));
136
+ kb2 = kbase(ext20);
137
+ kb2 = matrix(ker)*kb2;
138
+ dbprint(p-1,"// kbase of Ext^2(M,M)",
139
+ "// - the columns present the kbase elements in Hom(F(2),F(0))",
140
+ "// - F(*) is a free resolution of M ",kb2);
141
+ //------- compute: cup-products of base-elements -----------------------------
142
+ for (i=1;i<=e1;i=i+1)
143
+ {
144
+ for (j=1;j<=e1;j=j+1)
145
+ {
146
+ mA = matrix(ideal(lift1[j]),f1,f2);
147
+ mB = matrix(ideal(kb1[i]),f0,f1);
148
+ mC = mB*mA;
149
+ if (size(#)==0)
150
+ { //non symmestric
151
+ mC = matrix(ideal(mC),f0*f2,1);
152
+ cup= concat(cup,mC);
153
+ }
154
+ else //symmetric version
155
+ {
156
+ if (j>=i)
157
+ {
158
+ if (j>i)
159
+ {
160
+ mA = matrix(ideal(lift1[i]),f1,f2);
161
+ mB = matrix(ideal(kb1[j]),f0,f1);
162
+ mC = mC+mB*mA;mC=(1/2)*mC;
163
+ }
164
+ mC = matrix(ideal(mC),f0*f2,1);
165
+ cup= concat(cup,mC);
166
+ }
167
+ }
168
+ }
169
+ }
170
+ dbprint(p-1,"// matrix of cup-products (in Ext^2)",cup,
171
+ "////// end level 2 //////");
172
+ //------- compute: presentation of base-elements -----------------------------
173
+ cup = lift(ker,cup);
174
+ cup = lift_kbase(cup,ext20);
175
+ if( p>2 )
176
+ {
177
+ "// the associated matrices of the bilinear mapping 'cup' ";
178
+ "// corresponding to the kbase elements of Ext^2(M,M) are shown,";
179
+ "// i.e. the rows of the final matrix are written as matrix of";
180
+ "// a bilinear form on Ext^1 x Ext^1";
181
+ matrix BL[e1][e1];
182
+ for (k=1;k<=e2;k=k+1)
183
+ {
184
+ "//-----component "+string(k)+":";
185
+ for (i=1;i<=e1;i=i+1)
186
+ {
187
+ for (j=1;j<=e1;j=j+1)
188
+ {
189
+ if (size(#)==0) { BL[i,j]=cup[k,j+e1*(i-1)]; }
190
+ else
191
+ {
192
+ if (i<=j)
193
+ {
194
+ BL[i,j]=cup[k,j+e1*(i-1)-binomial(i,2)];
195
+ BL[j,i]=BL[i,j];
196
+ }
197
+ }
198
+ }
199
+ }
200
+ print(BL);
201
+ }
202
+ "////// end level 3 //////";
203
+ }
204
+ if (size(#)>2) { return(cup,kb1,kb2);}
205
+ else {return(cup);}
206
+ }
207
+ example
208
+ {"EXAMPLE"; echo=2;
209
+ int p = printlevel;
210
+ ring rr = 32003,(x,y,z),(dp,C);
211
+ ideal I = x4+y3+z2;
212
+ qring o = std(I);
213
+ module M = [x,y,0,z],[y2,-x3,z,0],[z,0,-y,-x3],[0,z,x,-y2];
214
+ print(cup(M));
215
+ print(cup(M,1));
216
+ // 2nd EXAMPLE (shows what is going on)
217
+ printlevel = 3;
218
+ ring r = 0,(x,y),(dp,C);
219
+ ideal i = x2-y3;
220
+ qring q = std(i);
221
+ module M = [-x,y],[-y2,x];
222
+ print(cup(M));
223
+ printlevel = p;
224
+ }
225
+ ///////////////////////////////////////////////////////////////////////////////
226
+
227
+ proc cupproduct (module M,module N,module P,int p,int q,list #)
228
+ "USAGE: cupproduct(M,N,P,p,q[,any]); M,N,P modules, p,q integers
229
+ COMPUTE: cup-product Ext^p(M',N') x Ext^q(N',P') ---> Ext^(p+q)(M',P'),
230
+ where M':=R^m/M, if M in R^m, R basering (i.e. M':=coker(matrix(M)))
231
+ ASSUME: all Ext's are of finite dimension
232
+ RETURN: - if called with 5 arguments: matrix of the associated linear map
233
+ Ext^p (tensor) Ext^q --> Ext^(p+q), i.e. the columns of <matrix>
234
+ present the coordinates of the cup products (b_i & c_j) with respect
235
+ to a kbase of Ext^p+q (b_i resp. c_j are the chosen bases of Ext^p,
236
+ resp. Ext^q).@*
237
+ - if called with 6 arguments: list L,
238
+ @format
239
+ L[1] = matrix (see above)
240
+ L[2] = matrix of kbase of Ext^p(M',N')
241
+ L[3] = matrix of kbase of Ext^q(N',P')
242
+ L[4] = matrix of kbase of Ext^p+q(N',P')
243
+ @end format
244
+ NOTE: printlevel >=1; shows what is going on.
245
+ printlevel >=2; shows the result in another representation.@*
246
+ For computing the cupproduct of M,N itself, apply proc to syz(M),
247
+ syz(N)!
248
+ EXAMPLE: example cupproduct; shows examples
249
+ "
250
+ {
251
+ //---------- initialization ---------------------------------------------------
252
+ int e1,e2,e3,i,j,k,f0,f1,f2;
253
+ module M1,M2,N1,N2,P1,P2,A,B,C,ker,ima,extMN,extMN0,extMP,
254
+ extMP0,extNP,extNP0;
255
+ matrix cup[1][0];
256
+ matrix kbMN,kbMP,kbNP,lift1,mA,mB,mC;
257
+ ideal test1,test2,null;
258
+ int pp = printlevel-voice+3; // pp=printlevel+1 (default: p=1)
259
+ //-----------------------------------------------------------------------------
260
+ //compute resolutions of M and N
261
+ // M<--F(0)<--- ... <---F(p+q+1)
262
+ // N<--G(0)<--- ... <---G(q+1)
263
+ //-----------------------------------------------------------------------------
264
+ list resM = nres(M,p+q+1);
265
+ M1 = resM[p];
266
+ M2 = resM[p+1];
267
+ list resN = nres(N,q+1);
268
+ N1 = resN[q];
269
+ N2 = resN[q+1];
270
+ P1 = resM[p+q];
271
+ P2 = resM[p+q+1];
272
+ //-------test: Ext==0?---------------------------------------------------------
273
+ test1 = simplify(ideal(M1),10);
274
+ test2 = simplify(ideal(N),10);
275
+ if (test1[1]==0) { dbprint(pp,"//Ext(M,N)=0");return(cup); }
276
+ test1 = simplify(ideal(N1),10);
277
+ test2 = simplify(ideal(P),10);
278
+ if (test1[1]==0) { dbprint(pp,"//Ext(N,P)=0");return(cup); }
279
+ test1 = simplify(ideal(P1),10);
280
+ if (test1[1]==0) { dbprint(pp,"//Ext(M,P)=0");return(cup); }
281
+ //------ compute kbases of Ext's ---------------------------------------------
282
+ //------ Ext(M,N)
283
+ test1 = simplify(ideal(M2),10);
284
+ if (test1[1]==0) { ker = freemodule(ncols(M1)*nrows(N));}
285
+ else
286
+ {
287
+ A = kontrahom(M2,nrows(N));
288
+ B = kohom(N,ncols(M2));
289
+ C = intersect(A,B);
290
+ C = reduce(C,std(ideal(0)));C=simplify(C,10);
291
+ ker = lift(A,C)+syz(A);
292
+ }
293
+ ima = kohom(N,ncols(M1));
294
+ A = kontrahom(M1,nrows(N));
295
+ ima = ima+A;
296
+ extMN = modulo(ker,ima);
297
+ extMN0= std(extMN);
298
+ e1 = vdim(extMN0);
299
+ dbprint(pp-1,"// vdim Ext(M,N) = "+string(e1));
300
+ if (e1 < 0)
301
+ {
302
+ "// Ext(M,N) not of finite dimension";
303
+ return(cup);
304
+ }
305
+ kbMN = kbase(extMN0);
306
+ kbMN = matrix(ker)*kbMN;
307
+ dbprint(pp-1,"// kbase of Ext^p(M,N)",
308
+ "// - the columns present the kbase elements in Hom(F(p),G(0))",
309
+ "// - F(*),G(*) are free resolutions of M and N",kbMN);
310
+ //------- Ext(N,P)
311
+ test1 = simplify(ideal(N2),10);
312
+ if (test1[1]==0) { ker = freemodule(ncols(N1)*nrows(P)); }
313
+ else
314
+ {
315
+ A = kontrahom(N2,nrows(P));
316
+ B = kohom(P,ncols(N2));
317
+ C = intersect(A,B);
318
+ C = reduce(C,std(ideal(0)));C=simplify(C,10);
319
+ ker = lift(A,C)+syz(A);
320
+ }
321
+ ima = kohom(P,ncols(N1));
322
+ A = kontrahom(N1,nrows(P));
323
+ ima = ima+A;
324
+ extNP = modulo(ker,ima);
325
+ extNP0= std(extNP);
326
+ e2 = vdim(extNP0);
327
+ dbprint(pp-1,"// vdim Ext(N,P) = "+string(e2));
328
+ if (e2 < 0)
329
+ {
330
+ "// Ext(N,P) not of finite dimension";
331
+ return(cup);
332
+ }
333
+ kbNP = kbase(extNP0);
334
+ kbNP = matrix(ker)*kbNP;
335
+ dbprint(pp-1,"// kbase of Ext(N,P):",kbNP,
336
+ "// kbase of Ext^q(N,P)",
337
+ "// - the columns present the kbase elements in Hom(G(q),H(0))",
338
+ "// - G(*),H(*) are free resolutions of N and P",kbNP);
339
+
340
+ //------ Ext(M,P)
341
+ test1 = simplify(ideal(P2),10);
342
+ if (test1[1]==0) { ker = freemodule(ncols(P1)*nrows(P)); }
343
+ else
344
+ {
345
+ A = kontrahom(P2,nrows(P));
346
+ B = kohom(P,ncols(P2));
347
+ C = intersect(A,B);
348
+ C = reduce(C,std(ideal(0)));C=simplify(C,10);
349
+ ker = lift(A,C)+syz(A);
350
+ }
351
+ ima = kohom(P,ncols(P1));
352
+ A = kontrahom(P1,nrows(P));
353
+ ima = ima+A;
354
+ extMP = modulo(ker,ima);
355
+ extMP0= std(extMP);
356
+ e3 = vdim(extMP0);
357
+ dbprint(pp-1,"// vdim Ext(M,P) = "+string(e3));
358
+ if (e3 < 0)
359
+ {
360
+ "// Ext(M,P) not of finite dimension";
361
+ return(cup);
362
+ }
363
+ kbMP = kbase(extMP0);
364
+ kbMP = matrix(ker)*kbMP;
365
+ dbprint(pp-1,"// kbase of Ext^p+q(M,P)",
366
+ "// - the columns present the kbase elements in Hom(F(p+q),H(0))",
367
+ "// - F(*),H(*) are free resolutions of M and P",kbMP);
368
+ //----- lift kbase of Ext(M,N) ------------------------------------------------
369
+ lift1 = kbMN;
370
+ for (i=1;i<=q;i=i+1)
371
+ {
372
+ mA = kontrahom(resM[p+i],nrows(resN[i]));
373
+ mB = kohom(resN[i],ncols(resM[p+i]));
374
+ lift1 = lift(mB,mA*lift1);
375
+ }
376
+ dbprint(pp-1,"// lifting of kbase of Ext^p(M,N)",
377
+ "// - the columns present liftings of kbase elements"+
378
+ " in Hom(F(p+q),G(q))",lift1);
379
+ //------- compute: cup-products of base-elements -----------------------------
380
+ f0 = nrows(P);
381
+ f1 = ncols(N1);
382
+ f2 = ncols(resM[p+q]);
383
+ for (i=1;i<=e1;i=i+1)
384
+ {
385
+ for (j=1;j<=e2;j=j+1)
386
+ {
387
+ mA = matrix(ideal(lift1[j]),f1,f2);
388
+ mB = matrix(ideal(kbMP[i]),f0,f1);
389
+ mC = mB*mA;
390
+ mC = matrix(ideal(mC),f0*f2,1);
391
+ cup= concat(cup,mC);
392
+ }
393
+ }
394
+ dbprint(pp-1,"// matrix of cup-products (in Ext^p+q)",cup,
395
+ "////// end level 2 //////");
396
+ //------- compute: presentation of base-elements -----------------------------
397
+ cup = lift(ker,cup);
398
+ cup = lift_kbase(cup,extMP0);
399
+ //------- special output ------------------------------------------------------
400
+ if (pp>2)
401
+ {
402
+ "// the associated matrices of the bilinear mapping 'cup' ";
403
+ "// corresponding to the kbase elements of Ext^p+q(M,P) are shown,";
404
+ "// i.e. the rows of the final matrix are written as matrix of";
405
+ "// a bilinear form on Ext^p x Ext^q";
406
+ matrix BL[e1][e2];
407
+ for (k=1;k<=e3;k=k+1)
408
+ {
409
+ "//----component "+string(k)+":";
410
+ for (i=1;i<=e1;i=i+1)
411
+ {
412
+ for (j=1;j<=e2;j=j+1)
413
+ {
414
+ BL[i,j]=cup[k,j+e1*(i-1)];
415
+ }
416
+ }
417
+ print(BL);
418
+ }
419
+ "////// end level 3 //////";
420
+ }
421
+ if (size(#)) { return(cup,kbMN,kbNP,kbMP);}
422
+ else { return(cup); }
423
+ }
424
+ example
425
+ {"EXAMPLE"; echo=2;
426
+ int p = printlevel;
427
+ ring rr = 32003,(x,y,z),(dp,C);
428
+ ideal I = x4+y3+z2;
429
+ qring o = std(I);
430
+ module M = [x,y,0,z],[y2,-x3,z,0],[z,0,-y,-x3],[0,z,x,-y2];
431
+ print(cupproduct(M,M,M,1,3));
432
+ printlevel = 3;
433
+ list l = (cupproduct(M,M,M,1,3,"any"));
434
+ show(l[1]);show(l[2]);
435
+ printlevel = p;
436
+ }
437
+ ///////////////////////////////////////////////////////////////////////////////
438
+ static proc get_weight(vector t, intvec shifts)
439
+ {
440
+ int n = nrows(t);
441
+ for (int i = 1; i <= n; i++)
442
+ {
443
+ if (t[i] != 0)
444
+ {
445
+ return( deg(t[i]) + shifts[i]);
446
+ }
447
+ }
448
+ return(-1);
449
+ }
450
+
451
+ static proc get_list_of_weights(module M)
452
+ {
453
+ int r = ncols(M);
454
+ intvec shifts = attrib(M, "isHomog");
455
+ intvec weights = 0:r;
456
+ for (int i = 1; i <= r; i++)
457
+ {
458
+ weights[i] = get_weight(M[i], shifts);
459
+ }
460
+ return(weights);
461
+ }
462
+
463
+ proc Ext_R (intvec v, module M, list #)
464
+ "USAGE: Ext_R(v,M[,p]); v int resp. intvec , M module, p int
465
+ COMPUTE: A presentation of Ext^k(M',R); for k=v[1],v[2],..., M'=coker(M).
466
+ Let
467
+ @example
468
+ 0 <-- M' <-- F0 <-M-- F1 <-- F2 <-- ...
469
+ @end example
470
+ be a free resolution of M'. If
471
+ @example
472
+ 0 --> F0* -A1-> F1* -A2-> F2* -A3-> ...
473
+ @end example
474
+ is the dual sequence, Fi*=Hom(Fi,R), then Ext^k = ker(Ak+1)/im(Ak)
475
+ is presented as in the following exact sequences:
476
+ @example
477
+ R^p --syz(Ak+1)-> Fk* ---Ak+1----> Fk+1* ,
478
+ R^q ----Ext^k---> R^p --syz(Ak+1)-> Fk*/im(Ak).
479
+ @end example
480
+ Hence, Ext^k=modulo(syz(Ak+1),Ak) presents Ext^k(M',R).
481
+ RETURN: - module Ext, a presentation of Ext^k(M',R) if v is of type int@*
482
+ - a list of Ext^k (k=v[1],v[2],...) if v is of type intvec.@*
483
+ - In case of a third argument of type int return a list l:
484
+ @format
485
+ l[1] = module Ext^k resp. list of Ext^k
486
+ l[2] = SB of Ext^k resp. list of SB of Ext^k
487
+ l[3] = matrix resp. list of matrices, each representing a kbase of Ext^k
488
+ (if finite dimensional)
489
+ @end format
490
+ DISPLAY: printlevel >=0: (affine) dimension of Ext^k for each k (default)
491
+ printlevel >=1: Ak, Ak+1 and kbase of Ext^k in Fk*
492
+ NOTE: In order to compute Ext^k(M,R) use the command Ext_R(k,syz(M));@*
493
+ By default, the procedure uses the @code{mres} command. If called
494
+ with the additional parameter @code{\"sres\"}, the @code{sres} command
495
+ is used instead.@*
496
+ If the attribute @code{\"isHomog\"} has been set for the input module, it
497
+ is also set for the returned module (accordingly).
498
+ EXAMPLE: example Ext_R; shows an example
499
+ "
500
+ {
501
+ // In case M is known to be a SB, set attrib(M,"isSB",1); in order to
502
+ // avoid unnecessary SB computations
503
+
504
+ //------------ check for weight vector (graded case) -----------------------
505
+ int withWeight;
506
+ intvec weightM,weightR,ww;
507
+ if ( typeof(attrib(M,"isHomog"))!="string" )
508
+ {
509
+ weightM=attrib(M,"isHomog");
510
+ withWeight=1;
511
+ }
512
+
513
+ //------------ initialisation ----------------------------------------------
514
+ module m1t,m1,m2,m2t,ret,ret0,ker;
515
+ vector leadCol;
516
+ matrix kb;
517
+ module G;
518
+ list L1,L2,L3,L,K;
519
+ resolution resm2;
520
+ int j,k,max,ii,t1,t2,di,leadComp,shift;
521
+ intvec A1,A2,A3;
522
+ int s = size(v);
523
+ max = Max(v); // the maximum integer occurring in intvec v
524
+ int p = printlevel-voice+3; // p=printlevel+1 (default: p=1)
525
+ // --------------- Variante mit sres
526
+ for( ii=1; ii<=size(#); ii++ )
527
+ {
528
+ if (typeof(#[ii])=="int") { // return a list if t2=1
529
+ t2=1;
530
+ }
531
+ else {
532
+ if (typeof(#[ii])=="string") {
533
+ // NOTE: at this writing, sres does not return weights
534
+ if ( #[ii]=="sres" ) { t1=1; } // use sres instead of mres if t1=1
535
+ }
536
+ }
537
+ }
538
+
539
+ //----------------- compute resolution of coker(M) ----------------------------
540
+ if( max<0 )
541
+ {
542
+ dbprint(p,"// Ext^i=0 for i<0!");
543
+ module Result=[1];
544
+ if (withWeight==1) { attrib(Result,"isHomog",intvec(0)); }
545
+ if (s==1) {
546
+ if (t2==0) { return(Result); }
547
+ else { return( list(Result,Result,matrix(0)) ); }
548
+ }
549
+ list Out, KBOut;
550
+ for (j=1;j<=s;j++) {
551
+ Out[j] = Result;
552
+ KBOut[j] = matrix(0);
553
+ }
554
+ if (t2==0) { return(Out); }
555
+ else { return( list(Out,Out,KBOut) ); }
556
+ }
557
+ if( t1==1 )
558
+ { // compute resolution via sres command
559
+ if( attrib(M,"isSB")==0 ) {
560
+ M=std(M);
561
+ }
562
+ list resl = sres(M,max+1);
563
+ if (withWeight) {
564
+ // ****
565
+ // **** at this writing, sres does not return weights, we have to
566
+ // **** go through the resolution to compute them
567
+ // ****
568
+ attrib(resl,"isHomog",weightM); // weightM = weights of M
569
+ G=resl[1];
570
+ attrib(G,"isHomog",weightM);
571
+ resl[1]=G;
572
+ weightR=weightM;
573
+
574
+ for (j=2; j<=size(resl); j++) {
575
+ if (size(G)!=0) {
576
+ ww=0;
577
+ for (k=1; k<=ncols(G); k++) {
578
+ if (size(G[k])==0) { ww[k]=0; }
579
+ else {
580
+ leadCol = leadmonom(G[k]);
581
+ leadComp = nrows(leadCol);
582
+ ww[k] = deg(leadCol)+weightR[leadComp];
583
+ }
584
+ }
585
+ G=resl[j];
586
+ attrib(G,"isHomog",ww);
587
+ resl[j]=G;
588
+ weightR=ww;
589
+ }
590
+ }
591
+ }
592
+ }
593
+ else { list resl = mres(M,max+1);
594
+ if ((withWeight) and (size(M)==0)) {
595
+ // ***** At this writing: special treatment for zero module needed
596
+ G=resl[1];
597
+ attrib(G,"isHomog",weightM);
598
+ resl[1]=G;
599
+ }
600
+ }
601
+ for( ii=1; ii<=s; ii++ )
602
+ {
603
+ //----------------- apply Hom(_,R) at k-th place -----------------------------
604
+ k=v[ii];
605
+ dbprint(p-1,"// Computing Ext^"+string(k)+":");
606
+ if( k<0 ) // Ext^k=0 for negative k
607
+ {
608
+ dbprint(p-1,"// Ext^i=0 for i<0!");
609
+ ret = gen(1);
610
+ ret0 = std(ret);
611
+ if (withWeight==1) {
612
+ attrib(ret,"isHomog",intvec(0));
613
+ attrib(ret0,"isHomog",intvec(0));
614
+ }
615
+ L1[ii] = ret;
616
+ L2[ii] = ret0;
617
+ L3[ii] = matrix(kbase(ret0));
618
+ di=dim(ret0);
619
+ dbprint(p,"// dimension of Ext^"+string(k)+": "+string(di));
620
+ if (di==0)
621
+ {
622
+ dbprint(p,"// vdim of Ext^"+string(k)+": "+string(vdim(ret0)));
623
+ }
624
+ dbprint(p,"");
625
+ }
626
+ else
627
+ {
628
+ m2t = resl[k+1];
629
+ m2 = transpose(m2t);
630
+ if ((typeof(attrib(m2t,"isHomog"))!="string" ) && (withWeight))
631
+ {
632
+ // ------------- compute weights for dual -----------------------------
633
+ if (k == 0)
634
+ {
635
+ weightR = attrib(m2t, "isHomog");
636
+ }
637
+ else
638
+ {
639
+ weightR = get_list_of_weights(resl[k]);
640
+ }
641
+ // --------------------------------------------------------------------
642
+ // *** set correct weights (at this writing, shift in resolution
643
+ // *** is not considered when defining the weights for the
644
+ // *** modules in the resolution):
645
+ A1=attrib(M,"isHomog");
646
+ A2=attrib(resl[1],"isHomog");
647
+ shift=A1[1]-A2[1];
648
+ for (j=1; j<=size(weightR); j++) { weightR[j]=weightR[j]+shift; }
649
+ attrib(m2t,"isHomog",weightR);
650
+ // --------------------------------------------------------------------
651
+ ww=0;
652
+ for (j=1; j<=nrows(m2); j++) {
653
+ if (size(m2t[j])==0) { ww[j]=0; }
654
+ else {
655
+ leadCol = leadmonom(m2t[j]);
656
+ leadComp = nrows(leadCol);
657
+ ww[j] = deg(leadCol)+weightR[leadComp];
658
+ }
659
+ }
660
+ attrib(m2,"isHomog",-ww); // dualize --> negative weights
661
+ // --------------------------------------------------------------------
662
+ // *** the following should be replaced by the syz command,
663
+ // *** but syz forgets weights.....
664
+ resm2 = nres(m2,2);
665
+ ker = resm2[2];
666
+ if ((size(ker)>0) and (size(m2)>0)) {
667
+ // ------------------------------------------------------------------
668
+ // *** set correct weights (at this writing, shift in resolution
669
+ // *** is not considered when defining the weights for the
670
+ // *** modules in the resolution):
671
+ A1=attrib(resm2,"isHomog");
672
+ A2=attrib(resm2[1],"isHomog");
673
+ A3=attrib(ker,"isHomog");
674
+ shift=A1[1]-A2[1];
675
+ for (j=1; j<=size(A3); j++) { A3[j]=A3[j]+shift; }
676
+ // *** set correct weights where weights are undetermined due to
677
+ // *** zero columns in m2 (read weights from m2t)
678
+ for (j=1; j<=ncols(m2); j++) {
679
+ if (size(m2[j])==0) { A3[j]=-weightR[j]; }
680
+ }
681
+ attrib(ker,"isHomog",A3);
682
+ // ------------------------------------------------------------------
683
+ }
684
+ }
685
+ else {
686
+ ker = syz(m2);
687
+ }
688
+
689
+ if( k==0 ) { matrix MMM1[ncols(m2)][1];
690
+ m1=MMM1;
691
+ }
692
+ else { // k>0
693
+ m1t = resl[k];
694
+ m1 = transpose(resl[k]);
695
+ if ((typeof(attrib(m1t,"isHomog"))!="string" ) && (withWeight)) {
696
+ // ------------- compute weights for dual -----------------------------
697
+ if (k == 1)
698
+ {
699
+ weightR = attrib(resl[k], "isHomog");
700
+ }
701
+ else
702
+ {
703
+ weightR = get_list_of_weights(resl[k - 1]);
704
+ }
705
+ // ------------------------------------------------------------------
706
+ // *** set correct weights (at this writing, shift in resolution
707
+ // *** is not considered when defining the weights for the
708
+ // *** modules in the resolution):
709
+ A1=attrib(M,"isHomog");
710
+ A2=attrib(resl[1],"isHomog");
711
+ shift=A1[1]-A2[1];
712
+ for (j=1; j<=size(weightR); j++) { weightR[j]=weightR[j]+shift; }
713
+ attrib(m1t,"isHomog",weightR);
714
+ // ------------------------------------------------------------------
715
+ ww=0;
716
+ for (j=1; j<=nrows(m1); j++) {
717
+ if (size(m1t[j])==0) { ww[j]=0; }
718
+ else {
719
+ leadCol = leadmonom(m1t[j]);
720
+ leadComp = nrows(leadCol);
721
+ ww[j] = deg(leadCol)+weightR[leadComp];
722
+ }
723
+ }
724
+ attrib(m1,"isHomog",-ww); // dualize --> negative weights
725
+ }
726
+ }
727
+ //----------------- presentation of ker(m2)/im(m1) ---------------------
728
+ if ((k==0) and (size(M)==0)) {
729
+ ret = M;
730
+ if (withWeight) { attrib(ret,"isHomog",-weightM); }
731
+ }
732
+ else {
733
+ ret = modulo(ker,m1);
734
+ }
735
+ dbprint(p-1,
736
+ "// Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of M,",
737
+ "// then F"+string(k)+"*-->F"+string(k+1)+"* is given by:",m2,
738
+ "// and F"+string(k-1)+"*-->F"+string(k)+"* is given by:",m1,"");
739
+ ret0 = std(ret);
740
+
741
+ di=dim(ret0);
742
+ dbprint(p,"// dimension of Ext^"+string(k)+": "+string(di));
743
+ if (di==0)
744
+ {
745
+ dbprint(p,"// vdim of Ext^"+string(k)+": "+string(vdim(ret0)));
746
+ }
747
+ dbprint(p,"");
748
+ if( t2 )
749
+ {
750
+ if( vdim(ret0)>=0 )
751
+ {
752
+ kb = kbase(ret0);
753
+ if ( size(ker)!=0 ) { kb = matrix(ker)*kb; }
754
+ dbprint(p-1,
755
+ "// columns of matrix are kbase of Ext^"+string(k)+" in F"
756
+ +string(k)+"*:",kb,"");
757
+ L3[ii] = kb;
758
+ }
759
+ L2[ii] = ret0;
760
+ }
761
+ L1[ii] = ret;
762
+ }
763
+ }
764
+ if( t2 )
765
+ {
766
+ if( s>1 ) { L = L1,L2,L3; return(L); }
767
+ else { L = ret,ret0,kb; return(L); }
768
+ }
769
+ else
770
+ {
771
+ if( s>1 ) { return(L1); }
772
+ else { return(ret); }
773
+ }
774
+ }
775
+ example
776
+ {"EXAMPLE:"; echo=2;
777
+ int p = printlevel;
778
+ printlevel = 1;
779
+ ring r = 0,(x,y,z),dp;
780
+ ideal i = x2y,y2z,z3x;
781
+ module E = Ext_R(1,i); //computes Ext^1(r/i,r)
782
+ is_zero(E);
783
+
784
+ qring R = std(x2+yz);
785
+ intvec v = 0,2;
786
+ printlevel = 2; //shows what is going on
787
+ ideal i = x,y,z; //computes Ext^i(r/(x,y,z),r/(x2+yz)), i=0,2
788
+ list L = Ext_R(v,i,1); //over the qring R=r/(x2+yz), std and kbase
789
+ printlevel = p;
790
+ }
791
+ ///////////////////////////////////////////////////////////////////////////////
792
+
793
+ proc Ext (intvec v, module M, module N, list #)
794
+ "USAGE: Ext(v,M,N[,any]); v int resp. intvec, M,N modules
795
+ COMPUTE: A presentation of Ext^k(M',N'); for k=v[1],v[2],... where
796
+ M'=coker(M) and N'=coker(N). Let
797
+ @example
798
+ 0 <-- M' <-- F0 <-M-- F1 <-- F2 <--... ,
799
+ 0 <-- N' <-- G0 <--N- G1
800
+ @end example
801
+ be a free resolution of M', resp. a presentation of N'. Consider
802
+ the commutative diagram
803
+ @example
804
+ 0 0 0
805
+ |^ |^ |^
806
+ --> Hom(Fk-1,N') -Ak-> Hom(Fk,N') -Ak+1-> Hom(Fk+1,N')
807
+ |^ |^ |^
808
+ --> Hom(Fk-1,G0) -Ak-> Hom(Fk,G0) -Ak+1-> Hom(Fk+1,G0)
809
+ |^ |^
810
+ |C |B
811
+ Hom(Fk,G1) ------> Hom(Fk+1,G1)
812
+
813
+ (Ak,Ak+1 induced by M and B,C induced by N).
814
+ @end example
815
+ Let K=modulo(Ak+1,B), J=module(Ak)+module(C) and Ext=modulo(K,J),
816
+ then we have exact sequences
817
+ @example
818
+ R^p --K-> Hom(Fk,G0) --Ak+1-> Hom(Fk+1,G0)/im(B),
819
+
820
+ R^q -Ext-> R^p --K-> Hom(Fk,G0)/(im(Ak)+im(C)).
821
+ @end example
822
+ Hence, Ext presents Ext^k(M',N').
823
+ RETURN: - module Ext, a presentation of Ext^k(M',N') if v is of type int@*
824
+ - a list of Ext^k (k=v[1],v[2],...) if v is of type intvec.@*
825
+ - In case of a third argument of any type return a list l:
826
+ @format
827
+ l[1] = module Ext/list of Ext^k
828
+ l[2] = SB of Ext/list of SB of Ext^k
829
+ l[3] = matrix/list of matrices, each representing a kbase of Ext^k
830
+ (if finite dimensional)
831
+ @end format
832
+ DISPLAY: printlevel >=0: dimension, vdim of Ext^k for each k (default).
833
+ @* printlevel >=1: matrices Ak, Ak+1 and kbase of Ext^k in Hom(Fk,G0)
834
+ (if finite dimensional)
835
+ NOTE: In order to compute Ext^k(M,N) use the command Ext(k,syz(M),syz(N));
836
+ or: list P=mres(M,2); list Q=mres(N,2); Ext(k,P[2],Q[2]);
837
+ EXAMPLE: example Ext; shows an example
838
+ "
839
+ {
840
+ //---------- initialisation ---------------------------------------------------
841
+ int k,max,ii,l,row,col,di;
842
+ module A,B,C,D,M1,M2,N1,ker,imag,extMN,extMN0;
843
+ matrix kb;
844
+ list L1,L2,L3,L,resM,K;
845
+ ideal test1;
846
+ intmat Be;
847
+ int s = size(v);
848
+ max = Max(v); // the maximum integer occurring in intvec v
849
+ int p = printlevel-voice+3; // p=printlevel+1 (default: p=1)
850
+ //---------- test: coker(N)=basering, coker(N)=0 ? ----------------------------
851
+ if( max<0 ) { dbprint(p,"// Ext^i=0 for i<0!"); return([1]); }
852
+ N1 = std(N);
853
+ if( size(N1)==0 ) //coker(N)=basering, in this case proc Ext_R is faster
854
+ { printlevel=printlevel+1;
855
+ if( size(#)==0 )
856
+ { def E = Ext_R(v,M);
857
+ printlevel=printlevel-1;
858
+ return(E);
859
+ }
860
+ else
861
+ { def E = Ext_R(v,M,#[1]);
862
+ printlevel=printlevel-1;
863
+ return(E);
864
+ }
865
+ }
866
+ if( dim(N1)==-1 ) //coker(N)=0, all Ext-groups are 0
867
+ { dbprint(p-1,"2nd module presents 0, hence Ext^k=0, for all k");
868
+ for( ii=1; ii<=s; ii++ )
869
+ { k=v[ii];
870
+ extMN = gen(1);
871
+ extMN0 = std(extMN);
872
+ L1[ii] = extMN;
873
+ L2[ii] = extMN0;
874
+ L3[ii] = matrix(kbase(extMN0));
875
+ di=dim(extMN0);
876
+ dbprint(p,"// dimension of Ext^"+string(k)+": "+string(di));
877
+ if (di==0)
878
+ {
879
+ dbprint(p,"// vdim of Ext^"+string(k)+": "+string(vdim(extMN0)));
880
+ }
881
+ dbprint(p,"");
882
+ }
883
+ }
884
+ else
885
+ {
886
+ if( size(N1) < size(N) ) { N=N1;}
887
+ row = nrows(N);
888
+ //---------- resolution of M -------------------------------------------------
889
+ resM = mres(M,max+1);
890
+ for( ii=1; ii<=s; ii++ )
891
+ { k=v[ii];
892
+ if( k<0 ) // Ext^k is 0 for negative k
893
+ { dbprint(p-1,"// Ext^k=0 for k<0!");
894
+ extMN = gen(1);
895
+ extMN0 = std(extMN);
896
+ L1[ii] = extMN;
897
+ L2[ii] = extMN0;
898
+ L3[ii] = matrix(kbase(extMN0));
899
+ di=dim(extMN0);
900
+ dbprint(p,"// dimension of Ext^"+string(k)+": "+string(di));
901
+ if (di==0)
902
+ {
903
+ dbprint(p,"// vdim of Ext^"+string(k)+": "
904
+ +string(vdim(extMN0)));
905
+ }
906
+ dbprint(p,"");
907
+ }
908
+ else
909
+ { M2 = resM[k+1];
910
+ if( k==0 ) { M1=0; }
911
+ else { M1 = resM[k]; }
912
+ col = nrows(M2);
913
+ D = kohom(N,col);
914
+ //---------- computing homology ----------------------------------------------
915
+ imag = kontrahom(M1,row);
916
+ A = kontrahom(M2,row);
917
+ B = kohom(N,ncols(M2));
918
+ ker = modulo(A,B);
919
+ imag = imag,D;
920
+ extMN = modulo(ker,imag);
921
+ dbprint(p-1,"// Computing Ext^"+string(k)+
922
+ " (help Ext; gives an explanation):",
923
+ "// Let 0<--coker(M)<--F0<--F1<--F2<--... be a resolution of coker(M),",
924
+ "// and 0<--coker(N)<--G0<--G1 a presentation of coker(N),",
925
+ "// then Hom(F"+string(k)+",G0)-->Hom(F"+string(k+1)+
926
+ ",G0) is given by:",A,
927
+ "// and Hom(F"+string(k-1)+",G0) + Hom(F"+string(k)+",G1)-->Hom(F"
928
+ +string(k)+",G0) is given by:",imag,"");
929
+ extMN0 = std(extMN);
930
+ di=dim(extMN0);
931
+ dbprint(p,"// dimension of Ext^"+string(k)+": "+string(di));
932
+ if (di==0)
933
+ {
934
+ dbprint(p,"// vdim of Ext^"+string(k)+": "
935
+ +string(vdim(extMN0)));
936
+ }
937
+ dbprint(p,"");
938
+
939
+ //---------- more information -------------------------------------------------
940
+ if( size(#)>0 )
941
+ { if( vdim(extMN0) >= 0 )
942
+ { kb = kbase(extMN0);
943
+ if ( size(ker)!=0) { kb = matrix(ker)*kb; }
944
+ dbprint(p-1,"// columns of matrix are kbase of Ext^"+
945
+ string(k)+" in Hom(F"+string(k)+",G0)",kb,"");
946
+ if( p>0 )
947
+ { for (l=1;l<=ncols(kb);l=l+1)
948
+ {
949
+ "// element",l,"of kbase of Ext^"+string(k)+" in Hom(F"+string(k)+",G0)";
950
+ "// as matrix: F"+string(k)+"-->G0";
951
+ print(matrix(ideal(kb[l]),row,col));
952
+ }
953
+ "";
954
+ }
955
+ L3[ii] = matrix(kb);
956
+ }
957
+ L2[ii] = extMN0;
958
+ }
959
+ L1[ii] = extMN;
960
+ }
961
+ }
962
+ }
963
+ if( size(#) )
964
+ { if( s>1 ) { L = L1,L2,L3; return(L); }
965
+ else { L = extMN,extMN0,matrix(kb); return(L); }
966
+ }
967
+ else
968
+ { if( s>1 ) { return(L1); }
969
+ else { return(extMN); }
970
+ }
971
+ }
972
+ example
973
+ {"EXAMPLE:"; echo=2;
974
+ int p = printlevel;
975
+ printlevel = 1;
976
+ ring r = 0,(x,y),dp;
977
+ ideal i = x2-y3;
978
+ ideal j = x2-y5;
979
+ list E = Ext(0..2,i,j); // Ext^k(r/i,r/j) for k=0,1,2 over r
980
+ qring R = std(i);
981
+ ideal j = fetch(r,j);
982
+ module M = [-x,y],[-y2,x];
983
+ printlevel = 2;
984
+ module E1 = Ext(1,M,j); // Ext^1(R^2/M,R/j) over R=r/i
985
+ list l = Ext(4,M,M,1); // Ext^4(R^2/M,R^2/M) over R=r/i
986
+ printlevel = p;
987
+ }
988
+ ///////////////////////////////////////////////////////////////////////////////
989
+
990
+ proc Hom (module M, module N, list #)
991
+ "USAGE: Hom(M,N,[any]); M,N=modules
992
+ COMPUTE: A presentation of Hom(M',N'), M'=coker(M), N'=coker(N) as follows:
993
+ let
994
+ @example
995
+ F1 --M-> F0 -->M' --> 0, G1 --N-> G0 --> N' --> 0
996
+ @end example
997
+ be presentations of M' and N'. Consider
998
+ @example
999
+ 0 0
1000
+ |^ |^
1001
+ 0 --> Hom(M',N') ----> Hom(F0,N') ----> Hom(F1,N')
1002
+ |^ |^
1003
+ (A: induced by M) Hom(F0,G0) --A-> Hom(F1,G0)
1004
+ |^ |^
1005
+ (B,C:induced by N) |C |B
1006
+ Hom(F0,G1) ----> Hom(F1,G1)
1007
+
1008
+ @end example
1009
+ Let D=modulo(A,B) and Hom=modulo(D,C), then we have exact sequences
1010
+ @example
1011
+ R^p --D-> Hom(F0,G0) --A-> Hom(F1,G0)/im(B),
1012
+
1013
+ R^q -Hom-> R^p --D-> Hom(F0,G0)/im(C) --A-> Hom(F1,G0)/im(B).
1014
+ @end example
1015
+ Hence Hom presents Hom(M',N')
1016
+ RETURN: module Hom, a presentation of Hom(M',N'), resp., in case of
1017
+ 3 arguments, a list l (of size <=3):
1018
+ @format
1019
+ - l[1] = Hom
1020
+ - l[2] = SB of Hom
1021
+ - l[3] = kbase of coker(Hom) (if finite dimensional, not 0),
1022
+ represented by elements in Hom(F0,G0) via mapping D
1023
+ @end format
1024
+ DISPLAY: printlevel >=0: (affine) dimension of Hom (default)
1025
+ @* printlevel >=1: D and C and kbase of coker(Hom) in Hom(F0,G0)
1026
+ @* printlevel >=2: elements of kbase of coker(Hom) as matrix :F0-->G0
1027
+ NOTE: DISPLAY is as described only for a direct call of 'Hom'. Calling 'Hom'
1028
+ from another proc has the same effect as decreasing printlevel by 1.
1029
+ EXAMPLE: example Hom; shows examples
1030
+ "
1031
+ {
1032
+ //---------- initialisation ---------------------------------------------------
1033
+ int l,p,di;
1034
+ matrix kb;
1035
+ module A,B,C,D,homMN,homMN0;
1036
+ list L;
1037
+ //---------- computation of Hom -----------------------------------------------
1038
+ B = kohom(N,ncols(M));
1039
+ A = kontrahom(M,nrows(N));
1040
+ C = kohom(N,nrows(M));
1041
+ D = modulo(A,B);
1042
+ homMN = modulo(D,C);
1043
+ homMN0= std(homMN);
1044
+ p = printlevel-voice+3; // p=printlevel+1 (default: p=1)
1045
+ di= dim(homMN0);
1046
+ dbprint(p,"// dimension of Hom: "+string(di));
1047
+ if (di==0)
1048
+ {
1049
+ dbprint(p,"// vdim of Hom: "+string(vdim(homMN0)));
1050
+ }
1051
+ dbprint(p,"");
1052
+ dbprint(p-1,
1053
+ "// given F1 --M-> F0 -->M'--> 0 and G1 --N-> G0 -->N'--> 0,",
1054
+ "// show D = ker( Hom(F0,G0) --> Hom(F1,G0)/im(Hom(F1,G1)->Hom(F1,G0)) )",D,
1055
+ "// show C = im ( Hom(F0,G1) --> Hom(F0,G0) )",C,"");
1056
+ //---------- extra output if size(#)>0 ----------------------------------------
1057
+ if( size(#)>0 )
1058
+ {
1059
+ if( vdim(homMN0)>0 )
1060
+ {
1061
+ kb = kbase(homMN0);
1062
+ kb = matrix(D)*kb;
1063
+ if( p>2 )
1064
+ {
1065
+ for (l=1;l<=ncols(kb);l=l+1)
1066
+ {
1067
+ "// element",l,"of kbase of Hom in Hom(F0,G0) as matrix: F0-->G0:";
1068
+ print(matrix(ideal(kb[l]),nrows(N),nrows(M)));
1069
+ }
1070
+ }
1071
+ else
1072
+ {
1073
+ dbprint(p-1,"// columns of matrix are kbase of Hom in Hom(F0,G0)",
1074
+ kb);
1075
+ }
1076
+ L=homMN,homMN0,kb;
1077
+ return(L);
1078
+ }
1079
+ L=homMN,homMN0;
1080
+ return(L);
1081
+ }
1082
+ return(homMN);
1083
+ }
1084
+ example
1085
+ {"EXAMPLE:"; echo = 2;
1086
+ int p = printlevel;
1087
+ printlevel= 1; //in 'example proc' printlevel has to be increased by 1
1088
+ ring r = 0,(x,y),dp;
1089
+ ideal i = x2-y3,xy;
1090
+ qring q = std(i);
1091
+ ideal i = fetch(r,i);
1092
+ module M = [-x,y],[-y2,x],[x3];
1093
+ module H = Hom(M,i);
1094
+ print(H);
1095
+
1096
+ printlevel= 2;
1097
+ list L = Hom(M,i,1);"";
1098
+
1099
+ printlevel=1;
1100
+ ring s = 3,(x,y,z),(c,dp);
1101
+ ideal i = jacob(ideal(x2+y5+z4));
1102
+ qring rq=std(i);
1103
+ matrix M[2][2]=xy,x3,5y,4z,x2;
1104
+ matrix N[3][2]=x2,x,y3,3xz,x2z,z;
1105
+ print(M);
1106
+ print(N);
1107
+ list l=Hom(M,N,1);
1108
+ printlevel = p;
1109
+ }
1110
+ ///////////////////////////////////////////////////////////////////////////////
1111
+
1112
+ proc homology (matrix A,matrix B,module M,module N,list #)
1113
+ "USAGE: homology(A,B,M,N);
1114
+ COMPUTE: Let M and N be submodules of R^m and R^n presenting M'=R^m/M, N'=R^n/N
1115
+ (R=basering) and let A,B matrices inducing maps
1116
+ @example
1117
+ R^k --A--> R^m --B--> R^n.
1118
+ @end example
1119
+ Compute a presentation of the module
1120
+ @example
1121
+ ker(B)/im(A) := ker(M'/im(A) --B--> N'/im(BM)+im(BA)).
1122
+ @end example
1123
+ If B induces a map M'-->N' (i.e BM=0) and if im(A) is contained in
1124
+ ker(B) (that is, BA=0) then ker(B)/im(A) is the homology of the
1125
+ complex
1126
+ @example
1127
+ R^k--A-->M'--B-->N'.
1128
+ @end example
1129
+ RETURN: module H, a presentation of ker(B)/im(A).
1130
+ NOTE: homology returns a free module of rank m if ker(B)=im(A).
1131
+ EXAMPLE: example homology; shows examples
1132
+ "
1133
+ {
1134
+ module ker,ima;
1135
+ ker = modulo(B,N);
1136
+ ima = A,M;
1137
+ return(modulo(ker,ima));
1138
+ }
1139
+ example
1140
+ {"EXAMPLE"; echo=2;
1141
+ ring r;
1142
+ ideal id=maxideal(4); // GB
1143
+ qring qr=id;
1144
+ module N=maxideal(3)*freemodule(2);
1145
+ module M=maxideal(2)*freemodule(2);
1146
+ module B=[2x,0],[x,y],[z2,y];
1147
+ module A=M;
1148
+ module H=homology(A,B,M,N);
1149
+ H=std(H);
1150
+ // dimension of homology:
1151
+ dim(H);
1152
+ // vector space dimension:
1153
+ vdim(H);
1154
+
1155
+ ring s=0,x,ds;
1156
+ qring qs=std(x4);
1157
+ module A=[x];
1158
+ module B=A;
1159
+ module M=[x3];
1160
+ module N=M;
1161
+ homology(A,B,M,N);
1162
+ }
1163
+ //////////////////////////////////////////////////////////////////////////////
1164
+
1165
+ proc hom_kernel (matrix A,module M,module N)
1166
+ "USAGE: hom_kernel(A,M,N);
1167
+ COMPUTE: Let M and N be submodules of R^m and R^n, presenting M'=R^m/M,
1168
+ N'=R^n/N (R=basering), and let A:R^m-->R^n be a matrix inducing a
1169
+ map A':M'-->N'. Then ker(A,M,N); computes a presentation K of
1170
+ ker(A') as in the commutative diagram:
1171
+ @example
1172
+ ker(A') ---> M' --A'--> N'
1173
+ |^ |^ |^
1174
+ | | |
1175
+ R^r ---> R^m --A--> R^n
1176
+ |^ |^ |^
1177
+ |K |M |N
1178
+ | | |
1179
+ R^s ---> R^p -----> R^q
1180
+ @end example
1181
+ RETURN: module K, a presentation of ker(A':coker(M)->coker(N)).
1182
+ EXAMPLE: example hom_kernel; shows examples.
1183
+ "
1184
+ {
1185
+ module M1 = modulo(A,N);
1186
+ return(modulo(M1,M));
1187
+ }
1188
+ example
1189
+ {"EXAMPLE"; echo=2;
1190
+ ring r;
1191
+ module N=[2x,x],[0,y];
1192
+ module M=maxideal(1)*freemodule(2);
1193
+ matrix A[2][3]=2x,0,x,y,z2,y;
1194
+ module K=hom_kernel(A,M,N);
1195
+ // dimension of kernel:
1196
+ dim(std(K));
1197
+ // vector space dimension of kernel:
1198
+ vdim(std(K));
1199
+ print(K);
1200
+ }
1201
+ ///////////////////////////////////////////////////////////////////////////////
1202
+
1203
+ proc kohom (matrix M, int j)
1204
+ "USAGE: kohom(A,k); A=matrix, k=integer
1205
+ RETURN: matrix Hom(R^k,A), i.e. let A be a matrix defining a map F1-->F2
1206
+ of free R-modules, then the matrix of Hom(R^k,F1)-->Hom(R^k,F2)
1207
+ is computed (R=basering).
1208
+ EXAMPLE: example kohom; shows an example.
1209
+ "
1210
+ {
1211
+ if (j==1)
1212
+ { return(M);}
1213
+ if (j>1)
1214
+ { return(tensor(M,diag(1,j))); }
1215
+ else { return(0);}
1216
+ }
1217
+ example
1218
+ {"EXAMPLE:"; echo=2;
1219
+ ring r;
1220
+ matrix n[2][3]=x,y,5,z,77,33;
1221
+ print(kohom(n,3));
1222
+ }
1223
+ ///////////////////////////////////////////////////////////////////////////////
1224
+
1225
+ proc kontrahom (matrix M, int j)
1226
+ "USAGE: kontrahom(A,k); A=matrix, k=integer
1227
+ RETURN: matrix Hom(A,R^k), i.e. let A be a matrix defining a map F1-->F2 of
1228
+ free R-modules, then the matrix of Hom(F2,R^k)-->Hom(F1,R^k) is
1229
+ computed (R=basering).
1230
+ EXAMPLE: example kontrahom; shows an example.
1231
+ "
1232
+ {
1233
+ if (j==1)
1234
+ { return(transpose(M));}
1235
+ if (j>1)
1236
+ { return(transpose(tensor(diag(1,j),M)));}
1237
+ else { return(0);}
1238
+ }
1239
+ example
1240
+ {"EXAMPLE:"; echo=2;
1241
+ ring r;
1242
+ matrix n[2][3]=x,y,5,z,77,33;
1243
+ print(kontrahom(n,3));
1244
+ }
1245
+ ///////////////////////////////////////////////////////////////////////////////
1246
+ ///////////////////////////////////////////////////////////////////////////////
1247
+
1248
+ proc tensorMod(module Phi, module Psi)
1249
+ "USAGE: tensorMod(M,N); M,N modules
1250
+ COMPUTE: presentation matrix A of the tensor product T of the modules
1251
+ M'=coker(M), N'=coker(N): if matrix(M) defines a map M: R^r-->R^s and
1252
+ matrix(N) defines a map N: R^p-->R^q, then A defines a presentation
1253
+ @example
1254
+ R^(sp+rq) --A-> R^(sq) --> T --> 0 .
1255
+ @end example
1256
+ RETURN: matrix A satisfying coker(A) = tensorprod(coker(M),coker(N)) .
1257
+ EXAMPLE: example tensorMod; shows an example.
1258
+ "
1259
+ {
1260
+ int s=nrows(Phi);
1261
+ int q=nrows(Psi);
1262
+ matrix A=tensor(unitmat(s),Psi);
1263
+ matrix B=tensor(Phi,unitmat(q));
1264
+ matrix R=concat(A,B);
1265
+ return(R);
1266
+ }
1267
+ example
1268
+ {"EXAMPLE:"; echo=2;
1269
+ ring A=0,(x,y,z),dp;
1270
+ matrix M[3][3]=1,2,3,4,5,6,7,8,9;
1271
+ matrix N[2][2]=x,y,0,z;
1272
+ print(M);
1273
+ print(N);
1274
+ print(tensorMod(M,N));
1275
+ }
1276
+ ///////////////////////////////////////////////////////////////////////////////
1277
+ proc Tor(intvec v, module M, module N, list #)
1278
+ "USAGE: Tor(v,M,N[,any]); v int resp. intvec, M,N modules
1279
+ COMPUTE: a presentation of Tor_k(M',N'), for k=v[1],v[2],... , where
1280
+ M'=coker(M) and N'=coker(N): let
1281
+ @example
1282
+ 0 <-- M' <-- G0 <-M-- G1
1283
+ 0 <-- N' <-- F0 <--N- F1 <-- F2 <--...
1284
+ @end example
1285
+ be a presentation of M', resp. a free resolution of N', and consider
1286
+ the commutative diagram
1287
+ @example
1288
+ 0 0 0
1289
+ |^ |^ |^
1290
+ Tensor(M',Fk+1) -Ak+1-> Tensor(M',Fk) -Ak-> Tensor(M',Fk-1)
1291
+ |^ |^ |^
1292
+ Tensor(G0,Fk+1) -Ak+1-> Tensor(G0,Fk) -Ak-> Tensor(G0,Fk-1)
1293
+ |^ |^
1294
+ |C |B
1295
+ Tensor(G1,Fk) ----> Tensor(G1,Fk-1)
1296
+
1297
+ (Ak,Ak+1 induced by N and B,C induced by M).
1298
+ @end example
1299
+ Let K=modulo(Ak,B), J=module(C)+module(Ak+1) and Tor=modulo(K,J),
1300
+ then we have exact sequences
1301
+ @example
1302
+ R^p --K-> Tensor(G0,Fk) --Ak-> Tensor(G0,Fk-1)/im(B),
1303
+
1304
+ R^q -Tor-> R^p --K-> Tensor(G0,Fk)/(im(C)+im(Ak+1)).
1305
+ @end example
1306
+ Hence, Tor presents Tor_k(M',N').
1307
+ RETURN: - if v is of type int: module Tor, a presentation of Tor_k(M',N');@*
1308
+ - if v is of type intvec: a list of Tor_k(M',N') (k=v[1],v[2],...);@*
1309
+ - in case of a third argument of any type: list l with
1310
+ @format
1311
+ l[1] = module Tor/list of Tor_k(M',N'),
1312
+ l[2] = SB of Tor/list of SB of Tor_k(M',N'),
1313
+ l[3] = matrix/list of matrices, each representing a kbase of Tor_k(M',N')
1314
+ (if finite dimensional), or 0.
1315
+ @end format
1316
+ DISPLAY: printlevel >=0: (affine) dimension of Tor_k for each k (default).
1317
+ @* printlevel >=1: matrices Ak, Ak+1 and kbase of Tor_k in Tensor(G0,Fk)
1318
+ (if finite dimensional).
1319
+ NOTE: In order to compute Tor_k(M,N) use the command Tor(k,syz(M),syz(N));
1320
+ or: list P=mres(M,2); list Q=mres(N,2); Tor(k,P[2],Q[2]);
1321
+ EXAMPLE: example Tor; shows an example
1322
+ {
1323
+ //---------- initialisation ---------------------------------------------------
1324
+ int k,max,ii,l,row,col,di;
1325
+ module A,B,C,D,N1,N2,M1,ker,imag,Im,Im1,Im2,f,torMN,torMN0;
1326
+ matrix kb;
1327
+ list L1,L2,L3,L,resN,K;
1328
+ ideal test1;
1329
+ intmat Be;
1330
+ int s = size(v);
1331
+ max = Max(v); // maximum integer occurring in intvec v
1332
+ int p = printlevel-voice+3; // p=printlevel+1 (default: p=1)
1333
+
1334
+ //---------- test: coker(M)=basering, coker(M)=0 ? ----------------------------
1335
+ if( max<0 ) { dbprint(p,"// Tor_i=0 for i<0!"); return([1]); }
1336
+ M1 = std(M);
1337
+
1338
+ if( size(M1)==0 or size(N)==0 ) // coker(M)=basering ==> Tor_i=0 for i>0
1339
+ {
1340
+ dbprint(p-1,"// one of the modules M',N' is free, hence Tor_i=0 for i<>0");
1341
+ for( ii=1; ii<=s; ii++ )
1342
+ {
1343
+ k=v[ii];
1344
+ if (k==0) { torMN=module(tensorMod(M1,N)); }
1345
+ else { torMN = gen(1); }
1346
+ torMN0 = std(torMN);
1347
+ L1[ii] = torMN;
1348
+ L2[ii] = torMN0;
1349
+ L3[ii] = matrix(kbase(torMN0));
1350
+ di=dim(torMN0);
1351
+ dbprint(p,"// dimension of Tor_"+string(k)+": "+string(di));
1352
+ if (di==0)
1353
+ {
1354
+ dbprint(p,"// vdim of Tor_"+string(k)+": "
1355
+ +string(vdim(torMN0)));
1356
+ }
1357
+ dbprint(p,"");
1358
+ }
1359
+
1360
+ if( size(#) )
1361
+ { if( s>1 ) { L = L1,L2,L3; return(L); }
1362
+ else { L = torMN,torMN0,L3[1]; return(L); }
1363
+ }
1364
+ else
1365
+ { if( s>1 ) { return(L1); }
1366
+ else { return(torMN); }
1367
+ }
1368
+ }
1369
+
1370
+ if( dim(M1)==-1 ) // coker(M)=0, all Tor's are 0
1371
+ { dbprint(p-1,"2nd module presents 0, hence Tor_k=0, for all k");
1372
+ for( ii=1; ii<=s; ii++ )
1373
+ { k=v[ii];
1374
+ torMN = gen(1);
1375
+ torMN0 = std(torMN);
1376
+ L1[ii] = torMN;
1377
+ L2[ii] = torMN0;
1378
+ L3[ii] = matrix(kbase(torMN0));
1379
+ di=dim(torMN0);
1380
+ dbprint(p,"// dimension of Tor_"+string(k)+": "+string(di));
1381
+ if (di==0)
1382
+ {
1383
+ dbprint(p,"// vdim of Tor_"+string(k)+": "
1384
+ +string(vdim(torMN0)));
1385
+ }
1386
+ dbprint(p,"");
1387
+ }
1388
+ }
1389
+ else
1390
+ {
1391
+ if( size(M1) < size(M) ) { M=M1;}
1392
+ row = nrows(M);
1393
+ //---------- resolution of N -------------------------------------------------
1394
+ resN = mres(N,max+1);
1395
+ for( ii=1; ii<=s; ii++ )
1396
+ { k=v[ii];
1397
+ if( k<0 ) // Tor_k is 0 for negative k
1398
+ { dbprint(p-1,"// Tor_k=0 for k<0!");
1399
+ torMN = gen(1);
1400
+ torMN0 = std(torMN);
1401
+ L1[ii] = torMN;
1402
+ L2[ii] = torMN0;
1403
+ L3[ii] = matrix(kbase(torMN0));
1404
+ di=dim(torMN0);
1405
+ dbprint(p,"// dimension of Tor_"+string(k)+": "+string(di));
1406
+ if (di==0)
1407
+ {
1408
+ dbprint(p,"// vdim of Tor_"+string(k)+": "
1409
+ +string(vdim(torMN0)));
1410
+ }
1411
+ dbprint(p,"");
1412
+ }
1413
+ else
1414
+ {
1415
+ N2 = resN[k+1];
1416
+ if( k==0 ) { torMN=module(tensorMod(M,N)); }
1417
+ else
1418
+ {
1419
+ N1 = resN[k];
1420
+ col = ncols(N1);
1421
+
1422
+ //---------- computing homology ----------------------------------------------
1423
+ imag = tensor(unitmat(nrows(N1)),M);
1424
+ f = tensor(matrix(N1),unitmat(row));
1425
+ Im1 = tensor(unitmat(col),M);
1426
+ Im2 = tensor(matrix(N2),unitmat(row));
1427
+ ker = modulo(f,imag);
1428
+ Im = Im2,Im1;
1429
+ torMN = modulo(ker,Im);
1430
+ dbprint(p-1,"// Computing Tor_"+string(k)+
1431
+ " (help Tor; gives an explanation):",
1432
+ "// Let 0 <- coker(M) <- G0 <-M- G1 be the present. of coker(M),",
1433
+ "// and 0 <- coker(N) <- F0 <-N- F1 <- F2 <- ... a resolution of",
1434
+ "// coker(N), then Tensor(G0,F"+string(k)+")-->Tensor(G0,F"+
1435
+ string(k-1)+") is given by:",f,
1436
+ "// and Tensor(G0,F"+string(k+1)+") + Tensor(G1,F"+string(k)+
1437
+ ")-->Tensor(G0,F"+string(k)+") is given by:",Im,"");
1438
+ }
1439
+
1440
+ torMN0 = std(torMN);
1441
+ di=dim(torMN0);
1442
+ dbprint(p,"// dimension of Tor_"+string(k)+": "+string(di));
1443
+ if (di==0)
1444
+ {
1445
+ dbprint(p,"// vdim of Tor_"+string(k)+": "
1446
+ +string(vdim(torMN0)));
1447
+ }
1448
+ dbprint(p,"");
1449
+
1450
+ //---------- more information -------------------------------------------------
1451
+ if( size(#)>0 )
1452
+ { if( vdim(torMN0) >= 0 )
1453
+ { kb = kbase(torMN0);
1454
+ if ( size(ker)!=0) { kb = matrix(ker)*kb; }
1455
+ dbprint(p-1,"// columns of matrix are kbase of Tor_"+
1456
+ string(k)+" in Tensor(G0,F"+string(k)+")",kb,"");
1457
+ L3[ii] = matrix(kb);
1458
+ }
1459
+ L2[ii] = torMN0;
1460
+ }
1461
+ L1[ii] = torMN;
1462
+ }
1463
+ }
1464
+ }
1465
+ if( size(#) )
1466
+ { if( s>1 ) { L = L1,L2,L3; return(L); }
1467
+ else { L = torMN,torMN0,matrix(kb); return(L); }
1468
+ }
1469
+ else
1470
+ { if( s>1 ) { return(L1); }
1471
+ else { return(torMN); }
1472
+ }
1473
+ }
1474
+ example
1475
+ {"EXAMPLE:"; echo=2;
1476
+ int p = printlevel;
1477
+ printlevel = 1;
1478
+ ring r = 0,(x,y),dp;
1479
+ ideal i = x2,y;
1480
+ ideal j = x;
1481
+ list E = Tor(0..2,i,j); // Tor_k(r/i,r/j) for k=0,1,2 over r
1482
+
1483
+ qring R = std(i);
1484
+ ideal j = fetch(r,j);
1485
+ module M = [x,0],[0,x];
1486
+ printlevel = 2;
1487
+ module E1 = Tor(1,M,j); // Tor_1(R^2/M,R/j) over R=r/i
1488
+
1489
+ list l = Tor(3,M,M,1); // Tor_3(R^2/M,R^2/M) over R=r/i
1490
+ printlevel = p;
1491
+ }
1492
+ ///////////////////////////////////////////////////////////////////////////////
1493
+ proc fitting(module M, int n)
1494
+ "USAGE: fitting (M,n); M module, n int
1495
+ RETURN: ideal, (standard basis of) n-th Fitting ideal of M'=coker(M).
1496
+ EXAMPLE: example fitting; shows an example
1497
+ "
1498
+ {
1499
+ n=nrows(M)-n;
1500
+ if(n<=0){return(ideal(1));}
1501
+ if((n>nrows(M))||(n>ncols(M))){return(ideal(0));}
1502
+ return(std(minor(M,n)));
1503
+ }
1504
+ example
1505
+ {"EXAMPLE:"; echo=2;
1506
+ ring R=0,x(0..4),dp;
1507
+ matrix M[2][4]=x(0),x(1),x(2),x(3),x(1),x(2),x(3),x(4);
1508
+ print(M);
1509
+ fitting(M,-1);
1510
+ fitting(M,0);
1511
+ fitting(M,1);
1512
+ fitting(M,2);
1513
+ }
1514
+ ///////////////////////////////////////////////////////////////////////////////
1515
+ proc isLocallyFree(matrix S, int r)
1516
+ "USAGE: isLocallyFree(M,r); M module, r int
1517
+ RETURN: 1 if M'=coker(M) is locally free of constant rank r;@*
1518
+ 0 if this is not the case.
1519
+ EXAMPLE: example isLocallyFree; shows an example.
1520
+ "
1521
+ {
1522
+ ideal F=fitting(S,r);
1523
+ ideal G=fitting(S,r-1);
1524
+ if((deg(F[1])==0)&&(size(G)==0)){return(1);}
1525
+ return(0);
1526
+ }
1527
+ example
1528
+ {"EXAMPLE:"; echo=2;
1529
+ ring R=0,(x,y,z),dp;
1530
+ matrix M[2][3]; // the presentation matrix
1531
+ M=x-1,y-1,z,y-1,x-2,x;
1532
+ ideal I=fitting(M,0); // 0-th Fitting ideal of coker(M)
1533
+ qring Q=I;
1534
+ matrix M=fetch(R,M);
1535
+ isLocallyFree(M,1); // as R/I-module, coker(M) is locally free of rk 1
1536
+ isLocallyFree(M,0);
1537
+ }
1538
+ ///////////////////////////////////////////////////////////////////////////////
1539
+ proc flatteningStrat (module M)
1540
+ "USAGE: flatteningStrat(M); M module
1541
+ RETURN: list of ideals.
1542
+ The list entries L[1],...,L[r] describe the flattening stratification
1543
+ of M'=coker(M): setting L[0]=0, L[r+1]=1, the flattening
1544
+ stratification is given by the open sets Spec(A/V(L[i-1])) \ V(L[i]),
1545
+ i=1,...,r+1 (A = basering).
1546
+ NOTE: for more information see the book 'A Singular Introduction to
1547
+ Commutative Algebra' (by Greuel/Pfister, Springer 2002).
1548
+ EXAMPLE: example flatteningStrat; shows an example
1549
+ "
1550
+ {
1551
+ list l;
1552
+ int v,w;
1553
+ ideal F;
1554
+ while(1)
1555
+ {
1556
+ F=fitting(M,w); // fitting returns a GB
1557
+ if(F[1]==1){return(l);}
1558
+ if(size(F)!=0){v++;l[v]=F;}
1559
+ w++;
1560
+ }
1561
+ return(l);
1562
+ }
1563
+ example
1564
+ {"EXAMPLE:"; echo=2;
1565
+ ring A = 0,x(0..4),dp;
1566
+ // presentation matrix:
1567
+ matrix M[2][4] = x(0),x(1),x(2),x(3),x(1),x(2),x(3),x(4);
1568
+ list L = flatteningStrat(M);
1569
+ L;
1570
+ }
1571
+ ///////////////////////////////////////////////////////////////////////////////
1572
+ proc isFlat(module M)
1573
+ "USAGE: isFlat(M); M module
1574
+ RETURN: 1 if M'=coker(M) is flat;@*
1575
+ 0 if this is not the case.
1576
+ EXAMPLE: example isFlat; shows an example.
1577
+ "
1578
+ {
1579
+ if (size(ideal(M))==0) {return(1);}
1580
+ int w;
1581
+ ideal F=fitting(M,0);
1582
+ while(size(F)==0)
1583
+ {
1584
+ w++;
1585
+ F=fitting(M,w); // fitting returns a GB
1586
+ }
1587
+ if (deg(F[1])==0) {return(1);}
1588
+ return(0);
1589
+ }
1590
+ example
1591
+ {"EXAMPLE:"; echo=2;
1592
+ ring A = 0,(x,y),dp;
1593
+ matrix M[3][3] = x-1,y,x,x,x+1,y,x2,xy+x+1,x2+y;
1594
+ print(M);
1595
+ isFlat(M); // coker(M) is not flat over A=Q[x,y]
1596
+
1597
+ qring B = std(x2+x-y); // the ring B=Q[x,y]/<x2+x-y>
1598
+ matrix M = fetch(A,M);
1599
+ isFlat(M); // coker(M) is flat over B
1600
+
1601
+ setring A;
1602
+ qring C = std(x2+x+y); // the ring C=Q[x,y]/<x2+x+y>
1603
+ matrix M = fetch(A,M);
1604
+ isFlat(M); // coker(M) is not flat over C
1605
+ }
1606
+ ///////////////////////////////////////////////////////////////////////////////
1607
+ proc flatLocus(module M)
1608
+ "USAGE: flatLocus(M); M module
1609
+ RETURN: ideal I, s.th. complement of V(I) is flat locus of coker(M).
1610
+ NOTE: computation is based on Fitting ideals;@*
1611
+ output is not radical (in general)
1612
+ EXAMPLE: example flatLocus; shows an example
1613
+ "
1614
+ {
1615
+ if (size(ideal(M))==0) {return(ideal(1));}
1616
+ int v,w;
1617
+ ideal F=fitting(M,0);
1618
+ while(size(F)==0)
1619
+ {
1620
+ w++;
1621
+ F=fitting(M,w);
1622
+ }
1623
+ if(size(ideal(basering))>0)
1624
+ {
1625
+ for(v=w+1;v<=nrows(M);v++)
1626
+ {
1627
+ F=F+intersect(fitting(M,v),quotient(ideal(0),fitting(M,v-1)));
1628
+ }
1629
+ }
1630
+ return(interred(F));
1631
+ }
1632
+ example
1633
+ {"EXAMPLE:"; echo=2;
1634
+ ring R=0,(x,y,z),dp;
1635
+ matrix M[2][3]=x,y,z,0,x3,z3;
1636
+ ideal I=flatLocus(M); // coker(M) is flat outside V(x,yz)
1637
+ I; // computed ideal not radical
1638
+ ideal J=radical(I);
1639
+ J;
1640
+
1641
+ qring r=std(J);
1642
+ matrix M=fetch(r,M);
1643
+ flatLocus(M); // coker(M) is flat over Spec(Q[x,y,z]/<x,yz>)
1644
+
1645
+ isFlat(M); // flatness test
1646
+ }
1647
+ ///////////////////////////////////////////////////////////////////////////////
1648
+ proc isReg(ideal I, module N)
1649
+ "USAGE: isReg(I,M); I ideal, M module
1650
+ RETURN: 1 if given (ordered) list of generators for I is coker(M)-sequence;@*
1651
+ 0 if this is not the case.
1652
+ EXAMPLE: example isReg; shows an example.
1653
+ "
1654
+ {
1655
+ int n=nrows(N);
1656
+ int i;
1657
+ while(i<ncols(I))
1658
+ {
1659
+ i++;
1660
+ N=std(N);
1661
+ if(size(reduce(quotient(N,I[i]),N,5))!=0){return(0);}
1662
+ N=N+I[i]*freemodule(n);
1663
+ }
1664
+ if (size(reduce(freemodule(n),std(N),5))==0){return(0);}
1665
+ return(1);
1666
+ }
1667
+ example
1668
+ {"EXAMPLE:"; echo=2;
1669
+ ring R = 0,(x,y,z),dp;
1670
+ ideal I = x*(y-1),y,z*(y-1);
1671
+ isReg(I,0); // given list of generators is Q[x,y,z]-sequence
1672
+
1673
+ I = x*(y-1),z*(y-1),y; // change sorting of generators
1674
+ isReg(I,0);
1675
+
1676
+ ring r = 0,(x,y,z),ds; // local ring
1677
+ ideal I=fetch(R,I);
1678
+ isReg(I,0); // result independent of sorting of generators
1679
+ }
1680
+
1681
+ ///////////////////////////////////////////////////////////////////////////////
1682
+ // the following static procedures are used by KoszulHomology:
1683
+ // * binom_int (binomial coeff. as integer, or -1 if too large)
1684
+ // * basisNumber
1685
+ // * basisElement
1686
+ // for details, see 'A Singular Introduction to Commutative Algebra' (by
1687
+ // Greuel/Pfister, Springer 2002), Chapter 7
1688
+
1689
+ static proc binom_int(int n, int p)
1690
+ {
1691
+ bigint s = binomial(n,p);
1692
+ int a=int(s);
1693
+ if ((s!=0)&&(a==0)) { return(-1); }
1694
+ return(a);
1695
+ }
1696
+
1697
+ static proc basisNumber(int n,intvec v)
1698
+ {
1699
+ int p=size(v);
1700
+ if(p==1){return(v[1]);}
1701
+ int j=n-1;
1702
+ int b;
1703
+ while(j>=n-v[1]+1)
1704
+ {
1705
+ b=b+binom_int(j,p-1);
1706
+ j--;
1707
+ }
1708
+ intvec w=v-v[1];
1709
+ w=w[2..size(w)];
1710
+ b=b+basisNumber(n-v[1],w);
1711
+ return(b);
1712
+ }
1713
+
1714
+ static proc basisElement(int n,int p,int N)
1715
+ {
1716
+ if(p==1){return(N);}
1717
+ int s,R;
1718
+ while(R<N)
1719
+ {
1720
+ s++;
1721
+ R=R+binom_int(n-s,p-1);
1722
+ }
1723
+ R=N-R+binom_int(n-s,p-1);
1724
+ intvec v=basisElement(n-s,p-1,R);
1725
+ intvec w=s,v+s;
1726
+ return(w);
1727
+ }
1728
+
1729
+ proc KoszulMap(ideal x,int p)
1730
+ {
1731
+ return(koszul(p,x)); // compatibility
1732
+ }
1733
+ ///////////////////////////////////////////////////////////////////////////////
1734
+
1735
+ proc KoszulHomology(ideal x, module M, int p)
1736
+ "USAGE: KoszulHomology(I,M,p); I ideal, M module, p int
1737
+ COMPUTE: A presentation of the p-th Koszul homology module H_p(f_1,...,f_k;M'),
1738
+ where M'=coker(M) and f_1,...,f_k are the given (ordered list
1739
+ of non-zero) generators of the ideal I.
1740
+ The computed presentation is minimized via prune.
1741
+ In particular, if H_p(f_1,...,f_k;M')=0 then the return value is 0.
1742
+ RETURN: module H, s.th. coker(H) = H_p(f_1,...,f_k;M').
1743
+ NOTE: size of input ideal has to be <= 20.
1744
+ EXAMPLE: example KoszulHomology; shows an example.
1745
+ {
1746
+ x=simplify(x,2);
1747
+ int n = size(x);
1748
+ if (n==0)
1749
+ {
1750
+ ERROR("// KoszulHomology only for non-zero ideals");
1751
+ }
1752
+ if (n>20)
1753
+ {
1754
+ ERROR("// too many generators in input ideal");
1755
+ }
1756
+ if (p>n)
1757
+ {
1758
+ module hom=0;
1759
+ return(hom);
1760
+ }
1761
+
1762
+ int a = binom_int(n,p-1); // n over p-1 independent of char(basering)
1763
+ int b = binom_int(n,p);
1764
+
1765
+ matrix N = matrix(M);
1766
+ module ker= freemodule(nrows(N));
1767
+ if(p!=0)
1768
+ {
1769
+ module im= tensor(unitmat(a),N);
1770
+ module f = tensor(koszul(p,x),unitmat(nrows(N)));
1771
+ ker = modulo(f,im);
1772
+ }
1773
+ module im1 = tensor(unitmat(b),N);
1774
+ module im2 = tensor(koszul(p+1,x),unitmat(nrows(N)));
1775
+ module hom = modulo(ker,im1+im2);
1776
+ hom = prune(hom);
1777
+ return(hom);
1778
+ }
1779
+ example
1780
+ {"EXAMPLE:"; echo=2;
1781
+ ring R=0,x(1..3),dp;
1782
+ ideal x=maxideal(1);
1783
+ module M=0;
1784
+ KoszulHomology(x,M,0); // H_0(x,R), x=(x_1,x_2,x_3)
1785
+
1786
+ KoszulHomology(x,M,1); // H_1(x,R), x=(x_1,x_2,x_3)
1787
+
1788
+ qring S=std(x(1)*x(2));
1789
+ module M=0;
1790
+ ideal x=maxideal(1);
1791
+ KoszulHomology(x,M,1);
1792
+
1793
+ KoszulHomology(x,M,2);
1794
+ }
1795
+ ///////////////////////////////////////////////////////////////////////////////
1796
+ proc depth(module M,ideal #)
1797
+ "USAGE: depth(M,[I]); M module, I ideal
1798
+ RETURN: int,
1799
+ - if called with 1 argument: the depth of M'=coker(M) w.r.t. the
1800
+ ideal generated by the variables in the basering
1801
+ (the maximal ideal, if the ring is local)@*
1802
+ - if called with 2 arguments: the depth of M'=coker(M) w.r.t. the
1803
+ ideal I.
1804
+ NOTE: Not checked: if I*M'==M', depth is infinity.
1805
+ NOTE: procedure makes use of KoszulHomology.
1806
+ EXAMPLE: example depth; shows an example.
1807
+ "
1808
+ {
1809
+ ideal m=maxideal(1);
1810
+ int i;
1811
+ ideal I;
1812
+
1813
+ if (size(#)==0)
1814
+ {
1815
+ I=m;
1816
+ }
1817
+ else
1818
+ {
1819
+ I=simplify(#,2);
1820
+ }
1821
+
1822
+ //if (size(reduce(M,std(I*M),5))==0) {return (-1); }
1823
+ int n=size(I);
1824
+ while(i<n/*size(I)*/)
1825
+ {
1826
+ i++;
1827
+ if(size(KoszulHomology(I,M,i))==0){return(n/*size(I)*/-i+1);}
1828
+ }
1829
+ return(0);
1830
+ }
1831
+ example
1832
+ {"EXAMPLE:"; echo=2;
1833
+ ring R=0,(x,y,z),dp;
1834
+ ideal I=x2,xy,yz;
1835
+ module M=0;
1836
+ depth(M,I); // depth(<x2,xy,yz>,Q[x,y,z])
1837
+ M=[1];
1838
+ depth(M); // depth(0)
1839
+ ring r=0,(x,y,z),ds; // local ring
1840
+ matrix M[2][2]=x,xy,1+yz,0;
1841
+ print(M);
1842
+ depth(M); // depth(maxideal,coker(M))
1843
+ ideal I=x;
1844
+ depth(M,I); // depth(<x>,coker(M))
1845
+ I=x+z;
1846
+ depth(M,I); // depth(<x+z>,coker(M))
1847
+ }
1848
+
1849
+ ///////////////////////////////////////////////////////////////////////////////
1850
+ proc isCM(module M)
1851
+ "USAGE: isCM(M); M module
1852
+ RETURN: 1 if M'=coker(M) is Cohen-Macaulay;@*
1853
+ 0 if this is not the case.
1854
+ ASSUME: basering is local.
1855
+ EXAMPLE: example isCM; shows an example
1856
+ "
1857
+ {
1858
+ // test if basering is local:
1859
+ ideal m=maxideal(1);
1860
+ int i;
1861
+ poly f=1;
1862
+ for (i=1; i<=size(m); i++)
1863
+ {
1864
+ f=f+m[i];
1865
+ }
1866
+ if (ord(f)>0)
1867
+ {
1868
+ print("// basering must be local -- result has no meaning");
1869
+ return(0);
1870
+ }
1871
+
1872
+ return(depth(M)==dim(std(Ann(M))));
1873
+ }
1874
+ example
1875
+ {"EXAMPLE:"; echo=2;
1876
+ ring R=0,(x,y,z),ds; // local ring R = Q[x,y,z]_<x,y,z>
1877
+ module M=xz,yz,z2;
1878
+ isCM(M); // test if R/<xz,yz,z2> is Cohen-Macaulay
1879
+
1880
+ M=x2+y2,z7; // test if R/<x2+y2,z7> is Cohen-Macaulay
1881
+ isCM(M);
1882
+ }
1883
+
1884
+ proc canonMap(list #)
1885
+ "USAGE: canonMap(id); id= ideal/module,
1886
+ RETURN: a list L, the kernel in two different representations and
1887
+ @* the cokernel of the canonical map
1888
+ @* M ---> Ext^c_R(Ext^c_R(M,R),R) given by presentations
1889
+ @* Here M is the R-module (R=basering) given by the presentation
1890
+ @* defined by id, i.e. M=R/id resp. M=R^n/id
1891
+ @* c is the codimension of M
1892
+ @* L[1] is the preimage of the kernel in R resp. R^n
1893
+ @* L[2] is a presentation of the kernel
1894
+ @* L[3] is a presentation of the cokernel
1895
+ EXAMPLE: example canonMap; shows an example
1896
+ "
1897
+ {
1898
+ module M=#[1];
1899
+ int c=nvars(basering)-dim(std(M));
1900
+ if(c==0)
1901
+ {
1902
+ module K=syz(transpose(M));
1903
+ module Ke=syz(transpose(K));
1904
+ module Co=modulo(syz(transpose(syz(K))),transpose(K));
1905
+ }
1906
+ else
1907
+ {
1908
+ int i;
1909
+ resolution F=mres(M,c+1);
1910
+ module K=syz(transpose(F[c+1]));
1911
+ K=simplify(reduce(K,std(transpose(F[c]))),2);
1912
+ module A=modulo(K,transpose(F[c]));
1913
+ resolution G=nres(A,c+1);
1914
+ for(i=1;i<=c;i++)
1915
+ {
1916
+ K=lift(transpose(F[c-i+1]),matrix(K)*matrix(G[i]));
1917
+ }
1918
+ module Ke=modulo(transpose(K),transpose(G[c]));
1919
+ module Co=modulo(syz(transpose(G[c+1])),transpose(K)+transpose(G[c]));
1920
+ }
1921
+ return(list(Ke,prune(modulo(Ke,M)),prune(Co)));
1922
+
1923
+ }
1924
+ example
1925
+ { "EXAMPLE:"; echo = 2;
1926
+ ring s=0,(x,y),dp;
1927
+ ideal i = x,y;
1928
+ canonMap(i);
1929
+ ring R = 0,(x,y,z,w),dp;
1930
+ ideal I1 = x,y;
1931
+ ideal I2 = z,w;
1932
+ ideal I = intersect(I1,I2);
1933
+ canonMap(I);
1934
+ module M = syz(I);
1935
+ canonMap(M);
1936
+ ring S = 0,(x,y,z,t),Wp(3,4,5,1);
1937
+ ideal I = x-t3,y-t4,z-t5;
1938
+ ideal J = eliminate(I,t);
1939
+ ring T = 0,(x,y,z),Wp(3,4,5);
1940
+ ideal p = imap(S,J);
1941
+ ideal p2 = p^2;
1942
+ canonMap(p2);
1943
+ }
1944
+
1945
+ // taken from qhmoduli.lib
1946
+ static proc Max(def data)
1947
+ "USAGE: Max(data); intvec/list of integers
1948
+ PURPOSE: find the maximal integer contained in 'data'
1949
+ RETURN: list
1950
+ ASSUME: 'data' contains only integers and is not empty
1951
+ "
1952
+ {
1953
+ int i;
1954
+ int max = data[1];
1955
+
1956
+ for(i = size(data); i>1;i--)
1957
+ {
1958
+ if(data[i] > max) { max = data[i]; }
1959
+ }
1960
+ return(max);
1961
+ }
1962
+ example
1963
+ {"EXAMPLE:"; echo = 2;
1964
+ Max(list(1,2,3));
1965
+ }