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,1462 @@
1
+ ////////////////////////////////////////////////////////////////
2
+ version="version fpaprops.lib 4.1.2.0 Feb_2019 "; // $Id: dcaac0a927db1f910242dcdef38c20f6035e2c18 $
3
+ category="Noncommutative";
4
+ info="
5
+ LIBRARY: fpaprops.lib Algorithmic ring-theoretic properties of finitely presented algebras (Letterplace)
6
+ AUTHORS: Karim Abou Zeid, karim.abou.zeid at rwth-aachen.de
7
+
8
+ Support: Project II.6 in the transregional collaborative research centre
9
+ SFB-TRR 195 'Symbolic Tools in Mathematics and their Application' of the German DFG
10
+
11
+ OVERVIEW:
12
+ In this library, algorithms for computing various ring-theoretic properties of
13
+ finitely presented algebras are implemented.
14
+ Applicability: Letterplace rings.
15
+
16
+ REFERENCES:
17
+ Huishi Li: Groebner bases in ring theory. World Scientific, 2010.
18
+
19
+ KEYWORDS: finitely presented algebra; ring theory; Letterplace Groebner basis;
20
+ growth of algebra; Gelfand-Kirillov dimension; global homological dimension; semi-prime ideal; Ufnarovski graph
21
+
22
+ SEE ALSO: fpadim_lib, freegb_lib
23
+
24
+ PROCEDURES:
25
+ lpNoetherian(<GB>); check whether A/<LM(GB)> is (left/right) Noetherian
26
+ lpIsSemiPrime(<GB>); check whether A/<LM(GB)> is semi-prime
27
+ lpIsPrime(<GB>); check whether A/<LM(GB)> is prime
28
+ lpGkDim(<GB>); alias for dim(<GB>)
29
+ teach_lpGkDim(<GB>); deprecated, kept for teaching purposes. use dim(<GB>) instead.
30
+ lpGlDimBound(<GB>); compute an upper bound for the global dimension of A/<GB>
31
+ lpSubstitute(); substitute a variable with polynomials (ring homomorphism)
32
+ lpCalcSubstDegBound(); utility for lpSubstitute
33
+ ";
34
+
35
+ LIB "fpadim.lib";
36
+
37
+ /* very fast and cheap test of consistency and functionality
38
+ DO NOT make it static !
39
+ after adding the new proc, add it here */
40
+ proc tstfpaprops()
41
+ {
42
+ example lpNoetherian;
43
+ example lpIsSemiPrime;
44
+ example lpIsPrime;
45
+ example lpGlDimBound;
46
+ example lpGkDim;
47
+ example lpSubstitute;
48
+ example lpCalcSubstDegBound;
49
+ };
50
+
51
+
52
+ ////////////////////////////////////////////////////////////////////
53
+ proc lpNoetherian(ideal G)
54
+ "USAGE: lpNoetherian(G); G an ideal in a Letterplace ring
55
+ RETURN: int
56
+ 0 not Noetherian
57
+ 1 left Noetherian
58
+ 2 right Noetherian
59
+ 3 Noetherian
60
+ 4 weak Noetherian
61
+ PURPOSE: Check whether the monomial algebra A/<LM(G)> is (left/right) noetherian
62
+ ASSUME: - basering is a Letterplace ring
63
+ - G is a Groebner basis
64
+ THEORY: lpNoetherian works with the monomial algebra A/<LM(G)>.
65
+ If it gives an affirmative answer for one of the properties, then it
66
+ holds for both A/<LM(G)> and A/<G>. However, a negative answer applies
67
+ only to A/<LM(G)> and not necessarily to A/<G>.
68
+ NOTE: Weak Noetherian means that two-sided ideals in A/<LM(G)> satisfy
69
+ the acc (ascending chain condition).
70
+ "
71
+ {
72
+ G = lead(G);
73
+ G = simplify(G, 2+4+8);
74
+
75
+ // check special case 1
76
+ int l = 0;
77
+ for (int i = 1; i <= size(G); i++) {
78
+ // find the max degree in G
79
+ int d = deg(G[i]);
80
+ if (d > l) {
81
+ l = d;
82
+ }
83
+
84
+ // also if G is the whole ring
85
+ if (leadmonom(G[i]) == 1) {
86
+ ERROR("Noetherianity not defined for 0-ring")
87
+ }
88
+ kill d;
89
+ } kill i;
90
+ // if longest word has length 1 we handle it as a special case
91
+ if (l == 1) {
92
+ int n = lpVarBlockSize(basering); // variable count
93
+ int ncgenCount = lpNcgenCount(basering);
94
+ int k = size(G);
95
+ if (k == n - ncgenCount) { // only the field left
96
+ return(3); // every field is noetherian
97
+ }
98
+ if (k == n - ncgenCount - 1) { // V = {1} with loop
99
+ return(3);
100
+ }
101
+ if (k <= n ncgenCount - 2) { // V = {1} with more than one loop
102
+ return(0);
103
+ }
104
+ }
105
+
106
+ intmat UG = lpUfnarovskiGraph(G)[1];
107
+
108
+ // check special case 2
109
+ intmat zero[nrows(UG)][ncols(UG)];
110
+ if (UG == zero) {
111
+ return (3);
112
+ }
113
+
114
+ if (!imHasLoops(UG) && imIsUpRightTriangle(topologicalSort(UG))) {
115
+ // UG is a DAG
116
+ return (3);
117
+ }
118
+
119
+ // DFS from every vertex, if cycle is found, check every vertex for incoming/outcom
120
+ intvec visited;
121
+ visited[ncols(UG)] = 0;
122
+ int inFlag, outFlag, inOutFlag;
123
+ for (int v = 1; v <= ncols(UG) && (inFlag + outFlag) != 3; v++) {
124
+ int inOutFlags = inOutCommingEdgesInCycles(UG, v, visited, 0);
125
+ if (inOutFlags == 1) {
126
+ inFlag = 1;
127
+ }
128
+ if (inOutFlags == 2) {
129
+ outFlag = 1;
130
+ }
131
+ if (inOutFlags == 3) {
132
+ inFlag = 1;
133
+ outFlag = 1;
134
+ }
135
+ if (inOutFlags == 4) {
136
+ inOutFlag = 1;
137
+ }
138
+ if (inOutFlags == 5) {
139
+ inFlag = 1;
140
+ inOutFlag = 1;
141
+ }
142
+ if (inOutFlags == 6) {
143
+ outFlag = 1;
144
+ inOutFlag = 1;
145
+ }
146
+ if (inOutFlags == 7) {
147
+ inFlag = 1;
148
+ outFlag = 1;
149
+ inOutFlag = 1;
150
+ }
151
+ kill inOutFlags;
152
+ } kill v;
153
+ int noetherian = 3 - 1*inFlag - 2*outFlag;
154
+ if (noetherian == 0) {
155
+ return (4 - 4*inOutFlag); // weak noetherian
156
+ }
157
+ return (noetherian);
158
+ }
159
+ example
160
+ {
161
+ "EXAMPLE:"; echo = 2;
162
+ ring r = 0,(x,y),dp;
163
+ def R = freeAlgebra(r, 5);
164
+ setring R;
165
+ ideal G = x*x, y*x; // K<x,y>/<xx,yx> is right noetherian
166
+ lpNoetherian(G);
167
+ }
168
+
169
+ static proc inOutCommingEdgesInCycles(intmat G, int v, intvec visited, intvec path) {
170
+ // Mark the current vertex as visited
171
+ visited[v] = 1;
172
+
173
+ // Store the current vertex in path
174
+ if (path[1] == 0) {
175
+ path[1] = v;
176
+ } else {
177
+ path[size(path) + 1] = v;
178
+ }
179
+
180
+ int inFlag, outFlag, inOutFlag;
181
+
182
+ for (int w = 1; w <= ncols(G) && (inFlag + outFlag) != 3; w++) {
183
+ if (G[v,w] == 1) {
184
+ if (visited[w] == 1) { // new cycle
185
+ int tmpInFlag;
186
+ int tmpOutFlag;
187
+ if (v == w) { // cycle is a loop
188
+ for (int u = 1; u <= ncols(G); u++) {
189
+ if (G[v,u] && u != v) {
190
+ outFlag = 1;
191
+ tmpOutFlag = 1;
192
+ }
193
+ if (G[u,v] && u != v) {
194
+ inFlag = 1;
195
+ tmpInFlag = 1;
196
+ }
197
+ } kill u;
198
+ } else {
199
+ for (int i = size(path); i >= 1; i--) { // for each vertex in the path
200
+ // check for neighbors not directly next or prev in cycle
201
+ for (int u = 1; u <= ncols(G); u++) {
202
+ if (G[path[i],u] == 1) { // there is an edge to u
203
+ if (path[i] != v) {
204
+ if (u != path[i+1]) { // and u is not the next element in the cycle
205
+ outFlag = 1;
206
+ tmpOutFlag = 1;
207
+ }
208
+ } else {
209
+ if (u != w) {
210
+ outFlag = 1;
211
+ tmpOutFlag = 1;
212
+ }
213
+ }
214
+ }
215
+ if (G[u,path[i]] == 1) { // there is an edge from u
216
+ if (path[i] != w) {
217
+ if (u != path[i-1]) { // and u is not the previous element in the cylce
218
+ inFlag = 1;
219
+ tmpInFlag = 1;
220
+ }
221
+ } else {
222
+ if (u != v) {
223
+ inFlag = 1;
224
+ tmpInFlag = 1;
225
+ }
226
+ }
227
+ }
228
+ } kill u;
229
+ if (path[i] == w) {
230
+ break;
231
+ }
232
+ } kill i;
233
+ }
234
+ if (tmpInFlag > 0 && tmpOutFlag > 0) {
235
+ // there are both in and outcomming edges in this cycle
236
+ inOutFlag = 1;
237
+ }
238
+ kill tmpInFlag;
239
+ kill tmpOutFlag;
240
+ } else {
241
+ int inOutFlags = inOutCommingEdgesInCycles(G, w, visited, path);
242
+ if (inOutFlags == 1) {
243
+ inFlag = 1;
244
+ }
245
+ if (inOutFlags == 2) {
246
+ outFlag = 1;
247
+ }
248
+ if (inOutFlags == 3) {
249
+ inFlag = 1;
250
+ outFlag = 1;
251
+ }
252
+ if (inOutFlags == 4) {
253
+ inOutFlag = 1;
254
+ }
255
+ if (inOutFlags == 5) {
256
+ inFlag = 1;
257
+ inOutFlag = 1;
258
+ }
259
+ if (inOutFlags == 6) {
260
+ outFlag = 1;
261
+ inOutFlag = 1;
262
+ }
263
+ if (inOutFlags == 7) {
264
+ inFlag = 1;
265
+ outFlag = 1;
266
+ inOutFlag = 1;
267
+ }
268
+ kill inOutFlags;
269
+ }
270
+ }
271
+ } kill w;
272
+
273
+ return (1*inFlag + 2*outFlag + 4*inOutFlag);
274
+ }
275
+
276
+ proc lpIsSemiPrime(ideal G)
277
+ "USAGE: lpIsSemiPrime(G); G an ideal in a Letterplace ring
278
+ RETURN: boolean
279
+ PURPOSE: Check whether A/<LM(G)> is semi-prime ring,
280
+ alternatively whether <LM(G)> is a semi-prime ideal in A.
281
+ ASSUME: - basering is a Letterplace ring
282
+ - G is a Groebner basis
283
+ THEORY: A (two-sided) ideal I in the ring A is semi-prime, if for any a in A one has
284
+ aAa subseteq I implies a in I.
285
+ NOTE: lpIsSemiPrime works with the monomial algebra A/<LM(G)>.
286
+ A positive answer holds for both A/<LM(G)> and A/<G>, while
287
+ a negative answer applies only to A/<LM(G)> and not necessarily to
288
+ A/<G>.
289
+ "
290
+ {
291
+ // old theory part: that is when p * (A/<LM(G)>) * p != 0 for all p in (A/<LM(G)> - {0}).
292
+ G = lead(G);
293
+ G = simplify(G, 2+4+8);
294
+
295
+ // check special case 1
296
+ int l = 0;
297
+ for (int i = 1; i <= size(G); i++) {
298
+ // find the max degree in G
299
+ int d = deg(G[i]);
300
+ if (d > l) {
301
+ l = d;
302
+ }
303
+
304
+ // also if G is the whole ring
305
+ if (leadmonom(G[i]) == 1) {
306
+ ERROR("primeness not defined for 0-ring")
307
+ }
308
+ kill d;
309
+ } kill i;
310
+ // if longest word has length 1 we handle it as a special case
311
+ if (l == 1) {
312
+ return(1);
313
+ }
314
+
315
+ list VUG = lpUfnarovskiGraph(G);
316
+ intmat UG = VUG[1]; // the Ufnarovskij graph
317
+ ideal V = VUG[2]; // the vertices of UG (standard words with length = l-1)
318
+
319
+ list LG = lpId2ivLi(G);
320
+ list SW = ivStandardWordsUpToLength(LG, maxDeg(G));
321
+ list LV = lpId2ivLi(V);
322
+
323
+ // delete the 0 in SW
324
+ int indexofzero = ivIndexOf(SW, 0);
325
+ if (indexofzero > 0) { // should be always true when |SW| > 0
326
+ SW = delete(SW, indexofzero);
327
+ }
328
+
329
+ // check if each monomial in SW is cyclic
330
+ for (int i = 1; i <= size(SW); i++) {
331
+ if (!isCyclicInUfGraph(UG, LV, SW[i])) {
332
+ return (0);
333
+ }
334
+ } kill i;
335
+
336
+ return (1);
337
+ }
338
+ example
339
+ {
340
+ "EXAMPLE:"; echo = 2;
341
+ ring r = 0,(x1,x2),dp;
342
+ def R = freeAlgebra(r, 5);
343
+ setring R;
344
+ ideal G = x1*x2, x2*x1; // K<x1,x2>/<x1*x2,x2*x1> is semi prime
345
+ lpIsSemiPrime(G);
346
+ }
347
+
348
+ // checks whether a monomial is a cyclic monomial
349
+ static proc isCyclicInUfGraph(intmat UG, list LV, intvec u)
350
+ {
351
+ if (ncols(UG) == 0) {return (0);} // UG is empty
352
+ if (u == 0) {return (0);} // 0 is never cyclic
353
+
354
+ int l = size(LV[1]) + 1;
355
+
356
+ int s = size(u);
357
+ if (s <= l - 1) {
358
+ for (int i = 1; i <= size(LV); i++) {
359
+ // for all vertices where u is a suffix
360
+ if(isSF(u, LV[i])) {
361
+ if (existsRoute(UG, i, i)) {
362
+ return (1);
363
+ }
364
+ }
365
+ } kill i;
366
+ } else { // size(u) > l - 1
367
+ int m = s - l + 1;
368
+
369
+ // there must be a route from v0 to vm
370
+ intvec v0 = u[1..(l-1)]; // first in route of u
371
+ intvec vm = u[m+1..m+(l-1)]; // last in route of u
372
+
373
+ int iv0 = ivIndexOf(LV, v0);
374
+ int ivm = ivIndexOf(LV, vm);
375
+ if (iv0 <= 0 || ivm <= 0) {
376
+ ERROR("u is not a standard word");
377
+ }
378
+
379
+ return (existsRoute(UG, ivm, iv0));
380
+ }
381
+
382
+ return (0);
383
+ }
384
+
385
+ proc lpIsPrime(ideal G)
386
+ "USAGE: lpIsPrime(G); G an ideal in a Letterplace ring
387
+ RETURN: boolean
388
+ PURPOSE: Check whether A/<LM(G)> is prime ring,
389
+ alternatively whether <LM(G)> is a prime ideal in A.
390
+ ASSUME: - basering is a Letterplace ring
391
+ - G is a Groebner basis
392
+ THEORY: A (two-sided) ideal I in the ring A is prime, if for any a,b in A one has
393
+ aAb subseteq I implies a in I or b in I.
394
+ NOTE: lpIsPrime works with the monomial algebra A/<LM(G)>.
395
+ A positive answer holds for both A/<LM(G)> and A/<G>, while
396
+ a negative answer applies only to A/<LM(G)> and not necessarily to A/<G>.
397
+ "
398
+ {
399
+ // old theory part: that is when p1 * (A/<LM(G)>) * p2 != 0 for all p1, p2 in (A/<LM(G)> - {0}).
400
+ G = lead(G);
401
+ G = simplify(G, 2+4+8);
402
+
403
+ // check special case 1
404
+ int l = 0;
405
+ for (int i = 1; i <= size(G); i++) {
406
+ // find the max degree in G
407
+ int d = deg(G[i]);
408
+ if (d > l) {
409
+ l = d;
410
+ }
411
+
412
+ // also if G is the whole ring
413
+ if (leadmonom(G[i]) == 1) {
414
+ ERROR("primeness not defined for 0-ring")
415
+ }
416
+ kill d;
417
+ } kill i;
418
+ // if longest word has length 1 we handle it as a special case
419
+ if (l == 1) {
420
+ return(1);
421
+ }
422
+
423
+ list VUG = lpUfnarovskiGraph(G);
424
+ intmat UG = VUG[1]; // the Ufnarovskij graph
425
+ ideal V = VUG[2]; // the vertices of UG (standard words with length = l-1)
426
+
427
+ list LG = lpId2ivLi(G);
428
+ list LV = lpId2ivLi(V);
429
+
430
+ int n = ncols(UG);
431
+
432
+ // 1) for each vi vj there exists a route from vi to vj (means UG is connected)
433
+ for (int i = 1; i <= n; i++) {
434
+ for (int j = 1; j <= n; j++) {
435
+ if (!existsRoute(UG, i, j)) {
436
+ return (0);
437
+ }
438
+ } kill j;
439
+ } kill i;
440
+
441
+ // 2) any standard word with length < l-1 is a suffix of a vertex
442
+ list SW = ivStandardWordsUpToLength(LG, maxDeg(G) - 2); // < maxDeg - 1
443
+ if (size(SW) > 0 && size(LV) == 0) {return (0);}
444
+ for (int i = 1; i <= size(SW); i++) {
445
+ // check if SW[i] is a suffix of some LV
446
+ for (int j = 1; j <= size(LV); j++) {
447
+ if (!isSF(SW[i], LV[j])) {
448
+ if (j == size(LV)) {
449
+ return (0);
450
+ }
451
+ } else {
452
+ break;
453
+ }
454
+ } kill j;
455
+ } kill i;
456
+
457
+ return (1);
458
+ }
459
+ example
460
+ {
461
+ "EXAMPLE:"; echo = 2;
462
+ ring r = 0,(x,y),dp;
463
+ def R = freeAlgebra(r, 5);
464
+ setring R;
465
+ ideal G = x*x, y*y; // K<x,y>/<xx,yy> is prime
466
+ lpIsPrime(G);
467
+ }
468
+
469
+ static proc existsRoute(intmat G, int v, int u, list #)
470
+ "USAGE: existsRoute(G,v,u); G a graph, v and u vertices
471
+ NOTE: don't pass anything to # (internal use for recursion)
472
+ routes always have at least one edge
473
+ "
474
+ {
475
+ int n = ncols(G);
476
+
477
+ // init visited
478
+ intvec visited;
479
+ if (size(#) > 0) {
480
+ if (v == u) {return (1);} // don't check on first call so |route| >= 1 holds
481
+ visited = #[1];
482
+ } else { // first call
483
+ visited[n] = 0;
484
+ }
485
+
486
+ // mark current vertex as visited
487
+ visited[v] = 1;
488
+
489
+ // recursive DFS
490
+ for (int i = 1; i <= n; i++) {
491
+ if (G[v,i] && (!visited[i] || i == u)) { // i == u to allow routes from u to u
492
+ if (existsRoute(G, i, u, visited)) {
493
+ return (1);
494
+ }
495
+ }
496
+ } kill i;
497
+
498
+ return (0);
499
+ }
500
+
501
+ static proc UfGraphURTNZDGrowth(intmat UG) {
502
+ // URTNZD = upper right triangle non zero diagonal
503
+ for (int i = 1; i <= ncols(UG); i++) {
504
+ UG[i,i] = 0; // remove all loops
505
+ } kill i;
506
+ intmat UGk = UG;
507
+ intmat zero[nrows(UGk)][ncols(UGk)];
508
+ int k = 1;
509
+ while (UGk != zero) {
510
+ UGk = UGk * UG;
511
+ k++;
512
+ }
513
+ return (k);
514
+ }
515
+
516
+ static proc imIsUpRightTriangle(intmat M) {
517
+ for (int i = 1; i <= nrows(M); i++) {
518
+ for (int j = 1; j < i; j++) {
519
+ if(M[i,j] != 0) { return (0); }
520
+ } kill j;
521
+ } kill i;
522
+ return (1);
523
+ }
524
+
525
+ static proc eliminateZerosUpTriangle(intmat G) {
526
+ // G is expected to be an upper triangle matrix
527
+ for (int i = ncols(G); i >= 1; i--) { // loop order is important because we delete entries
528
+ if (G[i,i] == 0) { // i doesn't have a cycle
529
+ for (int j = 1; j < i; j++) {
530
+ if (G[j,i] == 1) { // j has an edge to i
531
+ for (int k = i + 1; k <= nrows(G); k++) {
532
+ if (G[i,k] == 1) {
533
+ G[j,k] = G[i,k]; // give j all edges from i
534
+ }
535
+ } kill k;
536
+ }
537
+ } kill j;
538
+ G = imDelRowCol(G,i,i); // remove vertex i
539
+ }
540
+ } kill i;
541
+ return (G);
542
+ }
543
+
544
+ static proc imDelRowCol(intmat M, int row, int col) {
545
+ // row and col are expected to be > 0
546
+ int nr = nrows(M);
547
+ int nc = ncols(M);
548
+ intmat Mdel[nr - 1][nc - 1];
549
+ for (int i = 1; i <= nr; i++) {
550
+ for (int j = 1; j <= nc; j++) {
551
+ if(i != row && j != col) {
552
+ int newi = i;
553
+ int newj = j;
554
+ if (i > row) { newi = i - 1; }
555
+ if (j > col) { newj = j - 1; }
556
+ Mdel[newi,newj] = M[i,j];
557
+ kill newi; kill newj;
558
+ }
559
+ } kill j;
560
+ } kill i;
561
+ return (Mdel);
562
+ }
563
+
564
+ static proc topologicalSort(intmat G) {
565
+ // NOTE: ignores loops
566
+ // NOTE: this takes O(|V^3|), can be optimized
567
+ int n = ncols(G);
568
+ for (int i = 1; i <= n; i++) { // only use the submat at i
569
+ // find a vertex v in the submat at i with no incoming edges
570
+ int v;
571
+ for (int j = i; j <= n; j++) {
572
+ int incoming = 0;
573
+ for (int k = i; k <= n; k++) {
574
+ if (k != j && G[k,j] == 1) {
575
+ incoming = 1;
576
+ }
577
+ } kill k;
578
+ if (incoming == 0) {
579
+ v = j;
580
+ kill incoming;
581
+ break;
582
+ } else {
583
+ if (j == n) {
584
+ // G contains at least one cycle, abort
585
+ return (G);
586
+ }
587
+ }
588
+ kill incoming;
589
+ } kill j;
590
+
591
+ // swap v and i
592
+ if (v != i) {
593
+ G = imPermcol(G, v, i);
594
+ G = imPermrow(G, v, i);
595
+ }
596
+ kill v;
597
+ } kill i;
598
+ return (G);
599
+ }
600
+
601
+ static proc imPermcol (intmat A, int c1, int c2)
602
+ {
603
+ intmat B = A;
604
+ int k = nrows(B);
605
+ B[1..k,c1] = A[1..k,c2];
606
+ B[1..k,c2] = A[1..k,c1];
607
+ return (B);
608
+ }
609
+
610
+ static proc imPermrow (intmat A, int r1, int r2)
611
+ {
612
+ intmat B = A;
613
+ int k = ncols(B);
614
+ B[r1,1..k] = A[r2,1..k];
615
+ B[r2,1..k] = A[r1,1..k];
616
+ return (B);
617
+ }
618
+
619
+ static proc UfGraphGrowth(intmat UG)
620
+ {
621
+ int n = ncols(UG); // number of vertices
622
+ // iterate through all vertices
623
+
624
+ intvec visited = 0:n;
625
+ intvec cyclic = 0:n;
626
+ intvec countedCycles = -2:n;
627
+
628
+ int maxCycleCount = 0;
629
+ for (int v = 1; v <= n; v++) {
630
+ countedCycles = countCycles(UG, v, visited, cyclic, 0, countedCycles);
631
+ dbprint("counted " + string(countedCycles[v]) + " cycles from vertex " + string(v) + "/" + string(n) + " (cache: " + string(countedCycles) + ")");
632
+ if (countedCycles[v] == -1) {
633
+ return(-1);
634
+ }
635
+ if (countedCycles[v] > maxCycleCount) {
636
+ maxCycleCount = countedCycles[v];
637
+ }
638
+ } kill v;
639
+ return (maxCycleCount);
640
+ }
641
+
642
+ static proc countCycles(intmat G, int v, intvec visited, intvec cyclic, intvec path, intvec countedCycles)
643
+ "USAGE: countCycles(G, v, visited, cyclic, path); G a Graph, v the vertex to
644
+ start. The parameter visited, cyclic and path should be 0.
645
+ RETURN: int
646
+ Maximal number of distinct cycles
647
+ PURPOSE: Calculate the maximal number of distinct cycles in a single path starting at v
648
+ ASSUME: Basering is a Letterplace ring
649
+ "
650
+ {
651
+ if (countedCycles[v] > -2) {
652
+ return (countedCycles);
653
+ }
654
+ // Mark the current vertex as visited
655
+ visited[v] = 1;
656
+
657
+ // Store the current vertex in path
658
+ if (path[1] == 0) {
659
+ path[1] = v;
660
+ } else {
661
+ path[size(path) + 1] = v;
662
+ }
663
+
664
+ int cycles = 0;
665
+ for (int w = 1; w <= ncols(G); w++) {
666
+ if (G[v,w] == 1) {
667
+ if (visited[w] == 1) { // found new cycle
668
+ // 1. for all vertices in path until w, check if they are cyclic
669
+ for (int j = size(path); j >= 1; j--) {
670
+ if(cyclic[path[j]] == 1) {
671
+ // 1.1 if yes, return -1
672
+ countedCycles[v] = -1;
673
+ return (countedCycles);
674
+ }
675
+ if (path[j] == w) {
676
+ break;
677
+ }
678
+ } kill j;
679
+
680
+ // 2. otherwise cycles++
681
+ for (int j = size(path); j >= 1; j--) {
682
+ // 2.2 remove the edges from that cycle and mark the vertices as cyclic
683
+ if (j == size(path)) { // special case in the first iteration
684
+ cyclic[v] = 1;
685
+ G[v, w] = 0;
686
+ } else {
687
+ cyclic[path[j]] = 1;
688
+ G[path[j], path[j+1]] = 0;
689
+ }
690
+ if (path[j] == w) {
691
+ break;
692
+ }
693
+ } kill j;
694
+
695
+ // 3. countCycles() on all these vertices
696
+ int maxCycleCount = 0;
697
+ for (int j = size(path); j >= 1; j--) {
698
+ countedCycles = countCycles(G, path[j], visited, cyclic, path, countedCycles);
699
+ if(countedCycles[path[j]] == -1) {
700
+ countedCycles[v] = -1;
701
+ return (countedCycles);
702
+ }
703
+ if (countedCycles[path[j]] > maxCycleCount) {
704
+ maxCycleCount = countedCycles[path[j]];
705
+ }
706
+ if (path[j] == w) {
707
+ break;
708
+ }
709
+ } kill j;
710
+ if (maxCycleCount >= cycles) {
711
+ cycles = maxCycleCount + 1;
712
+ }
713
+ kill maxCycleCount;
714
+ } else {
715
+ countedCycles = countCycles(G, w, visited, cyclic, path, countedCycles);
716
+ if (countedCycles[w] == -1) {
717
+ countedCycles[v] = -1;
718
+ return (countedCycles);
719
+ }
720
+ if (countedCycles[w] > cycles) {
721
+ cycles = countedCycles[w];
722
+ }
723
+ }
724
+ }
725
+ } kill w;
726
+ countedCycles[v] = cycles;
727
+ return (countedCycles);
728
+ }
729
+
730
+ // Ufnarovskii graph is now implemented in the dynamic module (freeAlgebra.cc)
731
+ /* proc lpUfnarovskiGraph(ideal G, list #) */
732
+ /* "USAGE: lpUfnarovskiGraph(G); G a set of monomials in a letterplace ring. */
733
+ /* RETURN: intmat or list */
734
+ /* NOTE: lpUfnarovskiGraph(G); returns intmat. lpUfnarovskiGraph(G,1); returns list L with L[1] an intmat and L[2] an ideal. */
735
+ /* The intmat is the Ufnarovskij Graph and the ideal contains the vertices. */
736
+ /* PURPOSE: Constructs the Ufnarovskij graph induced by G */
737
+ /* the adjacency matrix of the Ufnarovskij graph induced by G */
738
+ /* ASSUME: - basering is a Letterplace ring */
739
+ /* - G are the leading monomials of a Groebner basis */
740
+ /* " */
741
+ /* { */
742
+ /* dbprint("computing maxDeg"); */
743
+ /* int l = maxDeg(G); */
744
+ /* if (l - 1 == 0) { */
745
+ /* // TODO: how should the graph look like when l - 1 = 0 ? */
746
+ /* ERROR("Ufnarovskij graph not implemented for l = 1"); */
747
+ /* } */
748
+ /* int lV = lpVarBlockSize(basering); */
749
+ /* // TODO: what if l <= 0? */
750
+ /* dbprint("computing standard words"); */
751
+ /* ideal SW = lpStandardWords(G, l - 1); // vertices */
752
+ /* int n = ncols(SW); */
753
+ /* dbprint("n = " + string(n)); */
754
+ /* intmat UG[n][n]; // Ufnarovskij graph */
755
+ /* for (int i = 1; i <= n; i++) { */
756
+ /* for (int j = 1; j <= n; j++) { */
757
+ /* dbprint("Ufnarovskii graph: " + string((i-1)*n + j) + "/" + string(n*n) + " entries"); */
758
+ /* // [Studzinski page 76] */
759
+ /* poly v = SW[i]; */
760
+ /* poly w = SW[j]; */
761
+ /* intvec v_overlap; */
762
+ /* intvec w_overlap; */
763
+ /* if (l - 1 > 1) { */
764
+ /* v_overlap = leadexp(v); */
765
+ /* w_overlap = leadexp(w); */
766
+ /* v_overlap = v_overlap[(lV+1) .. (l-1)*lV]; */
767
+ /* w_overlap = w_overlap[1 .. (l-2)*lV]; */
768
+ /* } */
769
+ /* if (v_overlap == w_overlap && !lpLmDivides(G, v * lpVarAt(w, l - 1))) { */
770
+ /* UG[i,j] = 1; */
771
+ /* } */
772
+ /* kill v; kill w; kill v_overlap; kill w_overlap; */
773
+ /* } kill j; */
774
+ /* } kill i; */
775
+ /* if (size(#) > 0) { */
776
+ /* if (typeof(#[1]) == "int") { */
777
+ /* if (#[1] != 0) { */
778
+ /* list ret = UG; */
779
+ /* ret[2] = SW; // the vertices */
780
+ /* return (ret); */
781
+ /* } */
782
+ /* } */
783
+ /* } */
784
+ /* return (UG); */
785
+ /* } */
786
+ /* example */
787
+ /* { */
788
+ /* "EXAMPLE:"; echo = 2; */
789
+ /* ring r = 0,(x,y,z),dp; */
790
+ /* def R = freeAlgebra(r, 5); // constructs a Letterplace ring */
791
+ /* setring R; // sets basering to Letterplace ring */
792
+ /* ideal I = x*y, x*z, z*y, z*z; */
793
+ /* lpUfnarovskiGraph(I); */
794
+ /* lpUfnarovskiGraph(I,1); */
795
+ /* } */
796
+
797
+ static proc maxDeg(ideal G)
798
+ {
799
+ int l = 0;
800
+ for (int i = 1; i <= size(G); i++) { // find the max degree in G
801
+ int d = deg(G[i]);
802
+ if (d > l) {
803
+ l = d;
804
+ }
805
+ kill d;
806
+ } kill i;
807
+ return (l);
808
+ }
809
+
810
+ static proc lpStandardWords(ideal G, int length)
811
+ "ASSUME: G is simplified
812
+ "
813
+ {
814
+ if (length < 0) {
815
+ return (delete(ideal(0), 1)); // no standard words
816
+ }
817
+
818
+ ideal words = maxideal(length);
819
+ for (int i = ncols(words); i >= 1; i--) {
820
+ if (lpLmDivides(G, words[i])) {
821
+ words = delete(words, i);
822
+ }
823
+ } kill i;
824
+ return (words);
825
+ }
826
+
827
+ static proc ivStandardWords(list G, int length)
828
+ "ASSUME: G is simplified
829
+ "
830
+ {
831
+ if (length <= 0) {
832
+ list words;
833
+ if (length == 0 && !ivdivides(G,0)) {
834
+ words[1] = 0; // iv = 0 means monom = 1
835
+ }
836
+ return (words); // no standard words
837
+ }
838
+ int nVars = lpVarBlockSize(basering) - lpNcgenCount(basering); // variable count
839
+ list prevWords = ivStandardWords(G, length - 1);
840
+ list words;
841
+ for (int i = 1; i <= nVars; i++) {
842
+ for (int j = 1; j <= size(prevWords); j++) {
843
+ intvec word = prevWords[j];
844
+ word[length] = i;
845
+ // assumes that G is simplified!
846
+ if (!ivdivides(G, word)) {
847
+ words = insert(words, word);
848
+ }
849
+ kill word;
850
+ } kill j;
851
+ } kill i;
852
+ return (words);
853
+ }
854
+
855
+ static proc ivStandardWordsUpToLength(list G, int length)
856
+ "ASSUME: G is simplified
857
+ "
858
+ {
859
+ list words = ivStandardWords(G,0);
860
+ if (size(words) == 0) {return (words)}
861
+ for (int i = 1; i <= length; i++) {
862
+ words = words + ivStandardWords(G, i);
863
+ } kill i;
864
+ return (words);
865
+ }
866
+
867
+ static proc ivdivides(list G, intvec iv) {
868
+ for (int k = 1; k <= size(G); k++) {
869
+ if (isIF(G[k], iv)) {
870
+ return (1);
871
+ } else {
872
+ if (k == size(G)) {
873
+ return (0);
874
+ }
875
+ }
876
+ } kill k;
877
+ return (0);
878
+ }
879
+
880
+ proc lpGkDim(ideal G)
881
+ "USAGE: lpGkDim(G); G an ideal in a letterplace ring
882
+ RETURN: int
883
+ PURPOSE: Determines the Gelfand Kirillov dimension of A/<G>
884
+ -1 means positive infinite
885
+ ASSUME: - basering is a Letterplace ring
886
+ - G is a Groebner basis
887
+ NOTE: Alias for dim(G)
888
+ "
889
+ {
890
+ print("WARNING: `lpGkDim` is deprecated, you can use `dim` instead.");
891
+ return (dim(G));
892
+ }
893
+ example
894
+ {
895
+ "EXAMPLE:"; echo = 2;
896
+ ring r = 0,(x,y,z),dp;
897
+ ring R = freeAlgebra(r, 5);
898
+ ideal I = z; // infinite GK dimension (-1)
899
+ lpGkDim(I);
900
+ I = x,y,z; I = std(I); // GK dimension 0
901
+ lpGkDim(I);
902
+ I = x*y, x*z, z*y, z*z; I = std(I); // GK dimension 2
903
+ lpGkDim(I);
904
+ ideal G = y*x - x*y, z*x - x*z, z*y - y*z; G = std(G);
905
+ G;
906
+ lpGkDim(G); // GK dimension 3
907
+ }
908
+
909
+ proc teach_lpGkDim(ideal G)
910
+ "USAGE: teach_lpGkDim(G); G an ideal in a letterplace ring
911
+ RETURN: int
912
+ PURPOSE: Determines the Gelfand Kirillov dimension of A/<G>
913
+ -1 means positive infinite
914
+ ASSUME: - basering is a Letterplace ring
915
+ - G is a Groebner basis
916
+ "
917
+ {
918
+ G = lead(G);
919
+ G = simplify(G, 2+4+8);
920
+
921
+ // check special case 1
922
+ int l = 0;
923
+ for (int i = 1; i <= size(G); i++) {
924
+ // find the max degree in G
925
+ int d = deg(G[i]);
926
+ if (d > l) {
927
+ l = d;
928
+ }
929
+
930
+ // also if G is the whole ring return minus infinity
931
+ if (leadmonom(G[i]) == 1) {
932
+ ERROR("GK-Dim not defined for 0-ring")
933
+ }
934
+ kill d;
935
+ } kill i;
936
+ // if longest word has length 1, or G is the zero ideal, we handle it as a special case
937
+ if (l == 1 || size(G) == 0) {
938
+ int n = lpVarBlockSize(basering); // variable count
939
+ int k = size(G);
940
+ if (k == n) { // V = {1} no edges
941
+ return(0);
942
+ }
943
+ if (k == n-1) { // V = {1} with loop
944
+ return(1);
945
+ }
946
+ if (k <= n-2) { // V = {1} with more than one loop
947
+ return(-1);
948
+ }
949
+ }
950
+
951
+ dbprint("computing Ufnarovskii graph");
952
+ intmat UG = lpUfnarovskiGraph(G)[1];
953
+ if (printlevel >= voice + 1) {
954
+ UG;
955
+ }
956
+
957
+ // check special case 2
958
+ intmat zero[nrows(UG)][ncols(UG)];
959
+ if (UG == zero) {
960
+ return (0);
961
+ }
962
+
963
+ // check special case 3
964
+ dbprint("topological sorting of Ufnarovskii graph");
965
+ UG = topologicalSort(UG);
966
+ if (printlevel >= voice + 1) {
967
+ UG;
968
+ }
969
+
970
+ dbprint("check if Ufnarovskii graph is DAG");
971
+ if (imIsUpRightTriangle(UG)) {
972
+ UG = eliminateZerosUpTriangle(UG);
973
+ if (ncols(UG) == 0 || nrows(UG) == 0) { // when the diagonal was zero
974
+ return (0)
975
+ }
976
+ dbprint("DAG detected, using URTNZD growth alg");
977
+ return(UfGraphURTNZDGrowth(UG));
978
+ }
979
+
980
+ // otherwise count cycles in the Ufnarovskij Graph
981
+ dbprint("not a DAG, using regular growth alg");
982
+ return(UfGraphGrowth(UG));
983
+ }
984
+ example
985
+ {
986
+ "EXAMPLE:"; echo = 2;
987
+ ring r = 0,(x,y,z),dp;
988
+ def R = freeAlgebra(r, 5); // constructs a Letterplace ring
989
+ R;
990
+ setring R; // sets basering to Letterplace ring
991
+ ideal I = z;//an example of infinite GK dimension
992
+ teach_lpGkDim(I);
993
+ I = x,y,z; // gkDim = 0
994
+ teach_lpGkDim(I);
995
+ I = x*y, x*z, z*y, z*z;//gkDim = 2
996
+ teach_lpGkDim(I);
997
+ ideal G = y*x - x*y, z*x - x*z, z*y - y*z; G = std(G);
998
+ G;
999
+ teach_lpGkDim(G); // 3, as expected for K[x,y,z]
1000
+ }
1001
+
1002
+ proc lpGlDimBound(ideal G)
1003
+ "USAGE: lpGlDimBound(I); I an ideal
1004
+ RETURN: int, an upper bound for the global dimension, -1 means infinity
1005
+ PURPOSE: computing an upper bound for the global dimension
1006
+ ASSUME: - basering is a Letterplace ring, G is a reduced Groebner Basis
1007
+ EXAMPLE: example lpGlDimBound; shows example
1008
+ NOTE: if I = LM(I), then the global dimension is equal the Gelfand
1009
+ Kirillov dimension if it is finite
1010
+ Global dimension should be 0 for A/G = K and 1 for A/G = K<x1...xn>
1011
+ "
1012
+ {
1013
+ G = simplify(G,2); // remove zero generators
1014
+ // NOTE: Gl should be 0 for A/G = K and 1 for A/G = K<x1...xn>
1015
+ // G1 contains generators with single variable in LM
1016
+ ideal G1;
1017
+ for (int i = 1; i <= size(G); i++) {
1018
+ if (ord(G[i]) < 2) { // single variable in LM
1019
+ G1 = insertGenerator(G1,G[i]);
1020
+ }
1021
+ } kill i;
1022
+ G1 = simplify(G1,2); // remove zero generators
1023
+
1024
+ // G = NF(G,G1)
1025
+ for (int i = 1; i <= ncols(G); i++) { // do not use size() here
1026
+ G[i] = lpNF(G[i],G1);
1027
+ } kill i;
1028
+ G = simplify(G,2); // remove zero generators
1029
+
1030
+ // delete variables in LM(G1) from the ring
1031
+ def save = basering;
1032
+ def R = basering;
1033
+ if (size(G1) > 0) {
1034
+ while (size(G1) > 0) {
1035
+ if (lpVarBlockSize(R) - lpNcgenCount(R) > 1) {
1036
+ def @R = R - string(G1[1]);
1037
+ R = @R;
1038
+ kill @R;
1039
+ setring R;
1040
+ /* ring R = lpDelVar(lp2iv(G1[1])[1]); // TODO replace with proper method */
1041
+ ideal G1 = imap(save,G1);
1042
+ G1 = simplify(G1, 2); // remove zero generators
1043
+ } else {
1044
+ // only the field is left (no variables)
1045
+ return(0);
1046
+ }
1047
+ }
1048
+ ideal G = imap(save, G); // put this here, because when save == R this call would make G = 0
1049
+ }
1050
+
1051
+ // Li p. 184 if G = LM(G), then I = LM(I) and thus glDim = gkDim if it's finite
1052
+ for (int i = 1; i <= size(G); i++) {
1053
+ if (G[i] != lead(G[i])) {
1054
+ break;
1055
+ } else {
1056
+ if (i == size(G)) { // if last iteration
1057
+ G = twostd(G); // otherwise warning that G is no standard basis
1058
+ int gkDim = dim(G);
1059
+ if (gkDim >= 0) {
1060
+ return (gkDim);
1061
+ }
1062
+ kill gkDim;
1063
+ }
1064
+ }
1065
+ } kill i;
1066
+
1067
+ intmat GNC = lpGraphOfNChains(G);
1068
+
1069
+ // assuming GNC is connected
1070
+
1071
+ // TODO: maybe loop+cycle checking could be done more efficiently?
1072
+ if (!imHasLoops(GNC) && imIsUpRightTriangle(topologicalSort(GNC))) {
1073
+ // GNC is a DAG
1074
+ intmat GNCk = GNC;
1075
+ intmat zero[1][ncols(GNCk)];
1076
+ int k = 1;
1077
+ // while first row isn't empty
1078
+ while (GNCk[1,1..(ncols(GNCk))] != zero[1,1..(ncols(zero))]) {
1079
+ GNCk = GNCk * GNC;
1080
+ k++;
1081
+ }
1082
+ // k-1 = number of edges in longest path starting from 1
1083
+ return (k-1);
1084
+ } else {
1085
+ // GNC contains loops/cycles => there is always an n-chain
1086
+ return (-1); // infinity
1087
+ }
1088
+ }
1089
+ example
1090
+ {
1091
+ "EXAMPLE:"; echo = 2;
1092
+ ring r = 0,(x,y),dp;
1093
+ def R = freeAlgebra(r, 5); // constructs a Letterplace ring
1094
+ setring R; // sets basering to Letterplace ring
1095
+ ideal G = x*x, y*y,x*y*x; // it is a monomial Groebner basis
1096
+ lpGlDimBound(G);
1097
+ ideal H = y*x - x*y; H = std(H); // H is a Groebner basis
1098
+ lpGlDimBound(H); // gl dim of K[x,y] is 2, as expected
1099
+ }
1100
+
1101
+ static proc imHasLoops(intmat A) {
1102
+ int n = ncols(A);
1103
+ for (int i = 1; i <= n; i++) {
1104
+ if (A[i,i] == 1) {
1105
+ return (1);
1106
+ }
1107
+ } kill i;
1108
+ return (0);
1109
+ }
1110
+
1111
+ static proc lpGraphOfNChains(ideal G) // G must be reduced
1112
+ {
1113
+ list LG = lpId2ivLi(lead(G));
1114
+ int n = lpVarBlockSize(basering);
1115
+ int degbound = lpDegBound(basering);
1116
+
1117
+ list V;
1118
+ for (int i = 0; i <= n; i++) {
1119
+ V[i+1] = i; // add 1 and all variables
1120
+ } kill i;
1121
+ for (int i = 1; i <= size(LG); i++) {
1122
+ intvec u = LG[i];
1123
+ for (int j = 2; j <= size(u); j++) {
1124
+ intvec v = u[j..size(u)];
1125
+ if (!contains(V, v)) {
1126
+ V = insert(V, v, size(V)); // add subword j..size
1127
+ }
1128
+ kill v;
1129
+ } kill j;
1130
+ kill u;
1131
+ } kill i;
1132
+ int nV = size(V);
1133
+ intmat GNC[nV][nV]; // graph of n-chains
1134
+
1135
+ // for vertex 1
1136
+ for (int i = 2; i <= n + 1; i++) {
1137
+ GNC[1,i] = 1; // 1 has an edge to all variables
1138
+ } kill i;
1139
+
1140
+ // for the other vertices
1141
+ for (int i = 2; i <= nV; i++) {
1142
+ for (int j = 2; j <= nV; j++) {
1143
+ intvec uv = V[i],V[j];
1144
+
1145
+ if (contains(LG, uv)) {
1146
+ GNC[i,j] = 1;
1147
+ } else {
1148
+ // Li p. 177
1149
+ // search for a right divisor 'w' of uv in G
1150
+ // then check if G doesn't divide the subword uv-1
1151
+
1152
+ // look for a right divisor in LG
1153
+ for (int k = 1; k <= size(LG); k++) {
1154
+ if (isSF(LG[k], uv)) {
1155
+ // w = LG[k]
1156
+ if(!ivdivides(LG, uv[1..(size(uv)-1)])) {
1157
+ // G doesn't divide uv-1
1158
+ GNC[i,j] = 1;
1159
+ break;
1160
+ }
1161
+ }
1162
+ } kill k;
1163
+ }
1164
+ kill uv;
1165
+ } kill j;
1166
+ } kill i;
1167
+
1168
+ return(GNC);
1169
+ }
1170
+
1171
+ static proc contains(list L, def item)
1172
+ {
1173
+ for (int i = 1; i <= size(L); i++) {
1174
+ if (L[i] == item) {
1175
+ return (1);
1176
+ }
1177
+ } kill i;
1178
+ return (0);
1179
+ }
1180
+
1181
+ proc lpSubstitute(poly f, ideal s1, ideal s2, list #)
1182
+ "USAGE: lpSubstitute(f,s1,s2[,G]); f poly, s1 list (ideal) of variables
1183
+ to replace, s2 list (ideal) of polynomials to replace with, G optional ideal to
1184
+ reduce with.
1185
+ RETURN: poly, the substituted polynomial
1186
+ ASSUME: - basering is a Letterplace ring
1187
+ - s1 contains a subset of the set of variables
1188
+ - s2 and s1 are of the same size
1189
+ - G is a Groebner basis,
1190
+ - the current ring has a sufficient degbound (which also can be calculated with lpCalcSubstDegBound())
1191
+ NOTE: the procedure implements the image of a polynomial f
1192
+ under an endomorphism of a free algebra, defined by s1 and s2:
1193
+ variables, not present in s1, are left unchanged;
1194
+ variable s1[k] is mapped to a polynomial s2[k].
1195
+ - An optional ideal G extends the endomorphism as above to the morphism into the factor algebra K<X>/G.
1196
+ EXAMPLE: example lpSubstitute; shows examples
1197
+ "
1198
+ {
1199
+ ideal G;
1200
+ if (size(#) > 0) {
1201
+ if (typeof(#[1])=="ideal") {
1202
+ G = #[1];
1203
+ }
1204
+ }
1205
+
1206
+ poly fs;
1207
+ for (int i = 1; i <= size(f); i++) {
1208
+ poly fis = leadcoef(f[i]);
1209
+ intvec ivfi = lp2iv(f[i]);
1210
+ for (int j = 1; j <= size(ivfi); j++) {
1211
+ int varindex = ivfi[j];
1212
+ if (varindex > 0) {
1213
+ int subindex = lpIndexOf(s1, var(varindex));
1214
+ if (subindex > 0) {
1215
+ s2[subindex] = lpNF(s2[subindex],G);
1216
+ fis = fis * s2[subindex];
1217
+ } else {
1218
+ fis = fis * lpNF(iv2lp(varindex),G);
1219
+ }
1220
+ /*fis = lpNF(fis,G);*/
1221
+ kill subindex;
1222
+ }
1223
+ kill varindex;
1224
+ } kill j;
1225
+ kill ivfi;
1226
+ fs = fs + fis;
1227
+ kill fis;
1228
+ }
1229
+ kill i;
1230
+ fs = lpNF(fs, G);
1231
+ return (fs);
1232
+ }
1233
+ example
1234
+ {
1235
+ "EXAMPLE:"; echo = 2;
1236
+ ring r = 0,(x,y,z),dp;
1237
+ def R = freeAlgebra(r, 4);
1238
+ setring R;
1239
+ ideal G = x*y; // optional
1240
+ poly f = 3*x*x+y*x;
1241
+ ideal s1 = x, y;
1242
+ ideal s2 = y*z*z, x; // i.e. x --> yzz and y --> x
1243
+ // the substitution probably needs a higher degbound
1244
+ int minDegBound = lpCalcSubstDegBound(f,s1,s2);
1245
+ minDegBound; // thus the bound needs to be increased
1246
+ setring r; // back to original r
1247
+ def R1 = freeAlgebra(r, minDegBound);
1248
+ setring R1;
1249
+ lpSubstitute(imap(R,f), imap(R,s1), imap(R,s2));
1250
+ // the last parameter is optional; above it was G=<xy>
1251
+ // the output will be reduced with respect to G
1252
+ lpSubstitute(imap(R,f), imap(R,s1), imap(R,s2), imap(R,G));
1253
+ }
1254
+
1255
+ // another example:
1256
+ /*
1257
+ //////// EXAMPLE B ////////
1258
+ ring r = 0,(x,y,z),dp;
1259
+ def R = freeAlgebra(r, 4);
1260
+ setring R;
1261
+
1262
+ poly f = 3*x*x+y*x;
1263
+ poly g = z*x+y;
1264
+ poly h = 7*x*z+x;
1265
+ ideal I = f,g,h;
1266
+ ideal s1 = x, y;
1267
+ ideal s2 = y*z*z, x;
1268
+
1269
+ int minDegBound = lpCalcSubstDegBound(I,s1,s2);
1270
+ setring r;
1271
+ def R1 = freeAlgebra(r, minDegBound);
1272
+ setring R1;
1273
+
1274
+ ideal I = imap(R,I);
1275
+ ideal s1 = imap(R,s1);
1276
+ ideal s2 = imap(R,s2);
1277
+ for (int i = 1; i <= size(I); i++) {
1278
+ lpSubstitute(I[i], s1, s2);
1279
+ }
1280
+ */
1281
+
1282
+ static proc lpIndexOf(ideal I, poly p) {
1283
+ for (int i = 1; i <= size(I); i++) {
1284
+ if (I[i] == p) {
1285
+ return (i);
1286
+ }
1287
+ } kill i;
1288
+ return (-1);
1289
+ }
1290
+
1291
+ static proc ivIndexOf(list L, intvec iv) {
1292
+ for (int i = 1; i <= size(L); i++) {
1293
+ if (L[i] == iv) {
1294
+ return (i);
1295
+ }
1296
+ } kill i;
1297
+ return (-1);
1298
+ }
1299
+
1300
+
1301
+ static proc lpCalcSubstDegBoundSingle(poly f, ideal s1, ideal s2)
1302
+ "USAGE: lpCalcSubstDegBoundSingle(f,s1,s2); f letterplace polynomial, s1 list (ideal) of variables
1303
+ to replace, s2 list (ideal) of polynomials to replace with
1304
+ RETURN: int, the min degbound required to perform the substitution
1305
+ ASSUME: - basering is a Letterplace ring
1306
+ EXAMPLE: example lpCalcSubstDegBoundSingle; shows examples
1307
+ "
1308
+ {
1309
+ int maxDegBound = 0;
1310
+ for (int i = 1; i <= size(f); i++) {
1311
+ intvec ivfi = lp2iv(f[i]);
1312
+ int tmpDegBound;
1313
+ for (int j = 1; j <= size(ivfi); j++) {
1314
+ int varindex = ivfi[j];
1315
+ if (varindex > 0) {
1316
+ int subindex = lpIndexOf(s1, var(varindex));
1317
+ if (subindex > 0) {
1318
+ tmpDegBound = tmpDegBound + deg(s2[subindex]);
1319
+ } else {
1320
+ tmpDegBound = tmpDegBound + 1;
1321
+ }
1322
+ kill subindex;
1323
+ }
1324
+ kill varindex;
1325
+ } kill j;
1326
+ if (tmpDegBound > maxDegBound) {
1327
+ maxDegBound = tmpDegBound;
1328
+ }
1329
+ kill ivfi; kill tmpDegBound;
1330
+ } kill i;
1331
+
1332
+ // increase degbound by 50% when ideal is provided
1333
+ // needed for lpNF
1334
+ maxDegBound = maxDegBound + (maxDegBound div 2);
1335
+
1336
+ return (maxDegBound);
1337
+ }
1338
+ example
1339
+ {
1340
+ // see lpCalcSubstDegBound()
1341
+ }
1342
+
1343
+ proc lpCalcSubstDegBound(ideal I, ideal s1, ideal s2)
1344
+ "USAGE: lpCalcSubstDegBound(I,s1,s2); I ideal of polynomials, s1 ideal of variables to replace, s2 ideal of polynomials to replace with
1345
+ RETURN: int, the min degbound required to perform all of the substitutions
1346
+ ASSUME: - basering is a Letterplace ring
1347
+ EXAMPLE: example lpCalcSubstDegBound; shows examples
1348
+ NOTE: convenience method
1349
+ "
1350
+ {
1351
+ int maxDegBound = 0;
1352
+ for (int i = 1; i <= size(I); i++) {
1353
+ int tmpDegBound = lpCalcSubstDegBoundSingle(I[i], s1, s2, #);
1354
+ if (tmpDegBound > maxDegBound) {
1355
+ maxDegBound = tmpDegBound;
1356
+ }
1357
+ kill tmpDegBound;
1358
+ } kill i;
1359
+ return (maxDegBound);
1360
+ }
1361
+ example
1362
+ {
1363
+ "EXAMPLE:"; echo = 2;
1364
+ ring r = 0,(x,y,z),dp;
1365
+ def R = freeAlgebra(r, 4);
1366
+ setring R;
1367
+ ideal I = 3*x*x+y*x, x*y*x - z;
1368
+ ideal s1 = x, y; // z --> z
1369
+ ideal s2 = y*z*z, x; // i.e. x --> yzz and y --> x
1370
+ // the substitution probably needs a higher degbound
1371
+ lpCalcSubstDegBound(I,s1,s2);
1372
+ lpCalcSubstDegBound(I[1],s1,s2);
1373
+ }
1374
+
1375
+ static proc isSF(intvec S, intvec I)
1376
+ "
1377
+ PURPOSE:
1378
+ checks, if a word S is a suffix of another word I
1379
+ "
1380
+ {
1381
+ int n = size(S);
1382
+ if (n <= 0 || S == 0) {return(1);}
1383
+ int m = size(I);
1384
+ if (m < n) {return(0);}
1385
+ intvec IS = I[(m-n+1)..m];
1386
+ if (IS == S) {return(1);}
1387
+ else {return(0);}
1388
+ }
1389
+
1390
+ static proc isIF(intvec IF, intvec I)
1391
+ "
1392
+ PURPOSE:
1393
+ checks, if a word IF is an infix of another word I
1394
+ "
1395
+ {
1396
+ int n = size(IF);
1397
+ int m = size(I);
1398
+
1399
+ if (n <= 0 || IF == 0) {return(1);}
1400
+ if (m < n) {return(0);}
1401
+
1402
+ for (int i = 0; (n + i) <= m; i++){
1403
+ intvec IIF = I[(1 + i)..(n + i)];
1404
+ if (IIF == IF) {
1405
+ return(1);
1406
+ }
1407
+ kill IIF;
1408
+ } kill i;
1409
+ return(0);
1410
+ }
1411
+
1412
+ // no longer working with new interface and new orderings
1413
+ /* // TODO: use original ring attrib to create a new letterplace ring */
1414
+ /* // removes a variable from a letterplace ring (a bit of a hack) */
1415
+ /* static proc lpDelVar(int index) { */
1416
+ /* int lV = lpVarBlockSize(basering); // number of variables in the main block */
1417
+ /* int d = lpDegBound(basering); // degree bround */
1418
+ /* list LR = ringlist(basering); */
1419
+
1420
+ /* if (!(index >= 1 && index <= lV)) { return (basering); } // invalid index */
1421
+
1422
+ /* // remove from the variable list */
1423
+ /* for (int i = (d-1)*lV + index; i >= 1; i = i - lV) { */
1424
+ /* LR[2] = delete(LR[2], i); */
1425
+ /* } kill i; */
1426
+
1427
+ /* // remove from a ordering */
1428
+ /* intvec aiv = LR[3][1][2]; */
1429
+ /* aiv = aiv[1..(d*lV-d)]; */
1430
+ /* LR[3][1][2] = aiv; */
1431
+
1432
+ /* // remove block orderings */
1433
+ /* int del = (lV - index); */
1434
+ /* int cnt = -1; */
1435
+ /* for (int i = size(LR[3]); i >= 2; i--) { */
1436
+ /* if (LR[3][i][2] != 0) { */
1437
+ /* for (int j = size(LR[3][i][2]); j >= 1; j--) { */
1438
+ /* cnt++; // next 1 */
1439
+ /* if (cnt%lV == del) { */
1440
+ /* // delete */
1441
+ /* if (size(LR[3][i][2]) > 1) { // if we have more than one element left, delete one */
1442
+ /* LR[3][i][2] = delete(LR[3][i][2],j); */
1443
+ /* } else { // otherwise delete the whole block */
1444
+ /* LR[3] = delete(LR[3], i); */
1445
+ /* break; */
1446
+ /* } */
1447
+ /* } */
1448
+ /* } kill j; */
1449
+ /* } */
1450
+ /* } kill i; */
1451
+
1452
+ /* def R = setLetterplaceAttributes(ring(LR),d,lV-1); */
1453
+ /* return (R); */
1454
+ /* } */
1455
+ /* example */
1456
+ /* { */
1457
+ /* "EXAMPLE:"; echo = 2; */
1458
+ /* ring r = 0,(x,y,z),dp; */
1459
+ /* def A = freeAlgebra(r, 3); */
1460
+ /* setring A; A; */
1461
+ /* def R = lpDelVar(2); setring R; R; */
1462
+ /* } */