passagemath-singular 10.6.31rc3__cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.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 (490) hide show
  1. PySingular.cpython-314-aarch64-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 +490 -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-6a2a8666.4.1.so +0 -0
  7. passagemath_singular.libs/libcddgmp-ac579979.so.0.1.3 +0 -0
  8. passagemath_singular.libs/libfactory-4-66e33516.4.1.so +0 -0
  9. passagemath_singular.libs/libflint-81de1160.so.21.0.0 +0 -0
  10. passagemath_singular.libs/libgf2x-fbd36f80.so.3.0.0 +0 -0
  11. passagemath_singular.libs/libgfortran-e1b7dfc8.so.5.0.0 +0 -0
  12. passagemath_singular.libs/libgmp-93ebf16a.so.10.5.0 +0 -0
  13. passagemath_singular.libs/libgsl-e3525837.so.28.0.0 +0 -0
  14. passagemath_singular.libs/libmpfr-e0f11cf3.so.6.2.1 +0 -0
  15. passagemath_singular.libs/libntl-0043a3a2.so.44.0.1 +0 -0
  16. passagemath_singular.libs/libomalloc-0-06512335.9.6.so +0 -0
  17. passagemath_singular.libs/libopenblasp-r0-4c5b64b1.3.29.so +0 -0
  18. passagemath_singular.libs/libpolys-4-cb7246b5.4.1.so +0 -0
  19. passagemath_singular.libs/libreadline-28330744.so.8.2 +0 -0
  20. passagemath_singular.libs/libsingular_resources-4-8c425241.4.1.so +0 -0
  21. passagemath_singular.libs/libtinfo-f81c2d16.so.6.3 +0 -0
  22. sage/algebras/all__sagemath_singular.py +3 -0
  23. sage/algebras/fusion_rings/all.py +19 -0
  24. sage/algebras/fusion_rings/f_matrix.py +2448 -0
  25. sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-aarch64-linux-gnu.so +0 -0
  26. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
  27. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
  28. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-aarch64-linux-gnu.so +0 -0
  29. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
  30. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
  31. sage/algebras/fusion_rings/fusion_double.py +899 -0
  32. sage/algebras/fusion_rings/fusion_ring.py +1580 -0
  33. sage/algebras/fusion_rings/poly_tup_engine.cpython-314-aarch64-linux-gnu.so +0 -0
  34. sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
  35. sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
  36. sage/algebras/fusion_rings/shm_managers.cpython-314-aarch64-linux-gnu.so +0 -0
  37. sage/algebras/fusion_rings/shm_managers.pxd +24 -0
  38. sage/algebras/fusion_rings/shm_managers.pyx +780 -0
  39. sage/algebras/letterplace/all.py +1 -0
  40. sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-aarch64-linux-gnu.so +0 -0
  41. sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
  42. sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
  43. sage/algebras/letterplace/free_algebra_letterplace.cpython-314-aarch64-linux-gnu.so +0 -0
  44. sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
  45. sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
  46. sage/algebras/letterplace/letterplace_ideal.cpython-314-aarch64-linux-gnu.so +0 -0
  47. sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
  48. sage/algebras/quatalg/all.py +2 -0
  49. sage/algebras/quatalg/quaternion_algebra.py +4778 -0
  50. sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-aarch64-linux-gnu.so +0 -0
  51. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  52. sage/algebras/quatalg/quaternion_algebra_element.cpython-314-aarch64-linux-gnu.so +0 -0
  53. sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
  54. sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
  55. sage/all__sagemath_singular.py +11 -0
  56. sage/ext_data/all__sagemath_singular.py +1 -0
  57. sage/ext_data/singular/function_field/core.lib +98 -0
  58. sage/interfaces/all__sagemath_singular.py +1 -0
  59. sage/interfaces/singular.py +2835 -0
  60. sage/libs/all__sagemath_singular.py +1 -0
  61. sage/libs/singular/__init__.py +1 -0
  62. sage/libs/singular/decl.pxd +1168 -0
  63. sage/libs/singular/function.cpython-314-aarch64-linux-gnu.so +0 -0
  64. sage/libs/singular/function.pxd +87 -0
  65. sage/libs/singular/function.pyx +1901 -0
  66. sage/libs/singular/function_factory.py +61 -0
  67. sage/libs/singular/groebner_strategy.cpython-314-aarch64-linux-gnu.so +0 -0
  68. sage/libs/singular/groebner_strategy.pxd +22 -0
  69. sage/libs/singular/groebner_strategy.pyx +582 -0
  70. sage/libs/singular/option.cpython-314-aarch64-linux-gnu.so +0 -0
  71. sage/libs/singular/option.pyx +671 -0
  72. sage/libs/singular/polynomial.cpython-314-aarch64-linux-gnu.so +0 -0
  73. sage/libs/singular/polynomial.pxd +39 -0
  74. sage/libs/singular/polynomial.pyx +661 -0
  75. sage/libs/singular/ring.cpython-314-aarch64-linux-gnu.so +0 -0
  76. sage/libs/singular/ring.pxd +58 -0
  77. sage/libs/singular/ring.pyx +893 -0
  78. sage/libs/singular/singular.cpython-314-aarch64-linux-gnu.so +0 -0
  79. sage/libs/singular/singular.pxd +72 -0
  80. sage/libs/singular/singular.pyx +1944 -0
  81. sage/libs/singular/standard_options.py +145 -0
  82. sage/matrix/all__sagemath_singular.py +1 -0
  83. sage/matrix/matrix_mpolynomial_dense.cpython-314-aarch64-linux-gnu.so +0 -0
  84. sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
  85. sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
  86. sage/rings/all__sagemath_singular.py +1 -0
  87. sage/rings/function_field/all__sagemath_singular.py +1 -0
  88. sage/rings/function_field/derivations_polymod.py +911 -0
  89. sage/rings/function_field/element_polymod.cpython-314-aarch64-linux-gnu.so +0 -0
  90. sage/rings/function_field/element_polymod.pyx +406 -0
  91. sage/rings/function_field/function_field_polymod.py +2611 -0
  92. sage/rings/function_field/ideal_polymod.py +1775 -0
  93. sage/rings/function_field/order_polymod.py +1475 -0
  94. sage/rings/function_field/place_polymod.py +681 -0
  95. sage/rings/polynomial/all__sagemath_singular.py +1 -0
  96. sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-aarch64-linux-gnu.so +0 -0
  97. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
  98. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
  99. sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-aarch64-linux-gnu.so +0 -0
  100. sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
  101. sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
  102. sage/rings/polynomial/plural.cpython-314-aarch64-linux-gnu.so +0 -0
  103. sage/rings/polynomial/plural.pxd +48 -0
  104. sage/rings/polynomial/plural.pyx +3171 -0
  105. sage/symbolic/all__sagemath_singular.py +1 -0
  106. sage/symbolic/comparison_impl.pxi +428 -0
  107. sage/symbolic/constants_c_impl.pxi +178 -0
  108. sage/symbolic/expression.cpython-314-aarch64-linux-gnu.so +0 -0
  109. sage/symbolic/expression.pxd +7 -0
  110. sage/symbolic/expression.pyx +14200 -0
  111. sage/symbolic/getitem_impl.pxi +202 -0
  112. sage/symbolic/pynac.pxi +572 -0
  113. sage/symbolic/pynac_constant_impl.pxi +133 -0
  114. sage/symbolic/pynac_function_impl.pxi +206 -0
  115. sage/symbolic/pynac_impl.pxi +2576 -0
  116. sage/symbolic/pynac_wrap.h +124 -0
  117. sage/symbolic/series_impl.pxi +272 -0
  118. sage/symbolic/substitution_map_impl.pxi +94 -0
  119. sage_wheels/bin/ESingular +0 -0
  120. sage_wheels/bin/Singular +0 -0
  121. sage_wheels/bin/TSingular +0 -0
  122. sage_wheels/lib/singular/MOD/cohomo.la +41 -0
  123. sage_wheels/lib/singular/MOD/cohomo.so +0 -0
  124. sage_wheels/lib/singular/MOD/customstd.la +41 -0
  125. sage_wheels/lib/singular/MOD/customstd.so +0 -0
  126. sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
  127. sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
  128. sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
  129. sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
  130. sage_wheels/lib/singular/MOD/gitfan.la +41 -0
  131. sage_wheels/lib/singular/MOD/gitfan.so +0 -0
  132. sage_wheels/lib/singular/MOD/interval.la +41 -0
  133. sage_wheels/lib/singular/MOD/interval.so +0 -0
  134. sage_wheels/lib/singular/MOD/loctriv.la +41 -0
  135. sage_wheels/lib/singular/MOD/loctriv.so +0 -0
  136. sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
  137. sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
  138. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
  139. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
  140. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
  141. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
  142. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
  143. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
  144. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
  145. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
  146. sage_wheels/lib/singular/MOD/partialgb.la +41 -0
  147. sage_wheels/lib/singular/MOD/partialgb.so +0 -0
  148. sage_wheels/lib/singular/MOD/pyobject.la +41 -0
  149. sage_wheels/lib/singular/MOD/pyobject.so +0 -0
  150. sage_wheels/lib/singular/MOD/singmathic.la +41 -0
  151. sage_wheels/lib/singular/MOD/singmathic.so +0 -0
  152. sage_wheels/lib/singular/MOD/sispasm.la +41 -0
  153. sage_wheels/lib/singular/MOD/sispasm.so +0 -0
  154. sage_wheels/lib/singular/MOD/subsets.la +41 -0
  155. sage_wheels/lib/singular/MOD/subsets.so +0 -0
  156. sage_wheels/lib/singular/MOD/systhreads.la +41 -0
  157. sage_wheels/lib/singular/MOD/systhreads.so +0 -0
  158. sage_wheels/lib/singular/MOD/syzextra.la +41 -0
  159. sage_wheels/lib/singular/MOD/syzextra.so +0 -0
  160. sage_wheels/libexec/singular/MOD/change_cost +0 -0
  161. sage_wheels/libexec/singular/MOD/singularsurf +11 -0
  162. sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
  163. sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
  164. sage_wheels/libexec/singular/MOD/solve_IP +0 -0
  165. sage_wheels/libexec/singular/MOD/surfex +16 -0
  166. sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
  167. sage_wheels/share/factory/gftables/10201 +342 -0
  168. sage_wheels/share/factory/gftables/1024 +37 -0
  169. sage_wheels/share/factory/gftables/10609 +356 -0
  170. sage_wheels/share/factory/gftables/11449 +384 -0
  171. sage_wheels/share/factory/gftables/11881 +398 -0
  172. sage_wheels/share/factory/gftables/121 +6 -0
  173. sage_wheels/share/factory/gftables/12167 +408 -0
  174. sage_wheels/share/factory/gftables/125 +7 -0
  175. sage_wheels/share/factory/gftables/12769 +428 -0
  176. sage_wheels/share/factory/gftables/128 +7 -0
  177. sage_wheels/share/factory/gftables/1331 +47 -0
  178. sage_wheels/share/factory/gftables/1369 +48 -0
  179. sage_wheels/share/factory/gftables/14641 +490 -0
  180. sage_wheels/share/factory/gftables/15625 +523 -0
  181. sage_wheels/share/factory/gftables/16 +3 -0
  182. sage_wheels/share/factory/gftables/16129 +540 -0
  183. sage_wheels/share/factory/gftables/16384 +549 -0
  184. sage_wheels/share/factory/gftables/16807 +563 -0
  185. sage_wheels/share/factory/gftables/1681 +58 -0
  186. sage_wheels/share/factory/gftables/169 +8 -0
  187. sage_wheels/share/factory/gftables/17161 +574 -0
  188. sage_wheels/share/factory/gftables/1849 +64 -0
  189. sage_wheels/share/factory/gftables/18769 +628 -0
  190. sage_wheels/share/factory/gftables/19321 +646 -0
  191. sage_wheels/share/factory/gftables/19683 +659 -0
  192. sage_wheels/share/factory/gftables/2048 +71 -0
  193. sage_wheels/share/factory/gftables/2187 +75 -0
  194. sage_wheels/share/factory/gftables/2197 +76 -0
  195. sage_wheels/share/factory/gftables/2209 +76 -0
  196. sage_wheels/share/factory/gftables/22201 +742 -0
  197. sage_wheels/share/factory/gftables/22801 +762 -0
  198. sage_wheels/share/factory/gftables/2401 +82 -0
  199. sage_wheels/share/factory/gftables/243 +11 -0
  200. sage_wheels/share/factory/gftables/24389 +815 -0
  201. sage_wheels/share/factory/gftables/24649 +824 -0
  202. sage_wheels/share/factory/gftables/25 +3 -0
  203. sage_wheels/share/factory/gftables/256 +11 -0
  204. sage_wheels/share/factory/gftables/26569 +888 -0
  205. sage_wheels/share/factory/gftables/27 +3 -0
  206. sage_wheels/share/factory/gftables/27889 +932 -0
  207. sage_wheels/share/factory/gftables/2809 +96 -0
  208. sage_wheels/share/factory/gftables/28561 +954 -0
  209. sage_wheels/share/factory/gftables/289 +12 -0
  210. sage_wheels/share/factory/gftables/29791 +995 -0
  211. sage_wheels/share/factory/gftables/29929 +1000 -0
  212. sage_wheels/share/factory/gftables/3125 +107 -0
  213. sage_wheels/share/factory/gftables/32 +4 -0
  214. sage_wheels/share/factory/gftables/32041 +1070 -0
  215. sage_wheels/share/factory/gftables/32761 +1094 -0
  216. sage_wheels/share/factory/gftables/32768 +1095 -0
  217. sage_wheels/share/factory/gftables/343 +14 -0
  218. sage_wheels/share/factory/gftables/3481 +118 -0
  219. sage_wheels/share/factory/gftables/361 +14 -0
  220. sage_wheels/share/factory/gftables/36481 +1218 -0
  221. sage_wheels/share/factory/gftables/3721 +126 -0
  222. sage_wheels/share/factory/gftables/37249 +1244 -0
  223. sage_wheels/share/factory/gftables/38809 +1296 -0
  224. sage_wheels/share/factory/gftables/39601 +1322 -0
  225. sage_wheels/share/factory/gftables/4 +3 -0
  226. sage_wheels/share/factory/gftables/4096 +139 -0
  227. sage_wheels/share/factory/gftables/44521 +1486 -0
  228. sage_wheels/share/factory/gftables/4489 +152 -0
  229. sage_wheels/share/factory/gftables/49 +4 -0
  230. sage_wheels/share/factory/gftables/4913 +166 -0
  231. sage_wheels/share/factory/gftables/49729 +1660 -0
  232. sage_wheels/share/factory/gftables/5041 +170 -0
  233. sage_wheels/share/factory/gftables/50653 +1691 -0
  234. sage_wheels/share/factory/gftables/512 +20 -0
  235. sage_wheels/share/factory/gftables/51529 +1720 -0
  236. sage_wheels/share/factory/gftables/52441 +1750 -0
  237. sage_wheels/share/factory/gftables/529 +20 -0
  238. sage_wheels/share/factory/gftables/5329 +180 -0
  239. sage_wheels/share/factory/gftables/54289 +1812 -0
  240. sage_wheels/share/factory/gftables/57121 +1906 -0
  241. sage_wheels/share/factory/gftables/58081 +1938 -0
  242. sage_wheels/share/factory/gftables/59049 +1971 -0
  243. sage_wheels/share/factory/gftables/6241 +210 -0
  244. sage_wheels/share/factory/gftables/625 +23 -0
  245. sage_wheels/share/factory/gftables/63001 +2102 -0
  246. sage_wheels/share/factory/gftables/64 +5 -0
  247. sage_wheels/share/factory/gftables/6561 +221 -0
  248. sage_wheels/share/factory/gftables/6859 +231 -0
  249. sage_wheels/share/factory/gftables/6889 +232 -0
  250. sage_wheels/share/factory/gftables/729 +27 -0
  251. sage_wheels/share/factory/gftables/7921 +266 -0
  252. sage_wheels/share/factory/gftables/8 +3 -0
  253. sage_wheels/share/factory/gftables/81 +5 -0
  254. sage_wheels/share/factory/gftables/8192 +276 -0
  255. sage_wheels/share/factory/gftables/841 +30 -0
  256. sage_wheels/share/factory/gftables/9 +3 -0
  257. sage_wheels/share/factory/gftables/9409 +316 -0
  258. sage_wheels/share/factory/gftables/961 +34 -0
  259. sage_wheels/share/info/singular.info +191898 -0
  260. sage_wheels/share/singular/LIB/GND.lib +1359 -0
  261. sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
  262. sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
  263. sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
  264. sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
  265. sage_wheels/share/singular/LIB/VecField.lib +1542 -0
  266. sage_wheels/share/singular/LIB/absfact.lib +959 -0
  267. sage_wheels/share/singular/LIB/ainvar.lib +730 -0
  268. sage_wheels/share/singular/LIB/aksaka.lib +419 -0
  269. sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
  270. sage_wheels/share/singular/LIB/algebra.lib +1193 -0
  271. sage_wheels/share/singular/LIB/all.lib +136 -0
  272. sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
  273. sage_wheels/share/singular/LIB/arnold.lib +4553 -0
  274. sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
  275. sage_wheels/share/singular/LIB/arr.lib +3486 -0
  276. sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
  277. sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
  278. sage_wheels/share/singular/LIB/bfun.lib +1964 -0
  279. sage_wheels/share/singular/LIB/bimodules.lib +774 -0
  280. sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
  281. sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
  282. sage_wheels/share/singular/LIB/central.lib +2169 -0
  283. sage_wheels/share/singular/LIB/chern.lib +4162 -0
  284. sage_wheels/share/singular/LIB/cimonom.lib +571 -0
  285. sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
  286. sage_wheels/share/singular/LIB/classify.lib +3239 -0
  287. sage_wheels/share/singular/LIB/classify2.lib +1462 -0
  288. sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
  289. sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
  290. sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
  291. sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
  292. sage_wheels/share/singular/LIB/combinat.lib +91 -0
  293. sage_wheels/share/singular/LIB/compregb.lib +276 -0
  294. sage_wheels/share/singular/LIB/control.lib +1636 -0
  295. sage_wheels/share/singular/LIB/crypto.lib +3795 -0
  296. sage_wheels/share/singular/LIB/curveInv.lib +667 -0
  297. sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
  298. sage_wheels/share/singular/LIB/customstd.lib +100 -0
  299. sage_wheels/share/singular/LIB/deRham.lib +5979 -0
  300. sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
  301. sage_wheels/share/singular/LIB/decomp.lib +1655 -0
  302. sage_wheels/share/singular/LIB/deflation.lib +872 -0
  303. sage_wheels/share/singular/LIB/deform.lib +925 -0
  304. sage_wheels/share/singular/LIB/difform.lib +3055 -0
  305. sage_wheels/share/singular/LIB/divisors.lib +750 -0
  306. sage_wheels/share/singular/LIB/dmod.lib +5817 -0
  307. sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
  308. sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
  309. sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
  310. sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
  311. sage_wheels/share/singular/LIB/dummy.lib +17 -0
  312. sage_wheels/share/singular/LIB/elim.lib +1009 -0
  313. sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
  314. sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
  315. sage_wheels/share/singular/LIB/equising.lib +2127 -0
  316. sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
  317. sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
  318. sage_wheels/share/singular/LIB/findifs.lib +778 -0
  319. sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
  320. sage_wheels/share/singular/LIB/finvar.lib +7989 -0
  321. sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
  322. sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
  323. sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
  324. sage_wheels/share/singular/LIB/freegb.lib +3853 -0
  325. sage_wheels/share/singular/LIB/general.lib +1350 -0
  326. sage_wheels/share/singular/LIB/gfan.lib +1768 -0
  327. sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
  328. sage_wheels/share/singular/LIB/gkdim.lib +99 -0
  329. sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
  330. sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
  331. sage_wheels/share/singular/LIB/goettsche.lib +909 -0
  332. sage_wheels/share/singular/LIB/graal.lib +1366 -0
  333. sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
  334. sage_wheels/share/singular/LIB/graphics.lib +360 -0
  335. sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
  336. sage_wheels/share/singular/LIB/groups.lib +1123 -0
  337. sage_wheels/share/singular/LIB/grwalk.lib +507 -0
  338. sage_wheels/share/singular/LIB/hdepth.lib +194 -0
  339. sage_wheels/share/singular/LIB/help.cnf +57 -0
  340. sage_wheels/share/singular/LIB/hess.lib +1946 -0
  341. sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
  342. sage_wheels/share/singular/LIB/hodge.lib +400 -0
  343. sage_wheels/share/singular/LIB/homolog.lib +1965 -0
  344. sage_wheels/share/singular/LIB/hyperel.lib +975 -0
  345. sage_wheels/share/singular/LIB/inout.lib +679 -0
  346. sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
  347. sage_wheels/share/singular/LIB/interval.lib +1418 -0
  348. sage_wheels/share/singular/LIB/intprog.lib +778 -0
  349. sage_wheels/share/singular/LIB/invar.lib +443 -0
  350. sage_wheels/share/singular/LIB/involut.lib +980 -0
  351. sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
  352. sage_wheels/share/singular/LIB/kskernel.lib +534 -0
  353. sage_wheels/share/singular/LIB/latex.lib +3146 -0
  354. sage_wheels/share/singular/LIB/lejeune.lib +651 -0
  355. sage_wheels/share/singular/LIB/linalg.lib +2040 -0
  356. sage_wheels/share/singular/LIB/locnormal.lib +212 -0
  357. sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
  358. sage_wheels/share/singular/LIB/makedbm.lib +294 -0
  359. sage_wheels/share/singular/LIB/mathml.lib +813 -0
  360. sage_wheels/share/singular/LIB/matrix.lib +1372 -0
  361. sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
  362. sage_wheels/share/singular/LIB/methods.lib +212 -0
  363. sage_wheels/share/singular/LIB/moddiq.lib +322 -0
  364. sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
  365. sage_wheels/share/singular/LIB/modnormal.lib +218 -0
  366. sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
  367. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  368. sage_wheels/share/singular/LIB/modstd.lib +1024 -0
  369. sage_wheels/share/singular/LIB/modular.lib +545 -0
  370. sage_wheels/share/singular/LIB/modules.lib +2561 -0
  371. sage_wheels/share/singular/LIB/modwalk.lib +609 -0
  372. sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
  373. sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
  374. sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
  375. sage_wheels/share/singular/LIB/mregular.lib +1863 -0
  376. sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
  377. sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
  378. sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
  379. sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
  380. sage_wheels/share/singular/LIB/ncall.lib +31 -0
  381. sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
  382. sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
  383. sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
  384. sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
  385. sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
  386. sage_wheels/share/singular/LIB/ncloc.lib +361 -0
  387. sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
  388. sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
  389. sage_wheels/share/singular/LIB/nctools.lib +1887 -0
  390. sage_wheels/share/singular/LIB/nets.lib +1456 -0
  391. sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
  392. sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
  393. sage_wheels/share/singular/LIB/noether.lib +1106 -0
  394. sage_wheels/share/singular/LIB/normal.lib +8700 -0
  395. sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
  396. sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
  397. sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
  398. sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
  399. sage_wheels/share/singular/LIB/olga.lib +1933 -0
  400. sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
  401. sage_wheels/share/singular/LIB/parallel.lib +319 -0
  402. sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
  403. sage_wheels/share/singular/LIB/perron.lib +202 -0
  404. sage_wheels/share/singular/LIB/pfd.lib +2223 -0
  405. sage_wheels/share/singular/LIB/phindex.lib +642 -0
  406. sage_wheels/share/singular/LIB/pointid.lib +673 -0
  407. sage_wheels/share/singular/LIB/polybori.lib +1430 -0
  408. sage_wheels/share/singular/LIB/polyclass.lib +525 -0
  409. sage_wheels/share/singular/LIB/polylib.lib +1174 -0
  410. sage_wheels/share/singular/LIB/polymake.lib +1902 -0
  411. sage_wheels/share/singular/LIB/presolve.lib +1533 -0
  412. sage_wheels/share/singular/LIB/primdec.lib +9576 -0
  413. sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
  414. sage_wheels/share/singular/LIB/primitiv.lib +401 -0
  415. sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
  416. sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
  417. sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
  418. sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
  419. sage_wheels/share/singular/LIB/random.lib +455 -0
  420. sage_wheels/share/singular/LIB/ratgb.lib +489 -0
  421. sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
  422. sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
  423. sage_wheels/share/singular/LIB/realrad.lib +1197 -0
  424. sage_wheels/share/singular/LIB/recover.lib +2628 -0
  425. sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
  426. sage_wheels/share/singular/LIB/reesclos.lib +465 -0
  427. sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
  428. sage_wheels/share/singular/LIB/resgraph.lib +789 -0
  429. sage_wheels/share/singular/LIB/resjung.lib +820 -0
  430. sage_wheels/share/singular/LIB/resolve.lib +5110 -0
  431. sage_wheels/share/singular/LIB/resources.lib +170 -0
  432. sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
  433. sage_wheels/share/singular/LIB/ring.lib +1328 -0
  434. sage_wheels/share/singular/LIB/ringgb.lib +343 -0
  435. sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
  436. sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
  437. sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
  438. sage_wheels/share/singular/LIB/rootsur.lib +886 -0
  439. sage_wheels/share/singular/LIB/rstandard.lib +607 -0
  440. sage_wheels/share/singular/LIB/rwalk.lib +336 -0
  441. sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
  442. sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
  443. sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
  444. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  445. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  446. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  447. sage_wheels/share/singular/LIB/sets.lib +524 -0
  448. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  449. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  450. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  451. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  452. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  453. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  454. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  455. sage_wheels/share/singular/LIB/sresext.lib +757 -0
  456. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  457. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  458. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  459. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  460. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  461. sage_wheels/share/singular/LIB/surf.lib +506 -0
  462. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  463. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  464. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  465. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  466. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  467. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  468. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  469. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  470. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  471. sage_wheels/share/singular/LIB/template.lib +116 -0
  472. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  473. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  474. sage_wheels/share/singular/LIB/triang.lib +1197 -0
  475. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  476. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  477. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  478. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  479. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  480. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  481. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  482. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  483. sage_wheels/share/singular/emacs/COPYING +44 -0
  484. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  485. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  486. sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
  487. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  488. sage_wheels/share/singular/emacs/singular.el +4273 -0
  489. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  490. sage_wheels/share/singular/singular.idx +5002 -0
@@ -0,0 +1,4162 @@
1
+ ////////////////////////////////////////////////////////////////
2
+ version = "version chern.lib 4.3.1.3 Feb_2023 "; // $Id: f95aef23a676db1c4fd3e26c04c2a409dd381591 $
3
+ category = "Chern classes";
4
+ info="
5
+ LIBRARY: chern.lib Symbolic Computations with Chern classes,
6
+ Computation of Chern classes
7
+
8
+ AUTHOR: Oleksandr Iena, o.g.yena@gmail.com
9
+
10
+ OVERVIEW:
11
+ A toolbox for symbolic computations with Chern classes.
12
+ The Aluffi's algorithms for computation of characteristic classes of algebraic varieties
13
+ (Segre, Fulton, Chern-Schwartz-MacPherson classes) are implemented as well.
14
+
15
+
16
+ REFERENCES:
17
+ [1] Aluffi, Paolo Computing characteristic classes of projective schemes.
18
+ Journal of Symbolic Computation, 35 (2003), 3-19.
19
+ [2] Iena, Oleksandr, On symbolic computations with Chern classes:
20
+ remarks on the library chern.lib for Singular,
21
+ http://hdl.handle.net/10993/22395, 2015.
22
+ [3] Lascoux, Alain, Classes de Chern d'un produit tensoriel.
23
+ C. R. Acad. Sci., Paris, Ser. A 286, 385-387 (1978).
24
+ [4] Manivel, Laurent Chern classes of tensor products, arXiv 1012.0014, 2010.
25
+
26
+ PROCEDURES:
27
+ symm(l [,N]); symmetric functions in the entries of l
28
+ symNsym(f, c); symmetric and non-symmetric parts of a polynomial f
29
+ CompleteHomog(N, l); complete homogeneous symmetric functions
30
+ segre(N, c); Segre classes in terms of Chern classes
31
+ chern(N, s); Chern classes in terms of Segre classes
32
+ chNum(N, c); the non-zero Chern numbers in degree N in the entries of c
33
+ chNumbers(N, c); the Chern numbers in degree N in the entries of c
34
+ sum_of_powers(k, l); the sum of k-th powers of the entries of l
35
+ powSumSym(c [,N]); the sums of powers [up to degree N] in terms
36
+ of the elementary symmetric polynomials (entries of l)
37
+ chAll(c [,N]); Chern character in terms of the Chern classes
38
+ chAllInv(c); Chern classes in terms of the Chern character
39
+ chHE(c); the highest term of the Chern character
40
+ ChernRootsSum(a, b); the Chern roots of a direct sum
41
+ chSum(c, C); the Chern classes of a direct sum
42
+ ChernRootsDual(l); the Chern roots of the dual vector bundle
43
+ chDual(c); the Chern classes of the dual vector bundle
44
+ ChernRootsProd(l, L); the Chern roots of a tensor product of vector bundles
45
+ chProd(r, c, R, C [,N]); Chern classes of a tensor product of vector bundles
46
+ chProdE(c, C); Chern classes of a tensor product of vector bundles
47
+ chProdL(r, c, R, C); Chern classes of a tensor product of vector bundles
48
+ chProdLP(r, c, R, C); total Chern class of a tensor product of vector bundles
49
+ chProdM(r, c, R, C); Chern classes of a tensor product of vector bundles
50
+ chProdMP(r, c, R, C); total Chern class of a tensor product of vector bundles
51
+ ChernRootsHom(l, L); the Chern roots of a Hom vector bundle
52
+ chHom(r, c, R, C [,N]); Chern classes of the Hom-vector bundle
53
+ ChernRootsSymm(n, l); the Chern roots of the n-th symmetric power
54
+ of a vector bundle with Chern roots from l
55
+ ChernRootsWedge(n, l); the Chern roots of the n-th exterior power
56
+ of a vector bundle with Chern roots from l
57
+ chSymm(k, r, c [,p]); the rank and the Chern classes of the k-th symmetric power
58
+ of a vector bundle of rank r with Chern classes c
59
+ chSymm2L(r, c); the rank and the Chern classes of the second symmetric power
60
+ of a vector bundle of rank r with Chern classes c
61
+ chSymm2LP(r, c); the total Chern class of the second symmetric power
62
+ of a vector bundle of rank r with Chern classes c
63
+ chWedge(k, r, c [,p]); the rank and the Chern classes of the k-th exterior power
64
+ of a vector bundle of rank r with Chern classes c
65
+ chWedge2L(r, c); the rank and the Chern classes of the second exterior power
66
+ of a vector bundle of rank r with Chern classes c
67
+ chWedge2LP(r, c); the total Chern class of the second exterior power
68
+ of a vector bundle of rank r with Chern classes c
69
+ todd(c [,n]); the Todd class
70
+ toddE(c); the highest term of the Todd class
71
+ Bern(n); the second Bernoulli numbers
72
+ tdCf(n); the coefficients of the Todd class of a line bundle
73
+ tdTerms(n, f); the terms of the Todd class of a line bundle
74
+ corresponding to the Chern root t
75
+ tdFactor(n, t); the Todd class of a line bundle corresponding
76
+ to the Chern root t
77
+ cProj(n); the total Chern class of (the tangent bundle on)
78
+ the projective space P_n
79
+ chProj(n); the Chern character of (the tangent bundle on)
80
+ the projective space P_n
81
+ tdProj(n); the Todd class of (the tangent bundle on)
82
+ the projective space P_n
83
+ eulerChProj(n, r, c); Euler characteristic of a vector bundle on
84
+ the projective space P_n
85
+ via Hirzebruch-Riemann-Roch theorem
86
+ chNumbersProj(n); the Chern numbers of the projective space P_n
87
+ classpoly(l, t); polynomial in t with coefficients from l
88
+ (without constant term)
89
+ chernPoly(l, t); Chern polynomial (constant term 1)
90
+ chernCharPoly(r, l, t); polynomial in t corresponding to the Chern character
91
+ (constant term r)
92
+ toddPoly(td, t); polynomial in t corresponding to the Todd class
93
+ (constant term 1)
94
+ rHRR(N, ch, td); the main ingredient of the right-hand side
95
+ of the Hirzebruch-Riemann-Roch formula
96
+ SchurS(I, S); the Schur polynomial corresponding to partition I
97
+ in terms of the Segre classes S
98
+ SchurCh(I, C); the Schur polynomial corresponding to partition I
99
+ in terms of the Chern classes C
100
+ part(m, n); partitions of integers not exceeding n
101
+ into m non-negative summands
102
+ dualPart(I [,N]); partition dual to I
103
+ PartC(I, m); the complement of a partition with respect to m
104
+ partOver(n, J); partitions over a given partition J with summands not exceeding n
105
+ partUnder(J); partitions under a given partition J
106
+ SegreA(I); Segre class of the projective subscheme defined by I
107
+ FultonA(I); Fulton class of the projective subscheme defined by I
108
+ CSMA(I); Chern-Schwartz-MacPherson class of the
109
+ projective subscheme defined by I
110
+ EulerAff(I); Euler characteristic of the affine subvariety defined by I
111
+ EulerProj(I); Euler characteristic of the projective subvariety defined by I
112
+ ";
113
+
114
+ LIB "general.lib";
115
+ LIB "lrcalc.lib"; // needed for chProdM(..) and chProdMP(..)
116
+ //----------------------------------------------------------
117
+
118
+ proc symm(list l, list #)
119
+ "USAGE: symm(l [,n]); l a list of polynomials, n integer
120
+ RETURN: list of polynomials
121
+ PURPOSE: computes the list of elementary symmetric functions in the entries of l
122
+ EXAMPLE: example symm; shows an example
123
+ NOTE: makes sense only for a list of polynomials
124
+ "
125
+ {
126
+ int N=size(l);
127
+ int n=size(l);
128
+ if(size(#)!=0)
129
+ {
130
+ if( is_integer(#[1]) )
131
+ {
132
+ N = #[1];
133
+ }
134
+ }
135
+ if(n==0) // if the list is empty, return the empty list
136
+ {
137
+ return(list());
138
+ }
139
+ else
140
+ {
141
+ int i, j;
142
+ list rez=list(1, l[1]);
143
+ for(i=2; i<=n; i++)
144
+ {
145
+ if( i<=N )
146
+ {
147
+ rez=rez+list(0);
148
+ }
149
+ for(j = min(i, N); j>=1; j--)
150
+ {
151
+ rez[j+1] = rez[j+1] + rez[j]*l[i];
152
+ }
153
+ }
154
+ return(delete(rez, 1));
155
+ }
156
+ }
157
+ example
158
+ {
159
+ "EXAMPLE:";echo =2;
160
+ // elementary symmetric functions in x, y, z:
161
+ ring r = 0, (x, y, z), dp;
162
+ list l=(x, y, z);
163
+ print(symm(l));
164
+
165
+ //now let us compute only the first two symmetric polynomials in a(1), ... , a(10)
166
+ ring q= 0,(a(1..10)), dp;
167
+ list l=a(1..10);
168
+ print(symm(l, 2));
169
+ }
170
+ //-----------------------------------------------------------------------
171
+
172
+ proc symNsym(poly f, list c)
173
+ "USAGE: symNsym(f, c); f polynomial; c list of polynomials
174
+ RETURN: list with 2 poly entries
175
+ PURPOSE: computes a symmetric and a non-symmetric part of f
176
+ in terms of the elementary symmetric functions from c
177
+ as well a non-symmetric remainder
178
+ EXAMPLE: example symNsym; shows an example
179
+ NOTE: constants are considered symmetric
180
+ "
181
+ {
182
+ ideal V=variables(f); // variables f depends on
183
+ int nV=size(V); // their number
184
+ if(nV==0)
185
+ {
186
+ return(list(f, 0));
187
+ }
188
+ // now f is non-constant and does depend on some variables
189
+ c=append_by_zeroes(nV, c); // append c by zeroes if it is too short
190
+ def br@=basering; // remember the base ring
191
+ // add additional variables to the base ring
192
+ int ii;
193
+ list l2 = ringlist(basering)[2];
194
+ for (ii = 1; ii <= nV; ii++)
195
+ {
196
+ l2[size(l2)+1] = "c@("+string(ii)+")";
197
+ }
198
+ for (ii = 1; ii <= nV; ii++)
199
+ {
200
+ l2[size(l2)+1] = "A@("+string(ii)+")";
201
+ }
202
+ ring r@ = create_ring(ring_list(basering)[1], l2, "dp", "no_minpoly");
203
+ ideal V=fetch(br@,V);
204
+ poly f=fetch(br@,f);
205
+ int i;
206
+ for(i=1; i<=nV; i++)
207
+ {
208
+ f=subst(f, V[i], A@(i) ); // rename the variables of f into A@(1..nV)
209
+ }
210
+ int N1=nvars(basering)-nV+1; // the number of variable A@(1)
211
+ poly rez1=0; // to be the expression in c@(i) of the symmetric part of f
212
+ poly rez2=0; // to be the remainder
213
+ poly mon; // monomial in c@(i)
214
+ poly monc; // the corresponding expression in A@(i)
215
+ list l=symm(list(A@(1..nV) )); // symmetric functions in A@(i)
216
+ intvec v=leadexp(f), 0; // the exponent of the leading monomial
217
+ int exponent;
218
+ // We proceed as if the initial polynomial were symmetric.
219
+ // Under this assumption the leading monomial will always be of the form
220
+ // A@(1)^n1 * A@(2)^n2 * ... * A@(nV)^nnV, n1 >= n2 >= ... >= nnV.
221
+ // Everything which contradicts this assumption is considered as a part of the remainder.
222
+ while(v[N1]!=0)
223
+ {
224
+ mon=leadcoef(f); // leading coefficient of f
225
+ monc=mon;
226
+ for(i=1; i<=nV && mon !=0 ;i++ )
227
+ {
228
+ exponent = v[N1+i-1]-v[N1+i];
229
+ if( exponent >=0 ) // symmetric case
230
+ {
231
+ mon = mon*c@(i)^exponent;
232
+ monc = monc*l[i]^exponent; // has the same leading coefficient as f
233
+ }
234
+ else // not the symmetric case
235
+ {
236
+ mon=0;
237
+ monc=0;
238
+ }
239
+ }
240
+ if(mon==0) // not the symmetric case
241
+ {
242
+ rez2=rez2+lead(f);
243
+ f=f-lead(f);
244
+ }
245
+ else // symmetric case
246
+ {
247
+ rez1=rez1+mon; // add a monomial
248
+ f=f-monc; // subtract the monomial
249
+ }
250
+ v=leadexp(f), 0;
251
+ }
252
+ while( leadexp(f)!=0 )
253
+ {
254
+ rez2=rez2+lead(f);
255
+ f=f-lead(f);
256
+ }
257
+ rez1=rez1+f;
258
+ setring br@; // come back to the initial base ring
259
+ // define the specialization homomorphism
260
+ map FF = r@,maxideal(1),c[1..nV], V[1..nV];
261
+ return( list( FF(rez1), FF(rez2) ) );
262
+ }
263
+ example
264
+ {
265
+ "EXAMPLE:";echo=2;
266
+ ring r=0, (x,y,z, c(1..3)), dp;
267
+ list l=c(1..3);
268
+ // The symmetric part of f = 3x2 + 3y2 + 3z2 + 7xyz + y
269
+ // in terms of the elementary symmetric functions c(1), c(2), c(3)
270
+ // and the remainder
271
+ poly f = 3x2 + 3y2 + 3z2 + 7xyz + y;
272
+ print( symNsym(f, l) );
273
+ // Take a symmetric polynomial in variables x and z
274
+ f=x2+xz+z2;
275
+ // Express it in terms of the elementary the symmetric functions
276
+ print( symNsym(f, l)[1]);
277
+ }
278
+ //-------------------------------------------------------------------------------------------
279
+
280
+ proc CompleteHomog(int N, list c)
281
+ "USAGE: CompleteHomog(N, c); N integer, c list of polynomials
282
+ RETURN: list of polynomials
283
+ PURPOSE: computes the list of the complete homogeneous symmetric polynomials
284
+ in terms of the elementary symmetric polynomials (entries of c)
285
+ EXAMPLE: example CompleteHomog; shows an example
286
+ NOTE:
287
+ "
288
+ {
289
+ c=append_by_zeroes(N, c);
290
+ if(N<0) // if N is negative, return the empty list
291
+ {
292
+ return(list());
293
+ }
294
+ list rez=list(1); // the result will be computed here
295
+ int i, j;
296
+ int sign;
297
+ poly f;
298
+ for(i=1; i<=N; i++) // use the recursive formula
299
+ {
300
+ f=0;
301
+ sign=1;
302
+ for(j=1;j<=i; j++) // compute the next complete homogeneous symmetric polynomial
303
+ {
304
+ f=f+sign*c[j]*rez[i-j+1];
305
+ sign=-sign;
306
+ }
307
+ rez=rez+( list(f) );
308
+ }
309
+ return(rez);
310
+ }
311
+ example
312
+ {
313
+ "EXAMPLE:";echo =2;
314
+ ring r = 0, (x(1..3)), dp;
315
+ list l=x(1..3);
316
+ //Complete homogeneous symmetric polynomials up to degree 3 in variables x(1), x(2), x(3)
317
+ print( CompleteHomog(3, l) );
318
+ }
319
+ //-----------------------------------------------------------------------
320
+
321
+ proc segre(list c, list #)
322
+ "USAGE: segre(c[, N]); c list of polynomials, N integer
323
+ RETURN: list of polynomials
324
+ PURPOSE: computes the list of the Segre classes up to degree N
325
+ in terms of the Chern classes from c
326
+ EXAMPLE: example segre; shows an example
327
+ NOTE:
328
+ "
329
+ {
330
+ int N;
331
+ if(size(#)>0)
332
+ {
333
+ if( is_integer(#[1]) )
334
+ {
335
+ N=#[1];
336
+ }
337
+ }
338
+ else
339
+ {
340
+ N=size(c);
341
+ }
342
+ c=append_by_zeroes(N, c);
343
+ if(N<0) // if N is negative, return the empty list
344
+ {
345
+ return(list());
346
+ }
347
+ list rez=list(1); // the result will be computed here
348
+ int i, j;
349
+ poly f;
350
+ for(i=1; i<=N; i++) // use the recursive formula
351
+ {
352
+ f=0;
353
+ for(j=1;j<=i; j++) // compute the next Segre class
354
+ {
355
+ f=f-c[j]*rez[i-j+1];
356
+ }
357
+ rez=rez+( list(f) );
358
+ }
359
+ return(delete(rez,1));
360
+ }
361
+ example
362
+ {
363
+ "EXAMPLE:";echo =2;
364
+ ring r = 0, (c(1..3)), dp;
365
+ list l=c(1..3);
366
+ //Segre classes up to degree 5 in Chern classes c(1), c(2), c(3)
367
+ print( segre(l, 5) );
368
+ }
369
+ //-----------------------------------------------------------------------
370
+
371
+ proc chern(list s, list #)
372
+ "USAGE: chern(s); s list of polynomials
373
+ RETURN: list of polynomials
374
+ PURPOSE: computes the list of the Chern classes up to degree N
375
+ in terms of the Segre classes from s
376
+ EXAMPLE: example chern; shows an example
377
+ NOTE:
378
+ "
379
+ {
380
+ return( segre(s, #) );
381
+ }
382
+ example
383
+ {
384
+ "EXAMPLE:"; echo =2;
385
+ ring r = 0, (s(1..3)), dp;
386
+ list l=s(1..3);
387
+ // Chern classes in Segre classes s(1), s(2), s(3)
388
+ print( chern(l) );
389
+ // This procedure is inverse to segre(...). Indeed:
390
+ print( segre(chern(l), 3) );
391
+ }
392
+ //-----------------------------------------------------------------------
393
+
394
+ proc chNum(int N, list c)
395
+ "USAGE: chNum(N, c); N integer, c list
396
+ RETURN: list
397
+ PURPOSE: computes the Chern numbers of a vector bundle with Chern classes c
398
+ on a complex manifold (variety) of dimension N,
399
+ the zeroes corresponding to the higher zero Chern classes are ignored
400
+ EXAMPLE: example chNumbers; shows an example
401
+ NOTE: computes basically the partitions of N
402
+ in summands not greater than the length of c
403
+ "
404
+ {
405
+ int n=size(c);
406
+ if(N<0)
407
+ {
408
+ print("");
409
+ return( list() );
410
+ }
411
+ if( (n==0) || (N==0) )
412
+ {
413
+ return(list(1));
414
+ }
415
+ if(n==1) // if there is only one entry in the list
416
+ {
417
+ return(list(c[1]^N));
418
+ }
419
+ int i;
420
+ int j;
421
+ poly f; // the powers of the last variable will be stored here
422
+ list l=delete(c, n); // delete the last variable
423
+ list L;
424
+ list rez=chNum(N, l); // monomials not involving the last variable
425
+ for(i=1;i<=(N div n); i++) // add the monomials involving the last variable
426
+ {
427
+ f=c[n]^i; // the power of the last variable
428
+ // monomials without the last variable that,
429
+ // multiplied by the i-th power of the last variable,
430
+ // give a monomial of the required type
431
+ L=chNum(N-n*i, l);
432
+ for(j=1; j<=size(L) ;j++) // multiply every such monomial
433
+ {
434
+ L[j]=L[j]*f; // by the i-th power of the last variable
435
+ }
436
+ rez=rez+L; // add the monomials involving the i-th power of the last variable
437
+ }
438
+ return(rez);
439
+ }
440
+ example
441
+ {
442
+ "EXAMPLE:";echo=2;
443
+ ring r = 0, (c(1..2)), dp;
444
+ list l=c(1..2);
445
+ // Let c(1) be a variable of degree 1, let c(2) be a variable of degree 2.
446
+ // The monomials in c(1) and c(2) of weighted degree 5 are:
447
+ print( chNum( 5, l ) );
448
+
449
+ // Compare the result to the output of chNumbers(...):
450
+ print( chNumbers(5, l) );
451
+ }
452
+ //----------------------------------------------------------------------------------------
453
+
454
+ proc chNumbers(int r, list c)
455
+ "USAGE: chNumbers(r, c); r integer, c list
456
+ RETURN: list
457
+ PURPOSE: computes the Chern numbers of a vector bundle with Chern classes c
458
+ on a complex manifold (variety) of dimension r
459
+ EXAMPLE: example chNumbers; shows an example
460
+ NOTE: computes basically the partitions of r
461
+ "
462
+ {
463
+ if(r<0)
464
+ {
465
+ print("The dimension of a manifold must be a non-negative integer!");
466
+ return(list()); // return the empty list in this case
467
+ }
468
+ if(r==0)
469
+ {
470
+ return(list(1));
471
+ }
472
+ //-----------------
473
+ // from now on r>0
474
+ //----------------
475
+ int n=size(c);
476
+ c=append_by_zeroes(r, c);
477
+ c=c[1..r]; // throw away redundant data
478
+ return(chNum(r, c));
479
+ }
480
+ example
481
+ {
482
+ "EXAMPLE:";echo=2;
483
+ ring r = 0, (c(1..3)), dp;
484
+ list l=c(1..3);
485
+ // The Chern numbers of a vector bundle with Chern classes c(1), c(2), c(3)
486
+ // on a 3-fold:
487
+ print( chNumbers( 3, l ) );
488
+
489
+ // If the highest Chern class is zero, the Chern numbers are:
490
+ l=c(1..2);
491
+ print( chNumbers( 3, l ) );
492
+
493
+ // Compare this to the output of chNum(...):
494
+ print( chNum( 3, l ) );
495
+ }
496
+ //---------------------------------------------------------------------------------------
497
+
498
+ proc sum_of_powers(int k, list l)
499
+ "USAGE: sum_of_powers(k, l); k non-negative integer, l list of polynomials
500
+ RETURN: polynomial
501
+ PURPOSE: computes the sum of k-th powers of the entries of l
502
+ EXAMPLE: example sum_of_powers; shows an example
503
+ NOTE: returns 0 if k is negative
504
+ "
505
+ {
506
+ if(k<0) // return 0 if k is negative
507
+ {
508
+ print("The exponent must be non-negative; 0 has been returned");
509
+ return(0);
510
+ }
511
+ int i;
512
+ int n=size(l);
513
+ poly rez; // the result will be computed here
514
+ for(i=1;i<=n;i++) // compute the sum of powers
515
+ {
516
+ rez=rez+l[i]^k;
517
+ }
518
+ return(rez);
519
+ }
520
+ example
521
+ {
522
+ "EXAMPLE:";echo =2;
523
+ ring r = 0, (x, y, z), dp;
524
+ list l=x, y, z;
525
+ //sum of 7-th powers of x, y, z
526
+ print( sum_of_powers(7, l) );
527
+ }
528
+ //-----------------------------------------------------------------------
529
+
530
+ proc powSumSym(list c, list #)
531
+ "USAGE: powSumSym(l [,N]); l a list of polynomials, N integer
532
+ RETURN: list of polynomials
533
+ PURPOSE: computes the expressions for the sums of powers [up to degree N]
534
+ in terms of the elementary symmetric polynomials (entries of l),
535
+ EXAMPLE: example powSumSym; shows an example
536
+ NOTE: returns the terms of the Chern character
537
+ multiplied by the corresponding factorials
538
+ "
539
+ {
540
+ int n;
541
+ if( size(#) == 0 ) // if there are no optional parameters
542
+ {
543
+ n = size(c); // set n to be the length of c
544
+ }
545
+ else // if there are optional parameters
546
+ {
547
+ if( is_integer(#[1])) // if the first optional parameter is an integer
548
+ {
549
+ n = max( #[1], 0 ); // if the parameter is negative, reset it to be zero
550
+ c = append_by_zeroes(n, c); // if n is greater than the length of c, append c by zeroes
551
+ if( n != 0 ) // if n is non-zero
552
+ {
553
+ c = c[1..n]; // take into account only the first n entries of c
554
+ }
555
+ }
556
+ else // if the optional parameter is not an integer, then
557
+ {
558
+ n=size(c); // ignore it and set n to be the length of c
559
+ }
560
+ }
561
+ list rez; // the result will be computed here
562
+ if(n==0) // return the empty list
563
+ {
564
+ return(rez)
565
+ }
566
+ else // otherwise proceed as follows:
567
+ {
568
+ // first compute the sums of powers of the Chern roots
569
+ // in terms of the Chern classes using the Newton's identities
570
+ int i, j, sign;
571
+ poly f;
572
+ // the first term of the Chern character coincides with the first Chern class,
573
+ // or equivalently with the sum of Chern roots
574
+ rez = rez + list(c[1]);
575
+ // compute the sums of powers of Chern roots recursively using the Newton's identities
576
+ for(j=2; j<=n; j++)
577
+ {
578
+ sign=1;
579
+ f=0;
580
+ for(i=1; i<j; i++)
581
+ {
582
+ f=f + c[i]*sign*rez[j-i];
583
+ sign = -sign;
584
+ }
585
+ f=f+sign*j*c[j];
586
+ rez=rez+list(f); // add the newly computed sum of powers of Chern roots to the list
587
+ }
588
+ return(rez); // return the result
589
+ }
590
+ }
591
+ example
592
+ {
593
+ "EXAMPLE:";echo =2;
594
+ // the expressions of the first 3 sums of powers of 3 variables a(1), a(2), a(3)
595
+ // in terms of the elementary symmetric polynomials c(1), c(2), c(3):
596
+ ring r = 0, (c(1..3)), dp;
597
+ list l=(c(1..3));
598
+ print(powSumSym(l));
599
+ // The first 5 sums in the same situation
600
+ print(powSumSym(l, 5));
601
+ }
602
+ //---------------------------------------------------------------------------------
603
+
604
+ proc chAll(list c, list #)
605
+ "USAGE: chAll(l [,N]); l a list of polynomials, N integer
606
+ RETURN: list of polynomials
607
+ PURPOSE: computes the list of terms of positive degree [up to degree N] of
608
+ the Chern character, where the entries of l are considered as the Chern classes
609
+ EXAMPLE: example chAll; shows an example
610
+ NOTE: makes sense only for a list of polynomials
611
+ "
612
+ {
613
+ list rez; // to be the result
614
+ rez = powSumSym(c, #); // get the sums of powers of the Chern roots
615
+ int n = size(rez);
616
+ bigint fct=1;
617
+ int i;
618
+ for(i=1;i<=n;i++) // get the terms of the Chern character
619
+ {
620
+ fct=fct*i;
621
+ rez[i]=rez[i]/fct;
622
+ }
623
+ return(rez); // return the result
624
+ }
625
+ example
626
+ {
627
+ "EXAMPLE:";echo =2;
628
+ // Chern character (terms of degree 1, 2, 3)
629
+ // corresponding to the Chern classes c(1), c(2), c(3):
630
+ ring r = 0, (c(1..3)), dp;
631
+ list l=(c(1..3));
632
+ print(chAll(l));
633
+ // terms up to degree 5 in the same situation
634
+ print(chAll(l, 5));
635
+ }
636
+ //---------------------------------------------------------------------------------
637
+
638
+ proc chAllInv(list c)
639
+ "USAGE: chAllInv(l); l a list of polynomials
640
+ RETURN: list of polynomials
641
+ PURPOSE: procedure inverse to chAll(), computes the list of Chern classes
642
+ from the list of terms of positive degree of the Chern character
643
+ EXAMPLE: example chAllInv; shows an example
644
+ NOTE: makes sense only for a list of polynomials
645
+ "
646
+ {
647
+ int n = size(c);
648
+ list rez;
649
+ if(n==0) // if the list of terms of Chern character is empty, return the empty list
650
+ {
651
+ return(rez);
652
+ }
653
+ else // otherwise compute the result using the Newton's identities
654
+ {
655
+ int j, i, sign;
656
+ poly f;
657
+ // transform the list of terms of the Chern character
658
+ // to the list of sums of powers of Chern roots
659
+ //bigint fct=1;
660
+ for(i=1; i<=n; i++)
661
+ {
662
+ //fct=fct*i;
663
+ //c[i]=fct*c[i];
664
+ c[i]=factorial(i)*c[i];
665
+ }
666
+ // the first Chern class coincides with the first degree term of the Chern character
667
+ rez=rez+list(c[1]);
668
+ // compute the higher Chern classes recursively using the Newton's identities
669
+ for(j=2;j<=n;j++)
670
+ {
671
+ sign=1;f=0;
672
+ for(i=1;i<j;i++)
673
+ {
674
+ f=f+ c[i]*sign*rez[j-i];
675
+ sign=-sign;
676
+ }
677
+ f=f+sign*c[j];
678
+ rez=rez+list(f/j);
679
+ }
680
+ return(rez); // return the result
681
+ }
682
+ }
683
+ example
684
+ {
685
+ "EXAMPLE:";echo=2;
686
+ // first 3 Chern classes in terms of the first 3 terms
687
+ // of the Chern character Chern ch(1), ch(2), ch(3):
688
+ ring r = 0, (ch(1..3)), dp;
689
+ list l=(ch(1..3));
690
+ print(chAllInv(l));
691
+ // let's see that chAllInv() is inverse to chAll()
692
+ print( chAll( chAllInv(l) ) );
693
+ }
694
+ //---------------------------------------------------------------------------------
695
+
696
+ proc chHE(list c)
697
+ "USAGE: chHE(c); c list of polynomials
698
+ RETURN: polynomial
699
+ PURPOSE: computes the highest relevant term of the Chern character
700
+ EXAMPLE: example chHE; shows an example
701
+ NOTE: uses the elimination and is extremely inefficient,
702
+ is included just for comparison with chAll(c)
703
+ "
704
+ {
705
+ int i;
706
+ // insure that the entries of c are polynomials
707
+ // in order to be able to apply maps
708
+ for(i=1;i<=size(c);i++)
709
+ {
710
+ c[i]=poly(c[i]);
711
+ }
712
+ int n=size(c);
713
+ if(n==0) // in this case return the empty list
714
+ {
715
+ return(list());
716
+ }
717
+ else // otherwise proceed as follows
718
+ {
719
+ def br@=basering; // remember the base ring
720
+ // add additional variables c@, a@(1..n) to the base ring
721
+ list l3 = "c@";
722
+ l3 = l3+ ringlist(basering)[2];
723
+ for (int ii = 1; ii <= n; ii++)
724
+ {
725
+ l3[size(l3)+1] = "a@("+string(ii)+")";
726
+ }
727
+ ring r@ = create_ring(ring_list(basering)[1], l3, "lp", "no_minpoly");
728
+ // define the corresponding inclusion of rings: imap
729
+ list c=imap(br@,c); // embed c in the bigger ring
730
+ poly rez;
731
+ list A=a@(1..n);
732
+ list sym=symm(A);
733
+ ideal I;
734
+ poly E=1; // to be the product of variables which should be eliminated
735
+ for(i=1;i<=n;i++)
736
+ {
737
+ E=E*a@(i); // compute the product of the variables that must be eliminated
738
+ I=I, c[i]-sym[i];
739
+ }
740
+ I=I, c@-sum_of_powers(n, A);
741
+ I=simplify(elim(I, E),1);
742
+ rez = -subst(I[1], c@, 0);
743
+ setring br@; // come back to the initial base ring
744
+ map FF= r@,0,maxideal(1); // define the specialization homomorphism
745
+ poly rez=FF(rez); // bring the result to the base ring
746
+ return( (1/factorial(n))*rez);
747
+ }
748
+ }
749
+ example
750
+ {
751
+ "EXAMPLE:";echo =2;
752
+ ring r = 0, (c(1..3)), dp;
753
+ list l=c(1..3);
754
+ //the third degree term of the Chern character
755
+ print( chHE(l) );
756
+ }
757
+ //----------------------------------------------------------------------
758
+
759
+ proc ChernRootsSum(list a, list b)
760
+ "USAGE: ChernRootsSum(a, b); a, b lists of polynomials
761
+ RETURN: list of polynomials
762
+ PURPOSE: computes the Chern roots of the direct (Whitney) sum
763
+ of a vector bundle with Chern roots a and a vector bundle with Chern roots b
764
+ EXAMPLE: example ChernRootsSum; shows an example
765
+ NOTE:
766
+ "
767
+ {
768
+ return(a+b);
769
+ }
770
+ example
771
+ {
772
+ "EXAMPLE:";echo =2;
773
+ ring r = 0, (a(1..3), b(1..2)), dp;
774
+ // assume a(1), a(2), a(3) are the Chern roots of a vector bundle E
775
+ // assume b(1), b(2) are the Chern roots of a vector bundle F
776
+ list l=a(1..3);
777
+ list L=b(1..2);
778
+ // the Chern roots of their direct sum is
779
+ print( ChernRootsSum(l, L) );
780
+ }
781
+ //----------------------------------------------------------------------
782
+
783
+ proc chSum(list c, list C)
784
+ "USAGE: chSum(c, C); c, C lists of polynomials
785
+ RETURN: list of polynomials
786
+ PURPOSE: computes the Chern classes of a direct sum of two vector bundles
787
+ EXAMPLE: example chSum; shows an example
788
+ NOTE:
789
+ "
790
+ {
791
+ int N=size(c)+size(C);
792
+ c=append_by_zeroes(N, c); // append by zeroes if necessary
793
+ C=append_by_zeroes(N, C); // append by zeroes if necessary
794
+ list rez; // to be the result
795
+ int i;
796
+ int j;
797
+ poly f;
798
+ for(i=1;i<=N;i++)
799
+ {
800
+ f=c[i]+C[i];
801
+ for(j=1;j<i;j++)
802
+ {
803
+ f=f+c[j]*C[i-j];
804
+ }
805
+ rez=rez+list(f);
806
+ }
807
+ return(rez);
808
+ }
809
+ example
810
+ {
811
+ "EXAMPLE:";echo =2;
812
+ ring r = 0, (c(1..3), C(1..2)), dp;
813
+ // Let E be a vector bundle with Chern classes c(1), c(2), c(3).
814
+ // Let F be a vector bundle with Chern classes C(1), C(2).
815
+ list l=c(1..3);
816
+ list L=C(1..2);
817
+ // Then the Chern classes of their direct sum are
818
+ print( chSum(l, L) );
819
+ }
820
+ //----------------------------------------------------------------------
821
+
822
+ proc ChernRootsDual(list l)
823
+ "USAGE: ChernRootsDual(l); l a list of polynomials
824
+ RETURN: list of polynomials
825
+ PURPOSE: computes the Chern roots of the dual vector bundle
826
+ of a vector bundle with Chern roots from l
827
+ EXAMPLE: example ChernRootsDual; shows an example
828
+ NOTE:
829
+ "
830
+ {
831
+ int n=size(l);
832
+ int i;
833
+ for(i=1;i<=n;i++) // change the sign of the entries of a
834
+ {
835
+ l[i]=-l[i];
836
+ }
837
+ return(l);
838
+ }
839
+ example
840
+ {
841
+ "EXAMPLE:";echo =2;
842
+ ring r = 0, (a(1..3)), dp;
843
+ // assume a(1), a(2), a(3) are the Chern roots of a vector bundle
844
+ list l=a(1..3);
845
+ // the Chern roots of the dual vector bundle
846
+ print( ChernRootsDual(l) );
847
+ }
848
+ //----------------------------------------------------------------------
849
+
850
+ proc chDual(list c)
851
+ "USAGE: chDual(c); c list of polynomials
852
+ RETURN: list of polynomials
853
+ PURPOSE: computes the list of Chern classes of the dual vector bundle
854
+ EXAMPLE: example chDual; shows an example
855
+ NOTE:
856
+ "
857
+ {
858
+ int n=size(c);
859
+ int i;
860
+ for(i=1;i<=n;i=i+2)
861
+ {
862
+ c[i]=-c[i];
863
+ }
864
+ return(c);
865
+ }
866
+ example
867
+ {
868
+ "EXAMPLE:"; echo=2;
869
+ // Chern classes of a vector bundle that is dual to a vector bundle
870
+ // with Chern classes c(1), c(2), c(3)
871
+ ring r=0, (c(1..3)), dp;
872
+ list l=c(1..3);
873
+ print(chDual(l));
874
+ }
875
+ //-----------------------------------------------------------------------------------------
876
+
877
+ proc ChernRootsProd(list a, list b)
878
+ "USAGE: ChernRootsProd(a, b); a, b lists of polynomials
879
+ RETURN: list of polynomials
880
+ PURPOSE: computes the Chern roots of the tensor product of a vector bundle with Chern roots a
881
+ and a vector bundles with Chern roots b
882
+ EXAMPLE: example ChernRootsProd; shows an example
883
+ NOTE:
884
+ "
885
+ {
886
+ int na=size(a);
887
+ int nb=size(b);
888
+ int i;
889
+ int j;
890
+ list rez; // the result will be computed here
891
+ for(i=1;i<=na;i++) // compute the result
892
+ {
893
+ for(j=1;j<=nb;j++)
894
+ {
895
+ rez=rez+list(a[i]+b[j]);
896
+ }
897
+ }
898
+ return(rez);
899
+ }
900
+ example
901
+ {
902
+ "EXAMPLE:"; echo=2;
903
+ ring r=0, (a(1..2), b(1..3)), dp;
904
+ list l=a(1..2);
905
+ list L=b(1..3);
906
+ // Chern roots of the tensor product of a vector bundle with Chern roots a(1), a(2)
907
+ // and a vector bundle with Chern roots b(1), b(2), b(3)
908
+ print(ChernRootsProd(l, L));
909
+ }
910
+ //-----------------------------------------------------------------------------------------
911
+
912
+ proc chProd(def r, list c, def R, list C, list #)
913
+ "USAGE: chProd(r, c, R, C [, N]); r, R polynomials (integers);
914
+ c, C lists of polynomials, N integer
915
+ RETURN: list of polynomials
916
+ PURPOSE: computes the list of Chern classes of the product of two vector bundles
917
+ in terms of their ranks and Chern clases [up to degree N]
918
+ EXAMPLE: example chProd; shows an example
919
+ NOTE:
920
+ "
921
+ {
922
+ // check the input data
923
+ if( is_integer(r) ) // if r is an integer
924
+ {
925
+ if(r<=0) // if r is negative or zero return the empty list
926
+ {
927
+ return( list() );
928
+ }
929
+ //----------------------------
930
+ //now r is a positive integer
931
+ //----------------------------
932
+ c=append_by_zeroes(r, c); // append c by zeroes if r is greater than the length of c
933
+ c=c[1..r]; // make c shorter (of length r) if r is smaller than the length of c
934
+ }
935
+ if( is_integer(R) ) // if R is an integer
936
+ {
937
+ if(R<=0) // if R is negative or zero return the empty list
938
+ {
939
+ return( list() );
940
+ }
941
+ //----------------------------
942
+ //now R is a positive integer
943
+ //----------------------------
944
+ C=append_by_zeroes(R, C); // append C by zeroes if R is greater than the length of C
945
+ C=C[1..R]; // make C shorter (of length R) if R is smaller than the length of C
946
+ }
947
+ //----------------------------------------------------------
948
+ //now r > 0 if it is an integer; R > 0 if it is an integer
949
+ //----------------------------------------------------------
950
+ int n;
951
+ if( is_integer(r) && is_integer(R) ) // if both r and R are integers
952
+ {
953
+ n=r*R; // set n to be the rank of the product bundle
954
+ }
955
+ else // otherwise define the rank of the product vector bundle by
956
+ {
957
+ n=size(c)*size(C); // looking at the lengths of c and C
958
+ }
959
+ if( size(#) != 0 ) // if there is an optional parameter
960
+ {
961
+ if( is_integer( #[1] ) ) // if this parameter is an integer
962
+ {
963
+ if( #[1]<=0 ) // if it is negative or zero, return the empty list
964
+ {
965
+ return( list() );
966
+ }
967
+ // now #[1] is positive
968
+ // the product bundle can only have non-zero Chern classes up to degree n
969
+ // so ignore the optional parameter if it is greater than n
970
+ n = min(#[1], n);
971
+ }
972
+ }
973
+ if(n==0) // if n is zero, return the empty list
974
+ {
975
+ return( list() );
976
+ }
977
+ //-----------------------------------------------------------
978
+ //now n is positive, we can perform the relevant computations
979
+ //-----------------------------------------------------------
980
+ int i, j;
981
+ c=append_by_zeroes(n, c); // append c by zeroes up to degree n
982
+ C=append_by_zeroes(n, C); // append C by zeroes up to degree n
983
+ c=c[1..n]; // throw away the redundant data if needed
984
+ C=C[1..n]; // throw away the redundant data if needed
985
+ // build the list of all terms of the Chern characters: for rank r, and Chern classes c
986
+ list ch = list(r) + chAll(c);
987
+ list CH = list(R) + chAll(C); // do the same for rank R and Chern classes C
988
+ poly f;
989
+ list chP;
990
+ // compute the list of the non-zero degree terms of the Chern character
991
+ // of the tensor product of two vector bundles
992
+ for(i=1;i<=n;i++) // using the multiplicativity of the Chern character
993
+ {
994
+ f=0;
995
+ for(j=0;j<=i;j++)
996
+ {
997
+ f=f+ch[j+1]*CH[i-j+1];
998
+ }
999
+ chP=chP+list(f);
1000
+ }
1001
+ return( chAllInv(chP) ); // return the corresponding Chern classes
1002
+ }
1003
+ example
1004
+ {
1005
+ "EXAMPLE:"; echo =2;
1006
+ ring H = 0, ( r, R, c(1..3), C(1..2) ), dp;
1007
+ list l=c(1..3);
1008
+ list L=C(1..2);
1009
+ // the Chern classes of the tensor product of a vector bundle E of rank 3
1010
+ // with Chern classes c(1), c(2), c(3)
1011
+ // and a vector bundle F of rank 2 with Chern classes C(1) and C(2):
1012
+ print( chProd(3, l, 2, L) );
1013
+ // the first two Chern classes of the tensor product
1014
+ // of a vector bundle E of rank r with Chern classes c(1) and c(2)
1015
+ // and a vector bundle G of rank R with Chern classes C(1) and C(2)
1016
+ // this gives the Chern classes of a tensor product on a complex surface
1017
+ l=c(1..2);
1018
+ L=C(1..2);
1019
+ print( chProd(r, l, R, L, 2 ) );
1020
+ }
1021
+ //---------------------------------------------------------------------------------
1022
+
1023
+ proc chProdE(list c, list C)
1024
+ "USAGE: chProdE(c, C); c, C lists of polynomials
1025
+ RETURN: list of polynomials
1026
+ PURPOSE: computes the list of Chern classes of the product
1027
+ of two vector bundles in terms of their Chern clases
1028
+ EXAMPLE: example chProdE; shows an example
1029
+ NOTE: makes sense only for (lists of) polynomials;
1030
+ uses elimination, hence very inefficient;
1031
+ included only for comparison with chProd(...)
1032
+ "
1033
+ {
1034
+ int r=size(c);
1035
+ int R=size(C);
1036
+ // insure that the entries of c and C are polynomials
1037
+ // in order to be able to apply maps
1038
+ int i,j;
1039
+ for(i=1;i<=r;i++)
1040
+ {
1041
+ c[i]=poly(c[i]);
1042
+ }
1043
+ for(i=1;i<=R;i++)
1044
+ {
1045
+ C[i]=poly(C[i]);
1046
+ }
1047
+ if( (r==0) && (R==0) ) // if one of the ranks is 0,
1048
+ {
1049
+ return( list() ); // return the empty list (zero bundles have no Chern classes)
1050
+ }
1051
+ //------------------------------------
1052
+ //now both r and R are greater than 0
1053
+ //------------------------------------
1054
+ int n=r*R; // the rank of the product of two vector bundles
1055
+ def br@=basering; // remember the base ring
1056
+ // add additional variables a@(1..r), b@(1..R), x@ to the base ring
1057
+ int ii;
1058
+ list l4 = "x@";
1059
+ l4 = l4+ ringlist(basering)[2];
1060
+ for (ii = 1; ii <= r; ii++)
1061
+ {
1062
+ l4[size(l4)+1] = "a@("+string(ii)+")";
1063
+ }
1064
+ for (ii = 1; ii <= R; ii++)
1065
+ {
1066
+ l4[size(l4)+1] = "b@("+string(ii)+")";
1067
+ }
1068
+ ring r@ = create_ring(ring_list(basering)[1], l4, "lp", "no_minpoly");
1069
+ // define the corresponding inclusion of rings: imap
1070
+ list c=imap(br@,c); // embed c in the bigger ring
1071
+ list C=imap(br@,C); // embed C in the bigger ring
1072
+ list A=a@(1..r); // list of Chern roots of the first vector bundle
1073
+ list syma = symm(A); // symmetric functions in the Chern roots of the first vector bundles
1074
+ list B=b@(1..R); // list of Chern roots of the second vector bundle
1075
+ list symb=symm(B); // symmetric functions in the Chern roots of the second vector bundles
1076
+ ideal I;
1077
+ // the product of variables (all Chern roots) which should be eliminated
1078
+ poly E=product(A)*product(B);
1079
+ for(i=1; i<=r; i++)
1080
+ {
1081
+ for(j=1; j<=R; j++)
1082
+ {
1083
+ I=I, c[i]-syma[i], C[j]-symb[j]; // add the relations
1084
+ }
1085
+ }
1086
+ // the Chern roots of the tensor product in terms of the Chern roots of the factors
1087
+ list crt=ChernRootsProd(A, B);
1088
+ list Cf=symm(crt); // Chern classes of the product in terms of the Chern roots of the factors
1089
+ list rez; // the result will be computed here
1090
+ ideal J;
1091
+ for(i=1;i<=n;i++)
1092
+ {
1093
+ J = I, x@-Cf[i]; // add the equation for the i-th Chern class to the ideal of relations
1094
+ J = simplify(elim(J, E), 1); // eliminate the Chern roots
1095
+ // get the expression for the i-th Chern class of the product
1096
+ // in terms of the Chern classes of the factors
1097
+ rez = rez + list( -subst(J[1], x@, 0) );
1098
+ }
1099
+ setring br@; // come back to the initial base ring
1100
+ map FF= r@, 0,maxideal(1); // define the specialization homomorphism t@=0
1101
+ list rez=FF(rez); // bring the result to the base ring
1102
+ return(rez); // return the corresponding Chern classes
1103
+ }
1104
+ example
1105
+ {
1106
+ "EXAMPLE:"; echo =2;
1107
+ ring H = 0, ( c(1..3), C(1..2) ), dp;
1108
+ list l=c(1..3);
1109
+ list L=C(1..2);
1110
+ // the Chern classes of the tensor product of a vector bundle E of rank 3
1111
+ // with Chern classes c(1), c(2), c(3)
1112
+ // and a vector bundle F of rank 2 with Chern classes C(1) and C(2):
1113
+ print( chProdE(l, L) );
1114
+ }
1115
+ //------------------------------------------------------------------------------------
1116
+
1117
+ proc chProdL(int r, list c, int R, list C)
1118
+ "USAGE: chProdL(r, c, R, C); r, R integers; c, C lists of polynomials
1119
+ RETURN: list
1120
+ PURPOSE: computes the list of Chern classes of the product of two vector bundles
1121
+ in terms of their Chern clases
1122
+ EXAMPLE: example chProdL; shows an example
1123
+ NOTE: Implementation of the formula of Lascoux, the Schur polynomials are computed
1124
+ using the second Jacobi-Trudi formula (in terms of the Chern classes)
1125
+ "
1126
+ {
1127
+ // check the input data
1128
+ if(r<=0) // if r is negative or zero return the empty list
1129
+ {
1130
+ return( list() );
1131
+ }
1132
+ //----------------------------
1133
+ //now r is a positive integer
1134
+ //----------------------------
1135
+ c=append_by_zeroes(r, c); // append c by zeroes if r is greater than the length of c
1136
+ c=c[1..r]; // make c shorter (of length r) if r is smaller than the length of c
1137
+ if(R<=0) // if R is negative or zero return the empty list
1138
+ {
1139
+ return( list() );
1140
+ }
1141
+ //----------------------------
1142
+ //now R is a positive integer
1143
+ //----------------------------
1144
+ C=append_by_zeroes(R, C); // append C by zeroes if R is greater than the length of C
1145
+ C=C[1..R]; // make C shorter (of length R) if R is smaller than the length of C
1146
+ //----------------------------------------------------------
1147
+ // now r > 0 and R > 0
1148
+ //----------------------------------------------------------
1149
+ def br@=basering; // remember the base ring
1150
+ // add additional variables to the base ring
1151
+ int ii;
1152
+ list l5 = ringlist(basering)[2];
1153
+ l5[size(l5)+1] = "t@";
1154
+ for (ii = 1; ii <= r; ii++)
1155
+ {
1156
+ l5[size(l5)+1] = "c@("+string(ii)+")";
1157
+ }
1158
+ for (ii = 1; ii <= R; ii++)
1159
+ {
1160
+ l5[size(l5)+1] = "C@("+string(ii)+")";
1161
+ }
1162
+ ring r@ = create_ring(ring_list(basering)[1], l5, "dp", "no_minpoly");
1163
+ list c, C;
1164
+ int i;
1165
+ for(i=1;i<=r;i++)
1166
+ {
1167
+ c[i]=c@(i)*t@^i;
1168
+ }
1169
+ for(i=1;i<=R;i++)
1170
+ {
1171
+ C[i]=C@(i)*t@^i;
1172
+ }
1173
+ poly f = chProdLP(r,c,R,C); // get the total Chern class using the Lascoux formula
1174
+ matrix CF = coeffs(f, t@); // get its coefficients in front of the powers of t@
1175
+ int N=r*R;
1176
+ list rez; // write them in a list
1177
+ for(i=1;i<=N;i++)
1178
+ {
1179
+ rez=rez+list(CF[i+1,1]);
1180
+ }
1181
+ setring br@; // come back to the initial base ring
1182
+ // define the specialization homomorphism
1183
+ map FF = r@,maxideal(1),0, c[1..r], C[1..R];
1184
+ return( FF( rez ) ); // bring the result to the initial ring
1185
+ }
1186
+ example
1187
+ {
1188
+ "EXAMPLE:"; echo =2;
1189
+ // The Chern classes of the tensor product of a vector bundle of rank 3
1190
+ // with Chern classes c(1), c(2), c(3) and a vector bundle of rank 1 with
1191
+ // Chern class C(1)
1192
+ ring r = 0, ( c(1..3), C(1)), dp;
1193
+ list c=c(1..3);
1194
+ list C=C(1);
1195
+ print( chProdL(3,c,1,C) );
1196
+ }
1197
+ //---------------------------------------------------------------------------------------
1198
+
1199
+ proc chProdLP(int r, list c, int R, list C)
1200
+ "USAGE: chProdLP(r, c, R, C); r, R integers; c, C lists of polynomials
1201
+ RETURN: polynomial
1202
+ PURPOSE: computes the total Chern class of the product of two vector bundles
1203
+ in terms of their ranks and Chern clases
1204
+ EXAMPLE: example chProdLP; shows an example
1205
+ NOTE: Implementation of the formula of Lascoux, the Schur polynomials are computed
1206
+ using the second Jacobi-Trudi formula (in terms of the Chern classes)
1207
+ "
1208
+ {
1209
+ if(r<=0) // if r is negative or zero, return 1
1210
+ {
1211
+ return( 1 );
1212
+ }
1213
+ if(R<=0) // if R is negative or zero, return 1
1214
+ {
1215
+ return( 1 );
1216
+ }
1217
+ //-------------------------------------------
1218
+ // now r and R are positive
1219
+ //-------------------------------------------
1220
+ c=append_by_zeroes(r, c);
1221
+ C=append_by_zeroes(R, C);
1222
+ c=c[1..r];
1223
+ C=C[1..R];
1224
+ list P;
1225
+ P=part(r, R); // compute the partitions of numbers up to R into r summands
1226
+ int sz=size(P); // number of such partitions
1227
+ int szu;
1228
+ int i, j;
1229
+ list T;
1230
+ list PU;
1231
+ list TU;
1232
+ poly rez; // the result will be computed here
1233
+ poly ST;
1234
+ // implement the formula of Lascoux:
1235
+ for(i=1;i<=sz;i++) // run through all the partitions from P
1236
+ {
1237
+ T=P[i]; // the current partition
1238
+ ST= SchurS( PartC(T, R) , C ); // compute the corresponding Schur polynomial
1239
+ PU=partUnder(T); // compute the partitions under T
1240
+ szu=size(PU); // number of such partitions
1241
+ for(j=1;j<=szu;j++) // run through all the partitions lying under T
1242
+ {
1243
+ TU=PU[j]; // for each of them
1244
+ rez=rez+IJcoef(T, TU)* SchurCh(TU, c) *ST; // add the corresponding term to the result
1245
+ }
1246
+ }
1247
+ return(rez); // return the result
1248
+ }
1249
+ example
1250
+ {
1251
+ "EXAMPLE:"; echo =2;
1252
+ // The total Chern class of the tensor product of a vector bundle of rank 3
1253
+ // with Chern classes c(1), c(2), c(3) and a vector bundle of rank 1 with
1254
+ // Chern class C(1)
1255
+ ring r = 0, ( c(1..3), C(1)), ws(1,2,3, 1);
1256
+ list c=c(1..3);
1257
+ list C=C(1);
1258
+ print( chProdLP(3,c,1,C) );
1259
+ }
1260
+ //---------------------------------------------------------------------------------------
1261
+
1262
+ proc chProdM(int r, list c, int R, list C)
1263
+ "USAGE: chProdM(r, c, R, C); r, R integers; c, C lists of polynomials
1264
+ RETURN: list
1265
+ PURPOSE: computes the list of Chern classes of the product of two vector bundles
1266
+ in terms of their Chern clases
1267
+ EXAMPLE: example chProdM; shows an example
1268
+ NOTE: Implementation of the formula of Manivel
1269
+ "
1270
+ {
1271
+ // check the input data
1272
+ if(r<=0) // if r is negative or zero return the empty list
1273
+ {
1274
+ return( list() );
1275
+ }
1276
+ //----------------------------
1277
+ //now r is a positive integer
1278
+ //----------------------------
1279
+ c=append_by_zeroes(r, c); // append c by zeroes if r is greater than the length of c
1280
+ c=c[1..r]; // make c shorter (of length r) if r is smaller than the length of c
1281
+ if(R<=0) // if R is negative or zero return the empty list
1282
+ {
1283
+ return( list() );
1284
+ }
1285
+ //----------------------------
1286
+ //now R is a positive integer
1287
+ //----------------------------
1288
+ C=append_by_zeroes(R, C); // append C by zeroes if R is greater than the length of C
1289
+ C=C[1..R]; // make C shorter (of length R) if R is smaller than the length of C
1290
+ //----------------------------------------------------------
1291
+ // now r > 0 and R > 0
1292
+ //----------------------------------------------------------
1293
+ def br@=basering; // remember the base ring
1294
+ // add additional variables to the base ring
1295
+ int ii;
1296
+ list l6 = ringlist(basering)[2];
1297
+ l6[size(l6)+1] = "t@";
1298
+ for (ii = 1; ii <= r; ii++)
1299
+ {
1300
+ l6[size(l6)+1] = "c@("+string(ii)+")";
1301
+ }
1302
+ for (ii = 1; ii <= R; ii++)
1303
+ {
1304
+ l6[size(l6)+1] = "C@("+string(ii)+")";
1305
+ }
1306
+ ring r@ = create_ring(ring_list(basering)[1], l6, "dp", "no_minpoly");
1307
+ list c, C;
1308
+ int i;
1309
+ for(i=1;i<=r;i++)
1310
+ {
1311
+ c[i]=c@(i)*t@^i;
1312
+ }
1313
+ for(i=1;i<=R;i++)
1314
+ {
1315
+ C[i]=C@(i)*t@^i;
1316
+ }
1317
+ poly f = chProdMP(r,c,R,C); // get the total Chern class using the Manivel formula
1318
+ matrix CF = coeffs(f, t@); // get its coefficients in front of the powers of t@
1319
+ int N=r*R;
1320
+ list rez; // write them in a list
1321
+ for(i=1;i<=N;i++)
1322
+ {
1323
+ rez=rez+list(CF[i+1,1]);
1324
+ }
1325
+ setring br@; // come back to the initial base ring
1326
+ // define the specialization homomorphism
1327
+ map FF = r@,maxideal(1),0, c[1..r], C[1..R];
1328
+ return( FF( rez ) ); // bring the result to the initial ring
1329
+ }
1330
+ example
1331
+ {
1332
+ "EXAMPLE:"; echo = 2;
1333
+ // The Chern classes of the tensor product of a vector bundle of rank 3
1334
+ // with Chern classes c(1), c(2), c(3) and a vector bundle of rank 1 with
1335
+ // Chern class C(1)
1336
+ ring r = 0, ( c(1..3), C(1)), dp;
1337
+ list c=c(1..3);
1338
+ list C=C(1);
1339
+ print( chProdM(3,c,1,C) );
1340
+ }
1341
+ //---------------------------------------------------------------------------------------
1342
+
1343
+ proc chProdMP(int r, list c, int R, list C)
1344
+ "USAGE: chProdMP(r, c, R, C); r, R integers; c, C lists of polynomials
1345
+ RETURN: polynomial
1346
+ PURPOSE: computes the total Chern class of the product of two vector bundles
1347
+ in terms of their ranks and Chern clases
1348
+ EXAMPLE: example chProdMP; shows an example
1349
+ NOTE: Implementation of the formula of Lascoux, the Schur polynomials are computed
1350
+ using the second Jacobi-Trudi formula (in terms of the Chern classes)
1351
+ "
1352
+ {
1353
+ if(r<=0) // if r is negative or zero, return 1
1354
+ {
1355
+ return( 1 );
1356
+ }
1357
+ if(R<=0) // if R is negative or zero, return 1
1358
+ {
1359
+ return( 1 );
1360
+ }
1361
+ //-------------------------------------------
1362
+ // now r and R are positive
1363
+ //-------------------------------------------
1364
+ c=append_by_zeroes(r, c);
1365
+ C=append_by_zeroes(R, C);
1366
+ c=c[1..r];
1367
+ C=C[1..R];
1368
+ list P;
1369
+ P=part(r, R); // compute the partitions of numbers up to R into r summands
1370
+ int sz=size(P); // number of such partitions
1371
+ int szu;
1372
+ int i, j;
1373
+ list T;
1374
+ list PU;
1375
+ list TU;
1376
+ poly rez; // the result will be computed here
1377
+ poly ST;
1378
+ // implement the formula of Manivel:
1379
+ for(i=1;i<=sz;i++) // run through all the partitions from P
1380
+ {
1381
+ T=P[i]; // the current partition
1382
+ ST= SchurS( PartC(T, R) , C ); // compute the corresponding Schur polynomial
1383
+ PU=partUnder(T); // compute the partitions under T
1384
+ szu=size(PU); // number of such partitions
1385
+ for(j=1;j<=szu;j++) // run through all the partitions lying under T
1386
+ {
1387
+ TU=PU[j]; // for each of them
1388
+ // add the corresponding term to the result
1389
+ rez=rez+Pcoef( TU, PartC(dualPart(T, R), r), r, R )* SchurCh(TU, c) *ST;
1390
+ }
1391
+ }
1392
+ return(rez); // return the result
1393
+ }
1394
+ example
1395
+ {
1396
+ "EXAMPLE:"; echo =2;
1397
+ // The total Chern class of the tensor product of a vector bundle of rank 3
1398
+ // with Chern classes c(1), c(2), c(3) and a vector bundle of rank 1 with
1399
+ // Chern class C(1)
1400
+ ring r = 0, ( c(1..3), C(1)), ws(1,2,3, 1);
1401
+ list c=c(1..3);
1402
+ list C=C(1);
1403
+ print( chProdMP(3,c,1,C) );
1404
+ }
1405
+ //---------------------------------------------------------------------------------------
1406
+
1407
+ proc ChernRootsHom(list a, list b)
1408
+ "USAGE: ChernRootsHom(a, b); a, b lists of polynomials
1409
+ RETURN: list of polynomials
1410
+ PURPOSE: for a vector bundle E with Chern roots a and a vector bundle F
1411
+ with Chern roots b, computes the Chern roots of Hom(E, F)
1412
+ EXAMPLE: example ChernRootsHom; shows an example
1413
+ NOTE:
1414
+ "
1415
+ {
1416
+ int na=size(a);
1417
+ int nb=size(b);
1418
+ int i;
1419
+ int j;
1420
+ list rez; // the result will be computed here
1421
+ for(i=1;i<=na;i++) // compute the result
1422
+ {
1423
+ for(j=1;j<=nb;j++)
1424
+ {
1425
+ rez=rez+list(-a[i]+b[j]);
1426
+ }
1427
+ }
1428
+ return(rez);
1429
+ }
1430
+ example
1431
+ {
1432
+ "EXAMPLE:"; echo=2;
1433
+ ring r=0, (a(1..2), b(1..3)), dp;
1434
+ list l=a(1..2);
1435
+ list L=b(1..3);
1436
+ // Let E be a vector bundle with Chern roots a(1). a(2),
1437
+ // let F be a vector bundle with CHern roots b(1), b(2), b(3).
1438
+ // Then the Chern roots of Hom(E, F) are
1439
+ print(ChernRootsHom(l, L));
1440
+ }
1441
+ //-----------------------------------------------------------------------------------------
1442
+
1443
+ proc chHom(def r, list c, def R, list C, list #)
1444
+ "USAGE: chHom(r, c, R, C [, N]); r, R polynomials (integers);
1445
+ c, C lists of polynomials, N integer
1446
+ RETURN: list of polynomials
1447
+ PURPOSE: computes [up to degree N] the list of Chern classes of the vector bundle Hom(E, F)
1448
+ in terms of the ranks and the Chern classes of E and F
1449
+ EXAMPLE: example chHom; shows an example
1450
+ NOTE:
1451
+ "
1452
+ {
1453
+ return( chProd(r, chDual(c), R, C, # ) );
1454
+ }
1455
+ example
1456
+ {
1457
+ "EXAMPLE:"; echo=2;
1458
+ ring H = 0, ( r, R, c(1..3), C(1..2) ), dp;
1459
+ list l=c(1..3);
1460
+ list L=C(1..2);
1461
+ // the Chern classes of Hom(E, F) for a vector bundle E of rank 3
1462
+ // with Chern classes c(1), c(2), c(3)
1463
+ // and a vector bundle F of rank 2 with Chern classes C(1) and C(2):
1464
+ print( chHom(3, l, 2, L) );
1465
+ // the first two Chern classes of Hom(E, F) for a vector bundle E of rank r
1466
+ // with Chern classes c(1) and c(2)
1467
+ // and a vector bundle G of rank R with Chern classes C(1) and C(2)
1468
+ // this gives the Chern classes of a tensor product on a complex surface
1469
+ l=c(1..2);
1470
+ L=C(1..2);
1471
+ print( chHom(r, l, R, L, 2 ) );
1472
+ }
1473
+ //---------------------------------------------------------------------------------
1474
+
1475
+ proc ChernRootsSymm(int n, list l)
1476
+ "USAGE: ChernRootsSymm(m, l); m integer, l a list of polynomials
1477
+ RETURN: list of polynomials
1478
+ PURPOSE: computes the Chern roots of m-th symmetric power
1479
+ of a vector bundle with Chern roots from l
1480
+ EXAMPLE: example ChernRootsSymm; shows an example
1481
+ NOTE:
1482
+ "
1483
+ {
1484
+ if(n<0) // return the empty list if n is negative
1485
+ {
1486
+ return(list(0));
1487
+ }
1488
+ int r=size(l);
1489
+ def br@=basering; // remember the base ring
1490
+ ring r@=0, (a@(1..r)), dp;
1491
+ ideal mon = a@(1..r);
1492
+ mon=mon^n; // all monomials of degree n
1493
+ list rez;
1494
+ int i, j;
1495
+ int N = size(mon);
1496
+ intvec v;
1497
+ for(i=1; i<=N; i++) // collect in rez the exponents of the monomials of degree n
1498
+ {
1499
+ v = leadexp(mon[i]);
1500
+ rez = rez + list(v);
1501
+ }
1502
+ setring br@;
1503
+ poly f;
1504
+ list rez1;
1505
+ // run over all exponents and construct the corresponding sums of the Chern roots
1506
+ for(i=1; i<=N; i++)
1507
+ {
1508
+ f=0;
1509
+ for(j=1;j<=r;j++)
1510
+ {
1511
+ f=f+rez[i][j]*l[j];
1512
+ }
1513
+ rez1=rez1+list(f);
1514
+ }
1515
+ return(rez1);
1516
+ }
1517
+ example
1518
+ {
1519
+ "EXAMPLE:";echo =2;
1520
+ ring r=0, (a(1..3)), dp;
1521
+ list l=a(1..3);
1522
+ // the Chern roots of the second symmetric power of a vector bundle
1523
+ // with Chern roots a(1), a(2), a(3)
1524
+ print( ChernRootsSymm(2, l) );
1525
+ }
1526
+ //------------------------------------------------------------
1527
+
1528
+ proc ChernRootsWedge( int m, list l)
1529
+ "USAGE: ChernRootsWedge(m, l); m integer, l a list of polynomials
1530
+ RETURN: list of polynomials
1531
+ PURPOSE: computes the Chern roots of m-th exterior power
1532
+ of a vector bundle with Chern roots from l
1533
+ EXAMPLE: example ChernRootsWedge; shows an example
1534
+ NOTE: makes sense only for list of polynomials
1535
+ "
1536
+ {
1537
+ int n=size(l);
1538
+ if((m>n)||(m<=0) ) // if m is bigger that n or non-positive
1539
+ {
1540
+ return( list(0) ); // return the list with one zero entry
1541
+ }
1542
+ else
1543
+ {
1544
+ if(m==n) // if m equals n, the only Chern root of the exterior power will be
1545
+ {
1546
+ return( list(sum(l)) ); // the sum of the initial Chern roots
1547
+ }
1548
+ else // otherwise proceed recursively
1549
+ {
1550
+ int i;
1551
+ list rez;
1552
+ list rez1;
1553
+ list l1 = delete(l, 1); // throw away the first element from the list
1554
+ poly f = l[1]; // remember the first entry of l
1555
+ // compute the Chern roots of the (m-1)-th exterior power of the smaller list
1556
+ rez1 = ChernRootsWedge(m-1, l1 );
1557
+ int s = size( rez1 );
1558
+ // add the first entry of the bigger list to every entry in the result,
1559
+ // this will give all Chern roots involving f
1560
+ for(i=1; i<=s; i++)
1561
+ {
1562
+ rez1[i] = f+rez1[i];
1563
+ }
1564
+ // return the union of those Chern roots with f and those without f
1565
+ rez = ChernRootsWedge(m, l1) + rez1;
1566
+ return( rez );
1567
+ }
1568
+ }
1569
+ }
1570
+ example
1571
+ {
1572
+ "EXAMPLE:";echo =2;
1573
+ ring r=0, (a(1..3)), dp;
1574
+ list l=a(1..3);
1575
+ // the Chern roots of the second exterior power of a vector bundle
1576
+ // with Chern roots a(1), a(2), a(3)
1577
+ print( ChernRootsWedge(2, l) );
1578
+ }
1579
+ //---------------------------------------------------------------------------------
1580
+
1581
+ proc chSymm(int k, int r, list c, list #)
1582
+ "USAGE: chSymm(k, r, c[, pos]); k, r integers, c list of polynomials, pos list of integers
1583
+ RETURN: list with entries: int N, list of polynomials l
1584
+ PURPOSE: computes the rank and the Chern classes of the symmetric power of a vector bundle
1585
+ EXAMPLE: example chSymm; shows an example
1586
+ NOTE: for the second symmetric power chSymm2L(...) could be faster
1587
+ "
1588
+ {
1589
+ // insure that the entries of c are polynomials
1590
+ // in order to be able to apply maps
1591
+ int i;
1592
+ for(i=1;i<=size(c);i++)
1593
+ {
1594
+ c[i]=poly(c[i]);
1595
+ }
1596
+ if(r<0) // if the rank is negative
1597
+ {
1598
+ print("The rank of a vector bundle can non be negative");
1599
+ return(list()); // return the empty list in this case
1600
+ }
1601
+ if(r==0) // if we deal with the zero bundle
1602
+ {
1603
+ return( list( 0, list() ) ); // return the data corresponding to the zero bundle
1604
+ }
1605
+ //-----------------------------------
1606
+ // from now on we are in the case r>0
1607
+ //-----------------------------------
1608
+ // if the length n of the list of Chern classes is smaller
1609
+ // than the rank of the vector bundle,
1610
+ // the higher classes are assumed to be zero and the list is appended by zeroes up to length r
1611
+ c=append_by_zeroes(r, c);
1612
+ // if the length of the list of the Chern classes is greater than the rank
1613
+ c=c[1..r]; // throw away the redundant data
1614
+ //-----------------------------------
1615
+ // from now on the length of c is r>0
1616
+ //-----------------------------------
1617
+ if(k<0)
1618
+ {
1619
+ print("You are trying to compute a negative symmetric power of a vector bundle");
1620
+ return( list(0, list() ) ); // assume such a power to be just a zero bundle
1621
+ }
1622
+ if(k==0) // the zeroth symmetric power is the trivial line bundle
1623
+ {
1624
+ return( list(1, list(0)) );
1625
+ }
1626
+ if(k==1) // the first symmetric power is equal to the vector bundle itself
1627
+ {
1628
+ return(list(r, c));
1629
+ }
1630
+ //-----------------------------------
1631
+ // from now on we are in the case k>2
1632
+ //-----------------------------------
1633
+ list LM = integer_list(#);
1634
+ int M = LM[2]; // maximum among the optional parameters
1635
+ # = LM[1]; // take into account only the first integer optional parameters that are positive
1636
+ //-------------------------------
1637
+ // Perform the computations now
1638
+ //-------------------------------
1639
+ def br@=basering; // remember the base ring
1640
+ // add additional variables to the base ring
1641
+ int ii;
1642
+ list l7 = "x@";
1643
+ l7 = l7+ ringlist(basering)[2];
1644
+ for (ii = 1; ii <= r; ii++)
1645
+ {
1646
+ l7[size(l7)+1] = "a@("+string(ii)+")";
1647
+ }
1648
+ ring r@ = create_ring(ring_list(basering)[1], l7, "lp", "no_minpoly");
1649
+ // define the corresponding inclusion of rings: imap
1650
+ list c=imap(br@,c); // embed c into the bigger ring
1651
+ list rez; // the Chern classes of the symmetric power are going to be written here
1652
+ poly E = product( list( a@(1..r ) ) ); // product of the Chern roots
1653
+ list ss=ChernRootsSymm(k, list( a@(1..r) ) ); // list of the Chern roots of the symmetric power
1654
+ int N=size(ss); // number of such roots, it equals the rank of the symmetric power
1655
+ // the entries in C will be the Chern classes of the symmetric power
1656
+ // expressed in terms of the Chern roots of the initial vector bundle
1657
+ list C;
1658
+ ideal I, J;
1659
+ // list of the Chern classes of the initial vector bundle expressed in its Chern roots
1660
+ list sym=symm(list(a@(1..r)));
1661
+ if(size(#)==0) // if there are no optional parameters, compute all Chern classes
1662
+ {
1663
+ // the entries here are the Chern classes of the symmetric power
1664
+ // expressed in terms of Chern roots of the initial vector bundle
1665
+ C=symm(ss);
1666
+ for(i=1;i<=N;i++) // eliminate the Chern roots
1667
+ {
1668
+ if(i<= r) // first add all relevant formulas for the Chern classes in terms of Chern roots
1669
+ {
1670
+ I=I, c[i]-sym[i];
1671
+ }
1672
+ J = I, x@-C[i];
1673
+ // Notice that elim(...) is from the library "elim.lib",
1674
+ // it is loaded as a result of loading "general.lib"
1675
+ J=simplify(elim(J, E), 1);
1676
+ // get the expression of the next Chern class
1677
+ // in terms of the Chern classes of the initial vector bundle
1678
+ rez=rez+list( -subst( J[1], x@, 0) );
1679
+ }
1680
+ }
1681
+ else // otherwise compute only the needed Chern classes
1682
+ {
1683
+ C=symm(ss, M); // only the needed Chern classes
1684
+ int j;
1685
+ i=1;
1686
+ // the maximal number of optional parameters to be considered does not exceed N,
1687
+ // i.e., the rank of the symmetric power
1688
+ int NN = min( size(#), N);
1689
+ for(j=1; j <= NN; j++) // process the optional parameters
1690
+ {
1691
+ // process the optional parameters only until they are not bigger than N;
1692
+ // notice they are positive anyway after integer_list(...)
1693
+ if( #[j]<=N )
1694
+ {
1695
+ for( ; i<=#[j];i++)
1696
+ {
1697
+ if(i<=r)
1698
+ {
1699
+ // add the relevant formulas for the Chern classes in terms of the Chern roots
1700
+ I=I, c[i]-sym[i];
1701
+ }
1702
+ }
1703
+ J= I, x@-C[ #[j]];
1704
+ // Notice that elim(...) is from the library "elim.lib",
1705
+ // it is loaded as a result of loading "general.lib"
1706
+ J=simplify(elim(J, E), 1);
1707
+ // get the expression of the next Chern class
1708
+ // in terms of the Chern classes of the initial vector bundle
1709
+ rez=rez+list( -subst( J[1], x@, 0) );
1710
+ }
1711
+ else // get out from the loop
1712
+ {
1713
+ break;
1714
+ }
1715
+ }
1716
+ }
1717
+ // used because Singular seems not to be able to apply maps to empty lists (see below)
1718
+ if(size(rez)==0)
1719
+ {
1720
+ return(list(N, list()));
1721
+ }
1722
+ setring br@; // come back to the initial base ring
1723
+ // define the specialization homomorphism,
1724
+ // evaluate the formulas for the Chern classes on their given values
1725
+ map FF = r@,0,maxideal(1);
1726
+ list rez=FF( rez ); // bring the result back to the initial ring
1727
+ return( list( N, rez ) ); // return the result together with the rank of the symmetric power
1728
+ }
1729
+ example
1730
+ {
1731
+ "EXAMPLE:";echo =2;
1732
+ ring r=0, (c(1..5)), dp;
1733
+ list l=c(1..5);
1734
+ // the rank and the Chern classes of the second symmetric power of a vector bundle of rank 3
1735
+ print( chSymm(2, 3, l) );
1736
+ // the rank and the first 3 Chern classes
1737
+ // of the second symmetric power of a vector bundle of rank 5
1738
+ print( chSymm(2, 5, l, 1, 2, 3) );
1739
+ }
1740
+ //----------------------------------------------------------------------------------
1741
+
1742
+ proc chSymm2L(int r, list c)
1743
+ "USAGE: chSymm2L(r, c); r integer, c list of polynomials
1744
+ RETURN: list of polynomials
1745
+ PURPOSE: computes the Chern classes of the second symmetric power of a vector bundle
1746
+ EXAMPLE: example chSymm2L; shows an example
1747
+ NOTE: Implementation of the formula of Lascoux, the Schur polynomials are computed
1748
+ using the second Jacobi-Trudi formula (in terms of the Chern classes)
1749
+ "
1750
+ {
1751
+ // insure that the entries of c are polynomials
1752
+ // in order to be able to apply maps
1753
+ int i;
1754
+ for(i=1;i<=size(c);i++)
1755
+ {
1756
+ c[i]=poly(c[i]);
1757
+ }
1758
+ if(r<0) // if the rank is negative
1759
+ {
1760
+ print("The rank of a vector bundle can non be negative");
1761
+ return(list()); // return the empty list in this case
1762
+ }
1763
+ if(r==0) // if we deal with the zero bundle
1764
+ {
1765
+ return( list( 0, list() ) ); // return the data corresponding to the zero bundle
1766
+ }
1767
+ //-----------------------------------
1768
+ // from now on we are in the case r>0
1769
+ //-----------------------------------
1770
+ c=append_by_zeroes(r, c);
1771
+ c=c[1..r];
1772
+ def br@=basering; // remember the base ring
1773
+ // add additional variables to the base ring
1774
+ list l8 = ringlist(basering)[2];
1775
+ l8[size(l8)+1] = "t@";
1776
+ for (int ii = 1; ii <= r; ii++)
1777
+ {
1778
+ l8[size(l8)+1] = "c@("+string(ii)+")";
1779
+ }
1780
+ ring r@ = create_ring(ring_list(basering)[1], l8, "dp", "no_minpoly");
1781
+ list c;
1782
+ for(i=1;i<=r;i++)
1783
+ {
1784
+ c[i]=c@(i)*t@^i;
1785
+ }
1786
+ poly f = chSymm2LP(r,c); // get the total Chern class using the formula of Lascoux
1787
+ matrix CF = coeffs(f, t@);
1788
+ int N=r*(r+1) div 2;
1789
+ list rez; // write the coefficients in front of the powers of t@ into a list
1790
+ for(i=1;i<=N;i++)
1791
+ {
1792
+ rez=rez+list(CF[i+1,1]);
1793
+ }
1794
+ setring br@; // come back to the initial base ring
1795
+ map FF = r@,maxideal(1),0, c[1..r]; // define the specialization homomorphism
1796
+ return( list(N, FF( rez )) ); // bring the result to the initial ring
1797
+ }
1798
+ example
1799
+ {
1800
+ "EXAMPLE:";echo =2;
1801
+ ring r=0, (c(1..2)), dp;
1802
+ list l=c(1..2);
1803
+ // the Chern classes of the second symmetric power of a vector bundle of rank 2
1804
+ print( chSymm2L(2, l));
1805
+ }
1806
+ //---------------------------------------------------------------------------------------
1807
+
1808
+ proc chSymm2LP(int r, list c)
1809
+ "USAGE: chSymm2LP(r, c); r integer, c list of polynomials
1810
+ RETURN: poly
1811
+ PURPOSE: computes the total Chern class of the second symmetric power of a vector bundle
1812
+ EXAMPLE: example chSymm2LP; shows an example
1813
+ NOTE: Implementation of the formula of Lascoux, the Schur polynomials are computed
1814
+ using the second Jacobi-Trudi formula (in terms of the Chern classes)
1815
+ "
1816
+ {
1817
+ if(r<0) // if the rank is negative
1818
+ {
1819
+ print("The rank of a vector bundle can non be negative");
1820
+ return(1); // return 1 in this case
1821
+ }
1822
+ if(r==0) // if we deal with the zero bundle
1823
+ {
1824
+ return( 1 ); // return 1 in this case
1825
+ }
1826
+ //-------------------------------------------
1827
+ // from now on we are in the case r > 0
1828
+ //-------------------------------------------
1829
+ c=append_by_zeroes(r, c);
1830
+ c=c[1..r];
1831
+ list I; // the partition (1,2,...,r) will be stored here
1832
+ int i;
1833
+ for(i=1;i<=r;i++)
1834
+ {
1835
+ I=I+list(i);
1836
+ }
1837
+ list PU = partUnder(I); // compute the partitions under I
1838
+ int sz=size(PU); // get their number
1839
+ poly rez; // the result will be computed here
1840
+ list J;
1841
+ poly cf;
1842
+ int ex;
1843
+ // implement the formula of Lascoux
1844
+ for(i=1;i<=sz;i++)
1845
+ {
1846
+ J=PU[i];
1847
+ ex=sum(J)- r*(r-1) div 2;
1848
+ if(ex>=0)
1849
+ {
1850
+ cf=bigint(2)^ex*IJcoef(I, J);
1851
+ }
1852
+ else
1853
+ {
1854
+ cf=IJcoef(I, J)/bigint(2)^(-ex);
1855
+ }
1856
+ rez = rez + cf * SchurCh(J, c );
1857
+ }
1858
+ return(rez);
1859
+ }
1860
+ example
1861
+ {
1862
+ "EXAMPLE:";echo =2;
1863
+ ring r=0, (c(1..2)), ws(1, 2);
1864
+ list l=c(1..2);
1865
+ // the total Chern class of the second symmetric power of a vector bundle of rank 2
1866
+ print( chSymm2LP(2, l));
1867
+ }
1868
+ //---------------------------------------------------------------------------------------
1869
+
1870
+ proc chWedge(int k, int r, list c, list #)
1871
+ "USAGE: chWedge(k, r, c [,pos]); k, r integers, c list of polynomials, pos list of integers
1872
+ RETURN: list with entries: int N, list of polynomials l
1873
+ PURPOSE: computes the rank and the Chern classes of the exterior power of a vector bundle
1874
+ EXAMPLE: example chWedge; shows an example
1875
+ NOTE: for the second exterior power chWedge2L(...) could be faster
1876
+ "
1877
+ {
1878
+ // insure that the entries of c are polynomials
1879
+ // in order to be able to apply maps
1880
+ int i;
1881
+ for(i=1;i<=size(c);i++)
1882
+ {
1883
+ c[i]=poly(c[i]);
1884
+ }
1885
+ if(r<0) // if the rank is negative
1886
+ {
1887
+ print("The rank of a vector bundle can non be negative");
1888
+ return(list()); // return the empty list in this case
1889
+ }
1890
+ if(r==0) // if we deal with the zero bundle
1891
+ {
1892
+ return( list( 0, list() ) ); // return the data corresponding to the zero bundle
1893
+ }
1894
+ //-------------------------------------------
1895
+ // from now on we are in the case r > 0
1896
+ //-------------------------------------------
1897
+ if(k<0)
1898
+ {
1899
+ print("You are trying to compute a negative exterior power of a vector bundle");
1900
+ return( list(0, list() ) ); // assume such a power to be just a zero bundle
1901
+ }
1902
+ if(k==0) // the zeroth exterior power is the trivial line bundle
1903
+ {
1904
+ return( list(1, list(0)) );
1905
+ }
1906
+ if(k==1) // the first exterior power is equal to the vector bundle itself
1907
+ {
1908
+ c=append_by_zeroes(r, c);
1909
+ c=c[1..r];
1910
+ return(list(r, c));
1911
+ }
1912
+ //---------------------------------------
1913
+ // from now on we are in the case k > 2
1914
+ //---------------------------------------
1915
+ // if the length of the list of Chern classes is smaller than the rank of the vector bundle,
1916
+ // the higher classes are assumed to be zero and the list is appended by zeroes up to length r
1917
+ c=append_by_zeroes(r, c);
1918
+ // if the length of the list of the Chern classes is greater than the rank
1919
+ c=c[1..r]; // throw away the redundant data
1920
+ //------------------------------------------
1921
+ // from now on the length of c is r > 0
1922
+ //------------------------------------------
1923
+ if( k>r ) // if k>r, the exterior power is zero
1924
+ {
1925
+ return( list( int(0), list() ) );
1926
+ }
1927
+ //-----------------------------------------------
1928
+ // from now on we are in the case 0 < k <= r = n
1929
+ //-----------------------------------------------
1930
+ if(k==r)
1931
+ {
1932
+ return(list( int(1), list( c(1) ) ) );
1933
+ }
1934
+ //-----------------------------------------------
1935
+ // from now on we are in the case 0 < k < r = n
1936
+ //-----------------------------------------------
1937
+ list LM = integer_list(#);
1938
+ int M=LM[2]; // maximum among the optional parameters if there are any, zero otherwise
1939
+ # = LM[1]; // take into account only the first integer optional parameters that are positive
1940
+ //-----------------------------
1941
+ // Let us compute now
1942
+ //-----------------------------
1943
+ def br@=basering; // remember the base ring
1944
+ // add additional variables a@(1..r), x@ to the base ring
1945
+ list l9 = "x@";
1946
+ l9 = l9+ ringlist(basering)[2];
1947
+ for (int ii = 1; ii <= r; ii++)
1948
+ {
1949
+ l9[size(l9)+1] = "a@("+string(ii)+")";
1950
+ }
1951
+ ring r@ = create_ring(ring_list(basering)[1], l9, "lp", "no_minpoly");
1952
+ // define the corresponding inclusion of rings: imap
1953
+ list c = imap(br@,c); // embed c into the bigger ring
1954
+ list rez; // the result should be computed here
1955
+ poly E = product( list( a@(1..r ) ) ); // product of the Chern roots to be eliminaned
1956
+ list ss=ChernRootsWedge(k, list( a@(1..r) )); // list of the Chern roots of the exterior product
1957
+ int N=size(ss); // length of ss, equals the rank of the exterior product
1958
+ // list of the Chern classes of the initial vector bundle in terms of their Chern roots
1959
+ list sym=symm(list(a@(1..r)));
1960
+ // the entries here will be the Chern classes we need
1961
+ // expressed in terms of the Chern roots of the initial vector bundle
1962
+ list C;
1963
+ ideal I, J;
1964
+ if( size(#) == 0 ) // if there are no optional parameters, compute all Chern classes
1965
+ {
1966
+ // the entries here are the Chern classes we need
1967
+ // expressed in terms of the Chern roots of the initial vector bundle
1968
+ C=symm(ss);
1969
+ for(i=1;i<=N;i++) // eliminate the Chern roots
1970
+ {
1971
+ if(i<= r) // first add all relevant formulas for the Chern classes in terms of Chern roots
1972
+ {
1973
+ I=I, c[i]-sym[i];
1974
+ }
1975
+ J = I, x@-C[i];
1976
+ // Notice that elim(...) is from the library "elim.lib",
1977
+ // it is loaded as a result of loading "general.lib"
1978
+ J=simplify(elim(J, E), 1);
1979
+ // get the expression of the next Chern class
1980
+ // in terms of the Chern classes of the initial vector bundle
1981
+ rez=rez+list( -subst( J[1], x@, 0) );
1982
+ }
1983
+ }
1984
+ else // otherwise compute only the needed Chern classes
1985
+ {
1986
+ // the entries here are the Chern classes we need
1987
+ // expressed in terms of the Chern roots of the initial vector bundle
1988
+ C=symm(ss, M);
1989
+ int j;
1990
+ i=1;
1991
+ // the maximal number of optional parameters to be considered
1992
+ // does not exceed N, the rank of the exterior power
1993
+ int NN = min( size(#), N);
1994
+ for(j=1; j <= NN; j++) // process the optional parameters
1995
+ {
1996
+ // process the optional parameters only until they are not bigger than N;
1997
+ // notice they are positive anyway after integer_list(...)
1998
+ if( #[j]<=N )
1999
+ {
2000
+ for( ; i<=#[j]; i++)
2001
+ {
2002
+ if( i<=r )
2003
+ {
2004
+ // add the relevant formulas for the Chern classes in terms of the Chern roots
2005
+ I=I, c[i]-sym[i];
2006
+ }
2007
+ }
2008
+ J= I, x@-C[ #[j]];
2009
+ // Notice that elim(...) is from the library "elim.lib",
2010
+ // it is loaded as a result of loading "general.lib"
2011
+ J=simplify(elim(J, E), 1);
2012
+ // get the expression of the next Chern class
2013
+ // in terms of the Chern classes of the initial vector bundle
2014
+ rez=rez+list( -subst( J[1], x@, 0) );
2015
+ }
2016
+ else // get out from the loop
2017
+ {
2018
+ break;
2019
+ }
2020
+ }
2021
+ }
2022
+ // used because Singular seems not to be able to apply maps to empty lists (see below)
2023
+ if(size(rez)==0)
2024
+ {
2025
+ return(list(N, list()));
2026
+ }
2027
+ setring br@; // come back to the initial base ring
2028
+ // define the specialization homomorphism,
2029
+ // evaluate the formulas for the Chern classes on their given values
2030
+ map FF = r@,0,maxideal(1);
2031
+ list rez=FF( rez ); // bring the result back to the initial ring
2032
+ return( list( N, rez ) ); //return the rank and the Chern classes of the exterior product
2033
+ }
2034
+ example
2035
+ {
2036
+ "EXAMPLE:";echo =2;
2037
+ ring r=0, (c(1..5)), dp;
2038
+ list l=c(1..5);
2039
+ // the rank and the Chern classes of the second exterior power of a vector bundle of rank 3
2040
+ print( chWedge(2, 3, l) );
2041
+ // the rank and the first 3 Chern classes
2042
+ // of the fourth exterior power of a vector bundle of rank 5
2043
+ print( chWedge(4, 5, l, 1, 2, 3) );
2044
+ }
2045
+ //---------------------------------------------------------------------------------
2046
+
2047
+ proc chWedge2L(int r, list c)
2048
+ "USAGE: chWedge2L(r, c ); r integer, c list of polynomials
2049
+ RETURN: list of polynomials
2050
+ PURPOSE: computes the Chern classes of the second exterior power of a vector bundle
2051
+ EXAMPLE: example chWedge2L; shows an example
2052
+ NOTE: Implementation of the formula of Lascoux, the Schur polynomials are computed
2053
+ using the second Jacobi-Trudi formula (in terms of the Chern classes)
2054
+ "
2055
+ {
2056
+ // insure that the entries of c are polynomials
2057
+ // in order to be able to apply maps
2058
+ int i;
2059
+ for(i=1;i<=size(c);i++)
2060
+ {
2061
+ c[i]=poly(c[i]);
2062
+ }
2063
+ if(r<0) // if the rank is negative
2064
+ {
2065
+ print("The rank of a vector bundle can non be negative");
2066
+ return(list()); // return the empty list in this case
2067
+ }
2068
+ if(r==0) // if we deal with the zero bundle
2069
+ {
2070
+ return( list( 0, list() ) ); // return the data corresponding to the zero bundle
2071
+ }
2072
+ //-------------------------------------------
2073
+ // from now on we are in the case r > 0
2074
+ //-------------------------------------------
2075
+ c=append_by_zeroes(r, c);
2076
+ c=c[1..r];
2077
+ def br@=basering; // remember the base ring
2078
+ // add additional variables to the base ring
2079
+ list l10 = ringlist(basering)[2];
2080
+ l10[size(l10)+1] = "t@";
2081
+ for (int ii = 1; ii <= r; ii++)
2082
+ {
2083
+ l10[size(l10)+1] = "c@("+string(ii)+")";
2084
+ }
2085
+ ring r@ = create_ring(ring_list(basering)[1], l10, "dp", "no_minpoly");
2086
+ list c;
2087
+ for(i=1;i<=r;i++)
2088
+ {
2089
+ c[i]=c@(i)*t@^i;
2090
+ }
2091
+ poly f = chWedge2LP(r,c); // get the total Chern class using the formula of Lascoux
2092
+ matrix CF = coeffs(f, t@);
2093
+ int N=r*(r-1) div 2;
2094
+ list rez; // write its coefficients in front of the powers of t@ to a list
2095
+ for(i=1;i<=N;i++)
2096
+ {
2097
+ rez=rez+list(CF[i+1,1]);
2098
+ }
2099
+ setring br@; // come back to the initial base ring
2100
+ map FF = r@,maxideal(1),0, c[1..r]; // define the specialization homomorphism
2101
+ return( list(N, FF( rez )) ); // bring the result to the initial ring
2102
+ }
2103
+ example
2104
+ {
2105
+ "EXAMPLE:";echo =2;
2106
+ ring r=0, (c(1..3)), dp;
2107
+ list l=c(1..3);
2108
+ // the Chern classes of the second exterior power of a vector bundle of rank 3
2109
+ print(chWedge2L(3, l));
2110
+ }
2111
+ //---------------------------------------------------------------------------------------
2112
+
2113
+ proc chWedge2LP(int r, list c)
2114
+ "USAGE: chWedge2LP(r, c ); r integer, c list of polynomials
2115
+ RETURN: poly
2116
+ PURPOSE: computes the total Chern class of the second exterior power of a vector bundle
2117
+ EXAMPLE: example chWedge2LP; shows an example
2118
+ NOTE: Implementation of the formula of Lascoux, the Schur polynomials are computed
2119
+ using the second Jacobi-Trudi formula (in terms of the Chern classes)
2120
+ "
2121
+ {
2122
+ if(r<0) // if the rank is negative
2123
+ {
2124
+ print("The rank of a vector bundle can non be negative");
2125
+ return(1); // return 1 in this case
2126
+ }
2127
+ if(r==0) // if we deal with the zero bundle
2128
+ {
2129
+ return( 1 ); // return 1 in this case
2130
+ }
2131
+ //-------------------------------------------
2132
+ // from now on we are in the case r > 0
2133
+ //-------------------------------------------
2134
+ c=append_by_zeroes(r, c);
2135
+ c=c[1..r];
2136
+ list I; // the partition (0,1,...,r-1) will be stored here
2137
+ int i;
2138
+ for(i=0;i<=r-1;i++)
2139
+ {
2140
+ I=I+list(i);
2141
+ }
2142
+ list PU = partUnder(I); // compute the partitions under I
2143
+ int sz=size(PU); // get their number
2144
+ poly rez; // the result will be computed here
2145
+ list J;
2146
+ poly cf;
2147
+ // implement the Lascoux formula
2148
+ for(i=1;i<=sz;i++)
2149
+ {
2150
+ J=PU[i];
2151
+ cf = IJcoef(I,J)/bigint(2)^( r*(r-1) div 2-sum(J) );
2152
+ rez = rez + cf * SchurCh(J, c );
2153
+ }
2154
+ return(rez);
2155
+ }
2156
+ example
2157
+ {
2158
+ "EXAMPLE:";echo =2;
2159
+ ring r=0, (c(1..3)), ws(1,2,3);
2160
+ list l=c(1..3);
2161
+ // the total Chern class of the second exterior power of a vector bundle of rank 3
2162
+ print(chWedge2LP(3, l));
2163
+ }
2164
+ //---------------------------------------------------------------------------------------
2165
+
2166
+ proc todd(list c, list #)
2167
+ "USAGE: todd(l [, n] ); l a list of polynomials, n integer
2168
+ RETURN: list of polynomials
2169
+ PURPOSE: computes [the first n] terms of the Todd class
2170
+ EXAMPLE: example todd; shows an example
2171
+ NOTE: returns an empty list if l is empty
2172
+ "
2173
+ {
2174
+ int i, j, k;
2175
+ // insure that the entries of c are polynomials
2176
+ // in order to be able to apply maps
2177
+ for(i=1;i<=size(c); i++)
2178
+ {
2179
+ c[i]=poly(c[i]);
2180
+ }
2181
+ int n;
2182
+ # = integer_list(#)[1]; // take into account only the first integer entries that are positive
2183
+ if( size(#) == 0 ) // if there are no optional parameters
2184
+ {
2185
+ n = size(c);
2186
+ }
2187
+ else
2188
+ {
2189
+ // set n to be 0, if the parameter is non-positive,
2190
+ // set n to the value of the parameter otherwise
2191
+ n = max( #[1], 0 );
2192
+ c = append_by_zeroes(n, c); // append c by zeroes if the length of c is smaller than n
2193
+ if(n!=0) // throw away the redundant data if n is positive and smaller than the length of c
2194
+ {
2195
+ c = c[1..n];
2196
+ }
2197
+ }
2198
+ if(n==0) // return the empty list
2199
+ {
2200
+ return(list());
2201
+ }
2202
+ else // otherwise proceed as follows
2203
+ {
2204
+ def br@=basering; // remember the base ring
2205
+ // add additional variables to the base ring
2206
+ list l11 = ringlist(basering)[2];
2207
+ l11[size(l11)+1] = "a@";
2208
+ for (int ii = 1; ii <= n; ii++)
2209
+ {
2210
+ l11[size(l11)+1] = "c@("+string(ii)+")";
2211
+ }
2212
+ ring r@ = create_ring(ring_list(basering)[1], l11, "dp", "no_minpoly");
2213
+ // define the corresponding inclusion of rings: imap
2214
+ list c=imap(br@,c); // embed c into the bigger ring
2215
+ list prev;
2216
+ list next;
2217
+ next=tdTerms(n, c@(1)); // the Todd class terms of a line budle
2218
+ list step = tdTerms(n, a@);
2219
+ poly f;
2220
+ list hC=c@(1)-a@; // "old" first Chern class
2221
+ for(k=2;k<=n;k++) // do n-1 iterations
2222
+ {
2223
+ prev=next;
2224
+ next=list();
2225
+ hC=hC+list( c@(k)-a@*hC[k-1] ); // "old" k-th Chern class
2226
+ for(i=0;i<k;i++) // these terms have already been computed in the previous iterations
2227
+ {
2228
+ next = next + list(prev[i+1]);
2229
+ }
2230
+ for(i=k;i<=n;i++) // new values in terms of "old" Chern classes and the Chern root a
2231
+ {
2232
+ f=0;
2233
+ for(j=0; j<=i; j++)
2234
+ {
2235
+ f=f + step[j+1]*prev[i-j+1];
2236
+ }
2237
+ // substitute the old values of Chern classes
2238
+ // by their expressions in the new ones and the Chern root a
2239
+ for(j=1;j<k;j++)
2240
+ {
2241
+ f=subst(f, c@(j), hC[j] );
2242
+ }
2243
+ f=reduce(f, std(hC[k]) ); // eliminate the Chern root
2244
+ next = next + list(f);
2245
+ }
2246
+ }
2247
+ next = delete(next, 1); // throw away the zeroth term which is always equal to 1
2248
+ setring br@; // come back to the initial base ring
2249
+ map FF = r@,maxideal(1),0, c[1..n]; // define the specialization homomorphism
2250
+ return( FF( next ) ); // bring the result to the initial ring
2251
+ }
2252
+ }
2253
+ example
2254
+ {
2255
+ "EXAMPLE:";echo =2;
2256
+ // the terms of the Todd class up to degree 5
2257
+ // in terms of the Chern classes c(1), c(2), c(3), c(4), c(5)
2258
+ ring r=0, (c(1..5)), dp;
2259
+ list l=c(1..5);
2260
+ print( todd( l ) );
2261
+
2262
+ // in the same situation compute only first two terms
2263
+ print( todd(l, 2) );
2264
+
2265
+ // compute the first 5 terms corresponding to the Chern classes c(1), c(2)
2266
+ l=c(1..2);
2267
+ print( todd(l, 5) );
2268
+ }
2269
+ //------------------------------------------------------------------------------------------
2270
+
2271
+ proc toddE(list c)
2272
+ "USAGE: toddE(l); l a list of polynomials
2273
+ RETURN: polynomial
2274
+ PURPOSE: computes the highest relevant term of the Todd class
2275
+ EXAMPLE: example toddE; shows an example
2276
+ NOTE: returns an empty list if l is empty,
2277
+ very inefficient because the elimination is used, included for comparison with todd(c)
2278
+ "
2279
+ {
2280
+ int i;
2281
+ for(i=1;i<=size(c);i++)
2282
+ {
2283
+ c[i]=poly( c[i] );
2284
+ }
2285
+ int n=size(c);
2286
+ if(n==0) // return the empty list if c is empty
2287
+ {
2288
+ return(list());
2289
+ }
2290
+ else
2291
+ {
2292
+ def br@=basering; // remember the base ring
2293
+ // add additional variables a@(1..n), x@ to the base ring
2294
+ list l12 = "x@";
2295
+ l12 = l12+ ringlist(basering)[2];
2296
+ for (int ii = 1; ii <= n; ii++)
2297
+ {
2298
+ l12[size(l12)+1] = "a@("+string(ii)+")";
2299
+ }
2300
+ ring r@ = create_ring(ring_list(basering)[1], l12, "lp", "no_minpoly");
2301
+ // define the corresponding inclusion of rings: imap
2302
+ list c=imap(br@,c); // embed c into the bigger ring
2303
+ int j;
2304
+ int k;
2305
+ poly E = a@(1); // to be the product of the Chern roots that will be eliminated later
2306
+ list ss=tdTerms( n, a@(1) );
2307
+ list next; // to be the terms of the Todd class corresponding to the next Chern root
2308
+ for(i=2;i<=n;i++) // compute the terms of the Todd class in terms of the Chern roots
2309
+ {
2310
+ E=E*a@(i); // to compute the product of variables to be eliminated
2311
+ next=tdTerms( n, a@(i) );
2312
+ for(j=n;j>=1;j--)
2313
+ {
2314
+ for(k=0;k<j;k++)
2315
+ {
2316
+ ss[j+1]=ss[j+1]+ss[k+1]*next[j-k+1];
2317
+ }
2318
+ }
2319
+ }
2320
+ ideal I=x@ - ss[n+1]; // formula for the highest degree term of the Todd class
2321
+ list sym=symm(list(a@(1..n))); // expressions for the Chern classes in terms of the Chern roots
2322
+ for(i=1;i<=n;i++)
2323
+ {
2324
+ I=I, c[i]-sym[i]; // add the relations
2325
+ }
2326
+ I=simplify(elim(I, E), 1); // eliminate the Chern roots
2327
+ poly rez=-subst(I[1],x@, 0); // get the required formula
2328
+ setring br@; // come back to the initial base ring
2329
+ // define the specialization homomorphism (all added variables are set to zero)
2330
+ map FF = r@,0,maxideal(1);
2331
+ poly rez=FF( rez ); // bring the result back to the initial base ring
2332
+ return(rez);
2333
+ }
2334
+ }
2335
+ example
2336
+ {
2337
+ "EXAMPLE:";echo =2;
2338
+ // first 3 terms of the Todd class in terms of the Chern classes c(1), c(2), c(3)
2339
+ ring r=0, (c(1..3)), dp;
2340
+ list l;
2341
+ //first term
2342
+ l=c(1);
2343
+ print( toddE( l ) );
2344
+ // second term
2345
+ l=c(1..2);
2346
+ print( toddE( l ) );
2347
+ // third term
2348
+ l=c(1..3);
2349
+ print( toddE( l ) );
2350
+ }
2351
+ //---------------------------------------------------------------------------------
2352
+
2353
+ proc Bern(int n)
2354
+ "USAGE: Bern(n); n non-negative integer
2355
+ RETURN: list of numbers
2356
+ PURPOSE: computes the list of (second) Bernoulli numbers from B(0) to B(n)
2357
+ EXAMPLE: example Bern; shows an example
2358
+ NOTE: needs a base ring to be defined, returns an empty list if n is negative,
2359
+ uses the Akiyama-Tanigawa algorithm
2360
+ "
2361
+ {
2362
+ // the Akiyama-Tanigawa algorithm
2363
+ //could be replaced by a more efficient one
2364
+ list rez, steprez;
2365
+ int i, j;
2366
+ if(n<0) // if n is negative, return the empty list
2367
+ {
2368
+ return(list());
2369
+ }
2370
+ for(i=0;i<=n;i++)
2371
+ {
2372
+ steprez=steprez+list( 1/number(i+1) );
2373
+ for(j=i;j>=1;j--)
2374
+ {
2375
+ steprez[j]=j*(steprez[j]-steprez[j+1]);
2376
+ }
2377
+ rez=rez+list(steprez[1]);
2378
+ }
2379
+ return(rez);
2380
+ }
2381
+ example
2382
+ {
2383
+ "EXAMPLE:";echo =2;
2384
+ // first 10 Bernoulli numbers: B(0), ..., B(9)
2385
+ ring r=0,(t), dp;
2386
+ print( Bern(9) );
2387
+ }
2388
+ //---------------------------------------------------------------------------------
2389
+
2390
+ proc tdCf(int n)
2391
+ "USAGE: tdCf(n); n integer
2392
+ RETURN: list of rational numbers
2393
+ PURPOSE: computes up to degree n the coefficients of the Todd class of a line bundle
2394
+ EXAMPLE: example tdCf; shows an example
2395
+ NOTE:
2396
+ "
2397
+ {
2398
+ list rez=Bern(n); // notice that Bern(n) is able to take care of negative n
2399
+ int i;
2400
+ for(i=1;i<=n+1;i++)
2401
+ {
2402
+ rez[i]=rez[i]/factorial(i-1);
2403
+ }
2404
+ return(rez);
2405
+ }
2406
+ example
2407
+ {
2408
+ "EXAMPLE:";echo =2;
2409
+ // first 5 coefficients
2410
+ ring r=0,(t), dp;
2411
+ print( tdCf(4) );
2412
+ }
2413
+ //---------------------------------------------------------------------------------
2414
+
2415
+ proc tdTerms(int n, poly f)
2416
+ "USAGE: tdTerms(n, f); n integer, f polynomial
2417
+ RETURN: list of polynomials
2418
+ PURPOSE: computes the terms of the Todd class of the line bundle with the Chern root f
2419
+ EXAMPLE: example tdTerms; shows an example
2420
+ NOTE:
2421
+ "
2422
+ {
2423
+ list rez=Bern(n); // notice that Bern(n) takes care of negative n
2424
+ int i;
2425
+ for(i=1;i<=n+1;i++)
2426
+ {
2427
+ rez[i]=( rez[i]/factorial(i-1) )* f^(i-1);
2428
+ }
2429
+ return(rez);
2430
+ }
2431
+ example
2432
+ {
2433
+ "EXAMPLE:";echo =2;
2434
+ ring r=0, (t), ls;;
2435
+ // the terms of the Todd class of a line bundle with Chern root t up to degree 4
2436
+ print( tdTerms(4, t) );
2437
+ }
2438
+ //---------------------------------------------------------------------------------
2439
+
2440
+ proc tdFactor(int n, poly t)
2441
+ "USAGE: tdFactor(n, a); n integer, a polynomial
2442
+ RETURN: polynomial
2443
+ PURPOSE: computes up to degree n the Todd class
2444
+ of the line bundle corresponding to the Chern root t
2445
+ EXAMPLE: example tdFactor; shows an example
2446
+ NOTE: returns 0 if n is negative
2447
+ "
2448
+ {
2449
+ int i;
2450
+ poly rez=0;
2451
+ list l=Bern(n); // get the coefficients
2452
+ for(i=0; i<=n; i++) // form the polynomial
2453
+ {
2454
+ rez=rez+(l[i+1]/factorial(i))*t^i;
2455
+ }
2456
+ return(rez);
2457
+ }
2458
+ example
2459
+ {
2460
+ "EXAMPLE:";echo =2;
2461
+ // the Todd class up do degree 4
2462
+ ring r=0,(t), ls;
2463
+ print( tdFactor(4, t) );
2464
+ }
2465
+ //---------------------------------------------------------------------------------
2466
+
2467
+ proc cProj(int n)
2468
+ "USAGE: cProj(n); n integer
2469
+ RETURN: list of integers
2470
+ PURPOSE: computes the terms of positive degree of the total Chern class
2471
+ of the tangent bundle on the complex projective space
2472
+ EXAMPLE: example cProj; shows an example
2473
+ NOTE:
2474
+ "
2475
+ {
2476
+ if(n<0)
2477
+ {
2478
+ print("The dimension of the projective space must be non-negative!");
2479
+ return(list()); // return the empty list in this case
2480
+ }
2481
+ else
2482
+ {
2483
+ list rez;
2484
+ int i;
2485
+ for(i=1;i<=n;i++)
2486
+ {
2487
+ rez=rez+list( binomial(n+1, i) );
2488
+ }
2489
+ return(rez);
2490
+ }
2491
+ }
2492
+ example
2493
+ {
2494
+ "EXAMPLE:";echo =2;
2495
+ ring r=0, (t), dp;
2496
+ // the coefficients of the total Chern class of the complex projective line
2497
+ print( cProj(1) );
2498
+
2499
+ // the coefficients of the total Chern class of the complex projective plane
2500
+ print( cProj(2) );
2501
+
2502
+ // the coefficients of the total Chern class of the complex projective space
2503
+ // of dimension three
2504
+ print( cProj(3) );
2505
+ }
2506
+ //------------------------------------------------------------------------------------------
2507
+
2508
+ proc chProj(int n)
2509
+ "USAGE: chProj(n); n integer
2510
+ RETURN: list of (rational) numbers
2511
+ PURPOSE: computes the terms of the Chern character of the tangent bundle
2512
+ on the complex projective space
2513
+ EXAMPLE: example chProj; shows an example
2514
+ NOTE:
2515
+ "
2516
+ {
2517
+ if(n<0)
2518
+ {
2519
+ print("The dimension of the projective space must be non-negative!");
2520
+ return( list() ); // return the empty list in this case
2521
+ }
2522
+ else
2523
+ {
2524
+ list rez=list(number(n));
2525
+ int i;
2526
+ for(i=1;i<=n;i++)
2527
+ {
2528
+ rez=rez+list( (n+1)/factorial(i) );
2529
+ }
2530
+ return(rez);
2531
+ }
2532
+ }
2533
+ example
2534
+ {
2535
+ "EXAMPLE:";echo =2;
2536
+ ring r=0, (t), dp;
2537
+ // the coefficients of the Chern character of the complex projective line
2538
+ print( chProj(1) );
2539
+
2540
+ // the coefficients of the Chern character of the complex projective plane
2541
+ print( chProj(2) );
2542
+
2543
+ // the coefficients of the Chern character of the complex 3-dimensional projective space
2544
+ print( chProj(3) );
2545
+ }
2546
+ //------------------------------------------------------------------------------------------
2547
+
2548
+ proc tdProj(int n)
2549
+ "USAGE: tdProj(n); n integer
2550
+ RETURN: list of (rational) numbers
2551
+ PURPOSE: computes the terms of the Todd class
2552
+ of the (tangent bundle of the) complex projective space
2553
+ EXAMPLE: example tdProj; shows an example
2554
+ NOTE:
2555
+ "
2556
+ {
2557
+ if(n<0)
2558
+ {
2559
+ print("The dimension of the projective space must be non-negative!");
2560
+ return( list() ); // return the empty list in this case
2561
+ }
2562
+ else
2563
+ {
2564
+ def br@=basering; // remember the base ring
2565
+ ring r@= 0, t@, lp; // ring with one variable t@
2566
+ ideal T=std( t@^(n+1) );
2567
+ poly f= tdFactor(n, t@);
2568
+ f=reduce( f^(n+1), T);
2569
+ matrix C = coeffs(f, t@);
2570
+ list rez;
2571
+ int i;
2572
+ for(i=0;i<=n;i++)
2573
+ {
2574
+ rez=rez+list(C[i+1, 1]);
2575
+ }
2576
+ setring br@; // come back to the initial base ring
2577
+ map FF= r@, 0 ; // define the specialization homomorphism t@=0
2578
+ return(FF(rez)); // bring the result to the base ring
2579
+ }
2580
+ }
2581
+ example
2582
+ {
2583
+ "EXAMPLE:";echo =2;
2584
+ ring r=0, (t), dp;
2585
+
2586
+ // the coefficients of the Todd class of the complex projective line
2587
+ print( tdProj(1) );
2588
+
2589
+ // the coefficients of the Todd class of the complex projective line
2590
+ print( tdProj(2) );
2591
+
2592
+ // the coefficients of the Todd class of the complex projective line
2593
+ print( tdProj(3) );
2594
+ }
2595
+ //------------------------------------------------------------------------------------------
2596
+
2597
+ proc eulerChProj(int n, def r, list c)
2598
+ "USAGE: eulerChProj(n, r, c); n integer, r polynomial (or integer), c list of polynomials
2599
+ RETURN: polynomial
2600
+ PURPOSE: computes the Euler characteristic of a vector bundle on P_n
2601
+ in terms of its rank and Chern classes
2602
+ EXAMPLE: example eulerChProj; shows an example
2603
+ NOTE:
2604
+ "
2605
+ {
2606
+ if(n<0)
2607
+ {
2608
+ print("The dimension of the projective space must be non-negative!");
2609
+ return(0); // return zero in this case
2610
+ }
2611
+ else
2612
+ {
2613
+ if(n==0)
2614
+ {
2615
+ return(r);
2616
+ }
2617
+ // now n is at least 1
2618
+ c=append_by_zeroes(n, c); // append c by zeroes if its size is smaller than n
2619
+ c=c[1..n]; // throw away the redundant data
2620
+ // now the size of c is n
2621
+ list td = tdProj(n); // terms of the Todd class of P_n
2622
+ list ch = list(r) + chAll(c); // terms of the Chern character of the vector bundle
2623
+ return( rHRR(n, ch, td) );
2624
+ }
2625
+ }
2626
+ example
2627
+ {
2628
+ "EXAMPLE:";echo =2;
2629
+ ring h=0, (r, c(1..3)), ws(0,1,2,3);
2630
+ list l=c(1..3);
2631
+ // the Euler characteristic of a vector bundle on the projective line
2632
+ print( eulerChProj(1, r, l) );
2633
+
2634
+ // the Euler characteristic of a vector bundle on the projective plane
2635
+ print( eulerChProj(2, r, l) );
2636
+
2637
+ // the Euler characteristic of a vector bundle on P_3
2638
+ print( eulerChProj(3, r, l) );
2639
+
2640
+ // assume now that we have a bundle framed at a subplane of P_3
2641
+ // this implies c(1)=c(2)=0
2642
+ l= 0, 0, c(3);
2643
+
2644
+ // the Euler characteristic is
2645
+ print( eulerChProj(3, r, l) );
2646
+ // which implies that c(3) must be even in this case
2647
+ }
2648
+ //-------------------------------------------------------
2649
+
2650
+ proc chNumbersProj(int n)
2651
+ "USAGE: chNumbersProj(n); n integer
2652
+ RETURN: list of integers
2653
+ PURPOSE: computes the Chern numbers of the projective space P_n
2654
+ EXAMPLE: example chNumbersProj; shows an example
2655
+ NOTE:
2656
+ "
2657
+ {
2658
+ return( chNumbers( n, cProj(n) ) );
2659
+ }
2660
+ example
2661
+ {
2662
+ "EXAMPLE:";echo =2;
2663
+ ring h=0, (t), dp;
2664
+ // The Chern numbers of the projective plane P_2:
2665
+ print( chNumbersProj(2) );
2666
+
2667
+ // The Chern numbers of P_3:
2668
+ print( chNumbersProj(3) );
2669
+ }
2670
+ //-------------------------------------------------------
2671
+
2672
+ proc classpoly(list l, poly t)
2673
+ "USAGE: classpoly(l, t); l list of polynomials, t polynomial
2674
+ RETURN: polynomial
2675
+ PURPOSE: computes the polynomial in t with coefficients being the entries of l
2676
+ EXAMPLE: example classpoly; shows an example
2677
+ NOTE:
2678
+ "
2679
+ {
2680
+ int n=size(l);
2681
+ poly pow=1; // powers of t will be compured here
2682
+ poly rez=0; // result will be computed here
2683
+ int i;
2684
+ for(i=1; i<=n; i++)
2685
+ {
2686
+ pow=pow*t; // compute the required power of t
2687
+ // add the i-th entry of l multiplied by the corresponding power of t to the result
2688
+ rez=rez + l[i]*pow;
2689
+ }
2690
+ return( rez );
2691
+ }
2692
+ example
2693
+ {
2694
+ "EXAMPLE:";echo=2;
2695
+ ring r=0, (c(1..5), t), ds;
2696
+ list l=c(1..5);
2697
+ // get the polynomial c(1)*t + c(2)*t^2 + ... + c(5)*t^5
2698
+ print( classpoly(l, t) );
2699
+ }
2700
+ //----------------------------------------------------------------------------------------
2701
+
2702
+ proc chernPoly(list c, poly t)
2703
+ "USAGE: chernPoly(c, t); c list of polynomials, t polynomial
2704
+ RETURN: polynomial
2705
+ PURPOSE: computes the Chern polynomial in t
2706
+ EXAMPLE: example chernPoly; shows an example
2707
+ NOTE: does the same as toddPoly(...)
2708
+ "
2709
+ {
2710
+ return( 1+classpoly(c, t) );
2711
+ }
2712
+ example
2713
+ {
2714
+ "EXAMPLE:";echo=2;
2715
+ ring r=0, (c(1..5), t), ds;
2716
+ list l=c(1..5);
2717
+ // get the Chern polynomial 1 + c(1)*t + c(2)*t^2 + ... + c(5)*t^5
2718
+ print( chernPoly(l, t) );
2719
+ }
2720
+ //----------------------------------------------------------------------------------------
2721
+
2722
+ proc chernCharPoly(poly r, list ch, poly t)
2723
+ "USAGE: chernCharPoly(r, ch, t); r polynomial, ch list of polynomials, t polynomial
2724
+ RETURN: polynomial
2725
+ PURPOSE: computes the polynomial in t corresponding to the Chern character
2726
+ EXAMPLE: example chernpoly; shows an example
2727
+ NOTE:
2728
+ "
2729
+ {
2730
+ return( r+classpoly(ch, t) );
2731
+ }
2732
+ example
2733
+ {
2734
+ "EXAMPLE:";echo=2;
2735
+ ring h=0, (r, ch(1..5), t), ds;
2736
+ list l=ch(1..5);
2737
+ // get the polynomial r + ch(1)*t + ch(2)*t^2 + ... + ch(5)*t^5
2738
+ print( chernCharPoly(r, l, t) );
2739
+ }
2740
+ //----------------------------------------------------------------------------------------
2741
+
2742
+ proc toddPoly(list td, poly t)
2743
+ "USAGE: toddPoly(td, t); td list of polynomials, t polynomial
2744
+ RETURN: polynomial
2745
+ PURPOSE: computes the polynomial in t corresponding to the Todd class
2746
+ EXAMPLE: example toddPoly; shows an example
2747
+ NOTE: does the same as chernPoly(...)
2748
+ "
2749
+ {
2750
+ return( 1+classpoly(td, t) );
2751
+ }
2752
+ example
2753
+ {
2754
+ "EXAMPLE:"; echo=2;
2755
+ ring r=0, (td(1..5), c(1..5), t), ds;
2756
+ list l=td(1..5);
2757
+ // get the polynomial 1 + td(1)*t + td(2)*t^2 + ... + td(5)*t^5
2758
+ print( toddPoly(l, t) );
2759
+ }
2760
+ //---------------------------------------------------------------------------------------
2761
+
2762
+ proc rHRR(int N, list ch, list td)
2763
+ "USAGE: rHRR( N, ch, td); N integer, ch, td lists of polynomials
2764
+ RETURN: polynomial
2765
+ PURPOSE: computes the the main ingredient of the right-hand side
2766
+ of the Hirzebruch-Riemann-Roch formula
2767
+ EXAMPLE: example rHRR; shows an example
2768
+ NOTE: in order to get the right-hand side of the HRR formula
2769
+ one needs to be able to compute the degree of the output of this procedure
2770
+ "
2771
+ {
2772
+ poly rez; // to be the result
2773
+ int i;
2774
+ int nch=size(ch); // length of ch
2775
+ int ntd=size(td); // length of td
2776
+ for(i=1; i<=N+1; i++) // compute the highest degree term of ch.td
2777
+ {
2778
+ if( (i<=nch) && (N-i+2 <= ntd) )
2779
+ {
2780
+ rez = rez + ch[i]*td[N-i+2];
2781
+ }
2782
+ }
2783
+ return(rez);
2784
+ }
2785
+ example
2786
+ {
2787
+ "EXAMPLE:"; echo=2;
2788
+ ring r=0, (td(0..3), ch(0..3)), dp;
2789
+ // Let ch(0), ch(1), ch(2), ch(3) be the terms of the Chern character
2790
+ // of a vector bundle E on a 3-fold X.
2791
+ list c = ch(0..3);
2792
+ // Let td(0), td(1), td(2), td(3) be the terms of the Todd class of X.
2793
+ list t = td(0..3);
2794
+ // Then the highest term of the product ch(E).td(X) is:
2795
+ print( rHRR(3, c, t) );
2796
+ }
2797
+ //---------------------------------------------------------------------------------------
2798
+
2799
+ proc SchurS(list I, list S)
2800
+ "USAGE: SchurS(I, S); I list of integers representing a partition, S list of polynomials
2801
+ RETURN: poly
2802
+ PURPOSE: computes the Schur polynomial in the Segre classes S (of the dual vector bundle),
2803
+ i.e., in the complete homogeneous symmetric polynomials, with respect to the partition I
2804
+ EXAMPLE: example SchurS; shows an example
2805
+ NOTE: if S are the Segre classes of the tautological bundle on a grassmanian,
2806
+ this gives the cohomology class of a Schubert cycle
2807
+ "
2808
+ {
2809
+ int m=size(I); // size of I
2810
+ S=list(1)+S; // add the zeroth Segre class
2811
+ int szS=size(S); // size of S
2812
+ int h,k;
2813
+ int in; // variable for the index of the required Segre class
2814
+ // construct the required m x m matrix from the first determinantal (Jacobi-Trudi) formula
2815
+ matrix M[m][m];
2816
+ for(h=1;h<=m;h++)
2817
+ {
2818
+ for(k=1;k<=m;k++)
2819
+ {
2820
+ in=I[k]+k-h; // compute the index
2821
+ if(in<0) // if it is negative, assume the corresponding Segre class to be zero
2822
+ {
2823
+ M[h,k]=0;
2824
+ }
2825
+ else
2826
+ {
2827
+ if(in>=szS) // if it is bigger than the number of the highest available Segre class in S
2828
+ {
2829
+ M[h, k]=0; // assume the corresponding Segre class is zero
2830
+ }
2831
+ else // otherwise
2832
+ {
2833
+ M[h, k]= S[in+1]; // use a value from S for the corresponding Segre class
2834
+ }
2835
+ }
2836
+ }
2837
+ }
2838
+ return(det(M)); // return the determinant of the computed matrix
2839
+ }
2840
+ example
2841
+ {
2842
+ "EXAMPLE:"; echo=2;
2843
+ // The Schur polynomial corresponding to the partition 1,2,4
2844
+ // and the Segre classes 1, s(1), s(2),..., s(6)
2845
+ ring r=0,(s(1..6)), dp;
2846
+ list I=1,2,4;
2847
+ list S=s(1..6);
2848
+ print( SchurS(I, S) );
2849
+ // compare this with the Schur polynomial computed using Chern classes
2850
+ list C=chDual(chern(S));
2851
+ print( SchurCh(I, C) );
2852
+ }
2853
+ //---------------------------------------------------------------------------------------
2854
+
2855
+ proc SchurCh(list I, list C)
2856
+ "USAGE: SchurCh(I, C); I list of integers representing a partition, C list of polynomials
2857
+ RETURN: poly
2858
+ PURPOSE: computes the Schur polynomial in the Chern classes C,
2859
+ i.e., in the elementary symmetric polynomials, with respect to the partition I
2860
+ EXAMPLE: example SchurCh; shows an example
2861
+ NOTE: if C are the Chern classes of the tautological bundle on a grassmanian,
2862
+ this gives the cohomology class of a Schubert cycle
2863
+ "
2864
+ {
2865
+ I=dualPart(I); // dual partition to I
2866
+ int m=size(I); // size of I
2867
+ C=list(1)+C; // add the zeroth Chern class
2868
+ int szC=size(C); // size of C
2869
+ int h,k;
2870
+ int in; // variable for the index of the required Chern class
2871
+ // construct the required m x m matrix from the second determinantal (Jacobi-Trudi) formula
2872
+ matrix M[m][m];
2873
+ for(h=1;h<=m;h++)
2874
+ {
2875
+ for(k=1;k<=m;k++)
2876
+ {
2877
+ in=I[k]+k-h; // compute the index
2878
+ if(in<0) // if it is negative, assume the corresponding Chern class to be zero
2879
+ {
2880
+ M[h,k]=0;
2881
+ }
2882
+ else
2883
+ {
2884
+ if(in>=szC) // if it is bigger than the number of the highest available Chern class in C
2885
+ {
2886
+ M[h, k]=0; // assume the corresponding Chern class is zero
2887
+ }
2888
+ else // otherwise
2889
+ {
2890
+ M[h, k]= C[in+1]; // use a value from C for the corresponding Chern class
2891
+ }
2892
+ }
2893
+ }
2894
+ }
2895
+ return(det(M)); // return the determinant of the computed matrix
2896
+ }
2897
+ example
2898
+ {
2899
+ "EXAMPLE:"; echo=2;
2900
+ // The Schur polynomial corresponding to the partition 1,2,4
2901
+ // and the Chern classes c(1), c(2), c(3)
2902
+ ring r=0,(c(1..3)), dp;
2903
+ list I=1,2,4;
2904
+ list C=c(1..3);
2905
+ print( SchurCh(I, C) );
2906
+ // Compare this with the Schur polynomial computed using Segre classes
2907
+ list S=segre( chDual( list(c(1..3)) ), 6 );
2908
+ print(SchurS(I,S));
2909
+ }
2910
+ //---------------------------------------------------------------------------------------
2911
+
2912
+ proc part(int m, int n)
2913
+ "USAGE: part( m, n ); m positive integer, n non-negative integer
2914
+ RETURN: list of lists
2915
+ PURPOSE: computes all partitions of integers not exceeding n into m non-negative summands
2916
+ EXAMPLE: example part; shows an example
2917
+ NOTE: if n is negative or m is non-positive, the list with one empty entry is returned
2918
+ "
2919
+ {
2920
+ if( n<0 ) // if n is negative
2921
+ {
2922
+ return(list(list())); // return the list with one empty entry
2923
+ }
2924
+ if(n==0) // if n equals 0, there is only one partition of 0 into m non-negative summands
2925
+ {
2926
+ return(list(listSame(0,m))); // return the list with one entry consistion of m zeroes
2927
+ }
2928
+ // otherwise proceed recursively
2929
+ list rez=part(m, n-1); // get all partitions for n-1
2930
+ int i;
2931
+ for(i=1;i<=m;i++) // for every i between 1 and m, add the partitions with exactly
2932
+ {
2933
+ rez=rez + appendToAll( part(m-i, n-1), listSame(n, i) ); // i summands equal to n
2934
+ }
2935
+ return(rez); // return the result
2936
+ }
2937
+ example
2938
+ {
2939
+ "EXAMPLE:"; echo=2;
2940
+ // partitions into 3 summands of numbers not exceeding 1
2941
+ print( part(3, 1) );
2942
+ }
2943
+ //---------------------------------------------------------------------------------------
2944
+
2945
+ proc dualPart(list I, list #)
2946
+ "USAGE: dualPart( I [,N] ); I list of integers, N integer
2947
+ RETURN: list of integers
2948
+ PURPOSE: computes the partition dual (conjugate) to I
2949
+ EXAMPLE: example dualPart; shows an example
2950
+ NOTE: the result is extended by zeroes to length N if an optional integer
2951
+ parameter N is given and the length of the computed dual partition
2952
+ is smaller than N
2953
+ "
2954
+ {
2955
+ int m= size(I); // size of I
2956
+ if(m==0) // if I is the empty list
2957
+ {
2958
+ print("You are trying to compute the dual of the empty partition!");
2959
+ print("The partition with one zero is returned.");
2960
+ return(list(0));
2961
+ }
2962
+ // compute the dual partition
2963
+ list J; // the result will be computed here
2964
+ int i;
2965
+ int j=I[1];
2966
+ int k;
2967
+ for(k=1;k<=j;k++)
2968
+ {
2969
+ J=list(m)+J;
2970
+ }
2971
+ for(i=2;i<=m;i++)
2972
+ {
2973
+ j=I[i]-I[i-1];
2974
+ for(k=1;k<=j;k++)
2975
+ {
2976
+ J=list(m-i+1)+J;
2977
+ }
2978
+ }
2979
+ if(size(J)==0) // if the dual partition J is empty (if I consists of zeroes)
2980
+ {
2981
+ J = list(0); // add zero to the result
2982
+ }
2983
+ if(size(#)>0) // if there is an optional parameter N
2984
+ {
2985
+ if( is_integer( #[1] ) ) // if the parameter is an integer,
2986
+ {
2987
+ if( size(J) < #[1] ) // if N is bigger than the length of J,
2988
+ {
2989
+ J=listSame(0, #[1]-size(J))+J; // extend J by zeroes to length N
2990
+ }
2991
+ }
2992
+ }
2993
+ return(J); // return the result
2994
+ }
2995
+ example
2996
+ {
2997
+ "EXAMPLE:"; echo =2;
2998
+ // dual partition to (1, 3, 4):
2999
+ list I = 1, 3, 4;
3000
+ print( dualPart(I) );
3001
+ }
3002
+ //---------------------------------------------------------------------------------------
3003
+
3004
+ proc PartC(list I, int m)
3005
+ "USAGE: PartC( I, m); I list of integers, m integer
3006
+ RETURN: list of integers
3007
+ PURPOSE: computes the complement of a partition with respect to m
3008
+ EXAMPLE: example PartC; shows an example
3009
+ NOTE: returns the zero partition if the maximal element of the partition is smaller than m
3010
+ "
3011
+ {
3012
+ int n=size(I); // size of I
3013
+ if( m<I[n] ) // if m is smaller than the last term of I,
3014
+ {
3015
+ // give a warning
3016
+ print("You are trying to compute a complement of a partition with respect");
3017
+ print("to a number that is smaller than the maximal summand of the partition!");
3018
+ print("The zero partition is returned.");
3019
+ return(list(0)); // and return the zero partition
3020
+ }
3021
+ list J; // the result will be computed here
3022
+ int i;
3023
+ for(i=n;i>=1;i--) // invert the order of numbers
3024
+ {
3025
+ J=J+list(m-I[i]); // and substitute them by their complemenst to m
3026
+ }
3027
+ return(J); // return the result
3028
+ }
3029
+ example
3030
+ {
3031
+ "EXAMPLE:"; echo =2;
3032
+ // Complement of the partition (1, 3, 4) with respect to 5
3033
+ list I = 1, 3, 4;
3034
+ print( PartC(I, 5) );
3035
+ }
3036
+ //---------------------------------------------------------------------------------------
3037
+
3038
+ proc partOver(int n, list J)
3039
+ "USAGE: partOver( n, J); n integer, J list of integers (partition)
3040
+ RETURN: list of lists
3041
+ PURPOSE: computes the partitions over a given one with summands not exceeding n
3042
+ EXAMPLE: example partOver; shows an example
3043
+ NOTE:
3044
+ "
3045
+ {
3046
+ int m=size(J); // size of J
3047
+ if( m==0 ) // if J is an empty list
3048
+ {
3049
+ // give a warning
3050
+ print("You are trying to compute partitions over an empty partition!");
3051
+ return( list() ); // and return the empty list
3052
+ }
3053
+ if( J[m] > n ) // if the biggest summand of the partition is bigger than n
3054
+ {
3055
+ return( list( ) ); // return the empty list
3056
+ }
3057
+ if( J[m] == 0 ) // if J consists of zeroes
3058
+ {
3059
+ return( part(m,n) ); // return all partitions of n into m summands
3060
+ }
3061
+ // now J is non-empty, contains con-zero summands, has partitions over it
3062
+ list rez1; // the result will be computed here
3063
+ int i,j;
3064
+ if(m==1) // if J has only one element
3065
+ {
3066
+ for(j=J[1]; j<=n; j++) // run through the integers from J[1] to n
3067
+ {
3068
+ rez1=rez1 + list(j); // add the corresponding one element lists to the result
3069
+ }
3070
+ return(rez1); // return the result
3071
+ }
3072
+ // now J has at least two elements
3073
+ // get the partitions over the partition without the last summand
3074
+ list rez = partOver(n, delete(J, m));
3075
+ int sz=size(rez); // number of such partitions
3076
+ list P;
3077
+ int last;
3078
+ for(i=1; i<=sz; i++) // run trough all such partitions
3079
+ {
3080
+ P=rez[i]; // for each partition P of this type
3081
+ last = max( P[size(P)], J[m] );
3082
+ for(j = last;j<= n;j++) // run through the integers exceeding the last summands of P and J
3083
+ {
3084
+ // append them to P at the end and add the resulting partition to the result
3085
+ rez1=rez1 + list(P+list(j));
3086
+ }
3087
+ }
3088
+ return(rez1); // return the result
3089
+ }
3090
+ example
3091
+ {
3092
+ "EXAMPLE:"; echo =2;
3093
+ // Partitions over the partition (3, 3, 4) with summands not exceeding 4
3094
+ list I = 3, 3, 4;
3095
+ print( partOver(4, I) );
3096
+ }
3097
+ //---------------------------------------------------------------------------------------
3098
+
3099
+ proc partUnder(list J)
3100
+ "USAGE: partUnder(J); J list of integers (partition)
3101
+ RETURN: list of lists
3102
+ PURPOSE: computes the partitions under a given one
3103
+ EXAMPLE: example partUnder; shows an example
3104
+ NOTE:
3105
+ "
3106
+ {
3107
+ int m=size(J); // size of J
3108
+ if(m==0) // if J is empty
3109
+ {
3110
+ return(list()); // return an empty list
3111
+ }
3112
+ list rez1; // the result will be computed here
3113
+ int i;
3114
+ if(m==1) // if J contains only one element
3115
+ {
3116
+ for(i=0; i<=J[1]; i++)
3117
+ {
3118
+ rez1=rez1+list(list(i));
3119
+ }
3120
+ }
3121
+ // now J contains at least two elements
3122
+ list rez;
3123
+ int Jlast=J[m]; // last element of J
3124
+ rez = partUnder(delete(J, m)); // partitions under J without the last element
3125
+ int j;
3126
+ int sz=size(rez); // their number
3127
+ list P;
3128
+ int last;
3129
+ for(i=1; i<=sz; i++) // for every such partition
3130
+ {
3131
+ P = rez[i];
3132
+ last = P[size(P)];
3133
+ for(j = last;j<=Jlast ;j++) // for every number between its last entry and the last entry of J
3134
+ {
3135
+ // append that number to the end of the partition
3136
+ // and append the resulting partition to the final result
3137
+ rez1 = rez1 + list(P+list(j));
3138
+ }
3139
+ }
3140
+ return(rez1);
3141
+ }
3142
+ example
3143
+ {
3144
+ "EXAMPLE:"; echo =2;
3145
+ // Partitions under the partition (0, 1, 1)
3146
+ list I = 0, 1, 1;
3147
+ print( partUnder(I) );
3148
+ }
3149
+ //-------------------------------------------------------------------------------------------
3150
+
3151
+ proc SegreA(ideal I)
3152
+ "USAGE: SegreA(I); I an ideal
3153
+ RETURN: list of integers
3154
+ PURPOSE: computes the Segre classes of the subscheme defined by I
3155
+ EXAMPLE: example SegreA; shows an example
3156
+ NOTE:
3157
+ "
3158
+ {
3159
+ if( !homog(I) ) // if the ideal is not homogeneous
3160
+ {
3161
+ print("You are trying to compute the Segre class of a non-homogeneous ideal!");
3162
+ print("The ideal must be homogeneous, an empty list is returned.");
3163
+ return( list() );
3164
+ }
3165
+ // modify the generators of the ideal so that all of them are of the same degree
3166
+ I=equal_deg(I);
3167
+ int degGen=deg(I[1]); // this degree d is stored in this variable
3168
+ int i;
3169
+ list rez; // define the variable for the result
3170
+ int n=nvars(basering)-1; // the dimension of the projective space
3171
+ if(degGen==-1) // if the ideal is zero
3172
+ {
3173
+ for(i=0;i<=n;i++)
3174
+ {
3175
+ rez=rez+ list( int((-1)^i*binomial(n+i, i)) );
3176
+ }
3177
+ return(rez);
3178
+ }
3179
+ int sz=ncols(I); // the number of new generators is stored here
3180
+ def br@=basering; // remember the base ring
3181
+ // add additional variables t@(1), ... , t@(sz) and u@ to the base ring
3182
+ list l13 = ringlist(basering)[2];
3183
+ for (int ii = 1; ii <= sz; ii++)
3184
+ {
3185
+ l13[size(l13)+1] = "t@("+string(ii)+")";
3186
+ }
3187
+ l13[size(l13)+1] = "u@";
3188
+ ring r@ = create_ring(ring_list(basering)[1], l13, "dp", "no_minpoly");
3189
+ ideal I=fetch(br@,I); // the ideal generated by I in the new ring
3190
+ ideal J(0..n); // define n+1 ideals J(0), ... , J(n)
3191
+ // compute the ideal of the Rees algebra of the ideal I:
3192
+ for(i=1; i<=sz; i++) // consider the ideal generated by t@(i)-u@*I[i]
3193
+ {
3194
+ J(0)=J(0) + ideal( t@(i)-u@*I[i] );
3195
+ }
3196
+ J(0)=eliminate(J(0), u@); // and eliminate the variable u@
3197
+ ideal T=t@(1..sz); // define the ideal generated by the additional variables t@(1), ... , t@(sz)
3198
+ for(i=1;i<=n;i++)// for all i=1, ... n define J(j) as in 3.6 of the Aluffi's paper
3199
+ {
3200
+ // add a random general linear form in variables t@(1), ... , t@(n) to J(i-1)
3201
+ J(i)=sat( random_hypersurf(J(i-1), T) , T); // and saturate with respect to T
3202
+ }
3203
+ poly prd=product(T); // compute the product of t@(i)
3204
+ poly cl;
3205
+ poly mlt;
3206
+ for(i=0;i<=n;i++)
3207
+ {
3208
+ // eliminate all t@(i) from J(i)
3209
+ // compute the degree of the scheme defined by this ideal
3210
+ // and use it to compute the class corresponding to c(O(d))^n * G\otimes O(d)
3211
+ cl=cl+mult(std(eliminate(J(i), prd)))*u@^i*(1+degGen*u@)^(n-i);
3212
+ // the (n+1)-st power of the inverse of the Chern class of O(d)
3213
+ mlt=mlt+binomial(n+i, i)*(-degGen*u@)^i;
3214
+ }
3215
+ poly resPoly;
3216
+ // compute the Segre class by the Aluffi's formula from Proposition 3.1 as polynomial in u@
3217
+ resPoly= NF( 1-cl*mlt, u@^(n+1));
3218
+ matrix cf=coeffs(resPoly, u@); // coefficients of the Segre class
3219
+ rez=list(); // empty the list
3220
+ for(i=0;i<=n;i++) // fill the list with the the Segre classes in positive degrees
3221
+ {
3222
+ if( i < nrows(cf) ) // if i is not bigger than the maximal degree of non-zero Segre classes
3223
+ {
3224
+ rez=rez+list(int(cf[i+1,1]));
3225
+ }
3226
+ else // otherwise fill the list with zeroes
3227
+ {
3228
+ rez=rez+list( int(0) );
3229
+ }
3230
+ }
3231
+ return(rez);
3232
+ }
3233
+ example
3234
+ {
3235
+ "EXAMPLE:";echo =2;
3236
+ // Consider a 3-dimensional projective space
3237
+ ring r = 0, (x, y, z, w), dp;
3238
+ // Consider 3 non-coplanar lines trough one point and compute the Segre class
3239
+ ideal I=xy, xz, yz;
3240
+ I;
3241
+ SegreA(I);
3242
+ // Now consider 3 coplanar lines trough one point and its Segre class
3243
+ ideal J=w, x*y*(x+y);
3244
+ J;
3245
+ SegreA(J);
3246
+ }
3247
+ //-------------------------------------------------------------------------------------------
3248
+
3249
+ proc FultonA(ideal I)
3250
+ "USAGE: FultonA(I); I an ideal
3251
+ RETURN: list of integers
3252
+ PURPOSE: computes the Fulton classes of the subscheme defined by I
3253
+ EXAMPLE: example FultonA; shows an example
3254
+ NOTE:
3255
+ "
3256
+ {
3257
+ if( !homog(I) ) // if the ideal is not homogeneous
3258
+ {
3259
+ print("You are trying to compute the Segre class of a non-homogeneous ideal!");
3260
+ print("The ideal must be homogeneous, an empty list is returned.");
3261
+ return( list() );
3262
+ }
3263
+ // modify the generators of the ideal so that all of them are of the same degree
3264
+ I=equal_deg(I);
3265
+ int degGen=deg(I[1]); // this degree d is stored in this variable
3266
+ int i;
3267
+ list rez; // define the variable for the result
3268
+ int n=nvars(basering)-1; // the dimension of the projective space
3269
+ if(degGen==-1) // if the ideal is zero
3270
+ {
3271
+ rez=rez+list(int(1));
3272
+ for(i=1;i<=n;i++)
3273
+ {
3274
+ rez=rez+ list( int(0) );
3275
+ }
3276
+ return(rez);
3277
+ }
3278
+ int sz=ncols(I); // the number of new generators is stored here
3279
+ def br@=basering; // remember the base ring
3280
+ // add additional variables t@(1), ... , t@(sz) and u@ to the base ring
3281
+ list l14 = ringlist(basering)[2];
3282
+ for (int ii = 1; ii <= sz; ii++)
3283
+ {
3284
+ l14[size(l14)+1] = "t@("+string(ii)+")";
3285
+ }
3286
+ l14[size(l14)+1] = "u@";
3287
+ ring r@ = create_ring(ring_list(basering)[1], l14, "dp", "no_minpoly");
3288
+ ideal I=fetch(br@,I); // the ideal generated by I in the new ring
3289
+ ideal J(0..n); // define n+1 ideals J(0), ... , J(n)
3290
+ // compute the ideal of the Rees algebra of the ideal I:
3291
+ for(i=1; i<=sz; i++) // consider the ideal generated by t@(i)-u@*I[i]
3292
+ {
3293
+ J(0)=J(0) + ideal( t@(i)-u@*I[i] );
3294
+ }
3295
+ J(0)=eliminate(J(0), u@); // and eliminate the variable u@
3296
+ ideal T=t@(1..sz); // define the ideal generated by the additional variables t@(1), ... , t@(sz)
3297
+ for(i=1;i<=n;i++)// for all i=1, ... n define J(j) as in 3.6 of the Aluffi's paper
3298
+ {
3299
+ // add a random general linear form in variables t@(1), ... , t@(n) to J(i-1)
3300
+ J(i)=sat( random_hypersurf(J(i-1), T) , T); // and saturate with respect to T
3301
+ }
3302
+ poly prd=product(T); // compute the product of t@(i)
3303
+ poly cl;
3304
+ poly mlt;
3305
+ for(i=0;i<=n;i++)
3306
+ {
3307
+ // eliminate all t@(i) from J(i)
3308
+ // compute the degree of the scheme defined by this ideal
3309
+ // the class corresponding to c(O(d))^n * G\otimes O(d)
3310
+ cl=cl+ mult(std( eliminate( J(i), prd) ))*u@^i*(1+degGen*u@)^(n-i);
3311
+ // the (n+1)-st power of the inverse of the Chern class of O(d)
3312
+ mlt=mlt+binomial(n+i, i)*(-degGen*u@)^i;
3313
+ }
3314
+ poly resPoly;
3315
+ // compute the Fulton class using the Aluffi's formula for the Segre class and
3316
+ // multiplying it by the Chern class of the projective space (1+u@)^(n+1)
3317
+ resPoly= NF( (1+u@)^(n+1)*(1-cl*mlt), u@^(n+1) );
3318
+ matrix cf=coeffs(resPoly, u@); // coefficients of the Fulton class
3319
+ rez=list(); // empty the list
3320
+ for(i=0;i<=n;i++) // fill the list with the the Fulton classes in positive degrees
3321
+ {
3322
+ if( i < nrows(cf) ) // if i is not bigger than the maximal degree of non-zero Fulton classes
3323
+ {
3324
+ rez=rez+list(int(cf[i+1,1]));
3325
+ }
3326
+ else // otherwise fill the list with zeroes
3327
+ {
3328
+ rez=rez+list( int(0) );
3329
+ }
3330
+ }
3331
+ return(rez);
3332
+ }
3333
+ example
3334
+ {
3335
+ "EXAMPLE:";echo =2;
3336
+ // Consider a 3-dimensional projective space
3337
+ ring r = 0, (x, y, z, w), dp;
3338
+ // Consider 3 non-coplanar lines trough one point and compute the Fulton class
3339
+ ideal I=xy, xz, yz;
3340
+ I;
3341
+ FultonA(I);
3342
+ // Now consider 3 coplanar lines trough one point and its Fulton class
3343
+ ideal J=w, x*y*(x+y);
3344
+ J;
3345
+ FultonA(J);
3346
+ }
3347
+ //-------------------------------------------------------------------------------------------
3348
+
3349
+ proc CSMA(ideal I)
3350
+ "USAGE: CSMA(I); I an ideal
3351
+ RETURN: list of integers
3352
+ PURPOSE: computes the Chern-Schwartz-MacPherson classes of the variety defined by I
3353
+ EXAMPLE: example CSMA; shows an example
3354
+ NOTE:
3355
+ "
3356
+ {
3357
+ if( !homog(I) ) // if the ideal is not homogeneous
3358
+ {
3359
+ print("You are trying to compute the Chern-Schwartz-MacPherson class.");
3360
+ print("However the input ideal is not homogeneous!");
3361
+ print("The ideal must be homogeneous, an empty list is returned.");
3362
+ return( list() );
3363
+ }
3364
+ int sz=ncols(I);
3365
+ int i;
3366
+ int n=nvars(basering)-1;
3367
+ bigintmat REZ[1][n+1];
3368
+ int j;
3369
+ int szpr;
3370
+ list pr;
3371
+ int sgn=-1;
3372
+ for(i=1;i<=sz;i++)
3373
+ {
3374
+ sgn=-sgn;
3375
+ pr=prds(i,I);
3376
+ szpr=size(pr);
3377
+ for(j=1;j<=szpr;j++)
3378
+ {
3379
+ REZ=REZ+sgn*CSM_hypersurf(pr[j]);
3380
+ }
3381
+ }
3382
+ list rez;
3383
+ for(i=0;i<=n;i++)
3384
+ {
3385
+ rez=rez+list(REZ[1,i+1]);
3386
+ }
3387
+ return(rez);
3388
+ }
3389
+ example
3390
+ {
3391
+ "EXAMPLE:";echo =2;
3392
+ // consider the projective plane with homogeneous coordinates x, y, z
3393
+ ring r = 0, (x, y, z), dp;
3394
+ // the Chern-Schwartz-MacPherson class of a smooth cubic:
3395
+ ideal I=x3+y3+z3;
3396
+ I;
3397
+ CSMA(I);
3398
+ // the Chern-Schwartz-MacPherson class of singular cubic
3399
+ // that is a union of 3 non-collinear lines:
3400
+ ideal J=x*y*z;
3401
+ J;
3402
+ CSMA(J);
3403
+ // the Chern-Schwartz-MacPherson class of singular cubic
3404
+ // that is a union of 3 lines passing through one point
3405
+ ideal K=x*y*(x+y);
3406
+ K;
3407
+ CSMA(K);
3408
+ }
3409
+ //-------------------------------------------------------------------------------------------
3410
+
3411
+ proc EulerAff(ideal I)
3412
+ "USAGE: EulerAff(I); I an ideal
3413
+ RETURN: integer
3414
+ PURPOSE: computes the Euler characteristic of the affine variety defined by I
3415
+ EXAMPLE: example EulerAff; shows an example
3416
+ NOTE:
3417
+ "
3418
+ {
3419
+ int n=nvars(basering);
3420
+ def br@=basering; // remember the base ring
3421
+ ring r@ = create_ring(ring_list(basering)[1],"("+varstr(basering)+",homvar@)","dp","no_minpoly");
3422
+ ideal I=fetch(br@,I);
3423
+ ideal J=homog(I, homvar@);
3424
+ ideal JJ=J, homvar@;
3425
+ return( CSMA(J)[n+1]-CSMA(JJ)[n+1] );
3426
+ }
3427
+ example
3428
+ {
3429
+ "EXAMPLE:";echo =2;
3430
+ ring r = 0, (x, y), dp;
3431
+ // compute the Euler characteristic of the affine elliptic curve y^2=x^3+x+1;
3432
+ ideal I=y2-x3-x-1;
3433
+ EulerAff(I);
3434
+ }
3435
+ //-------------------------------------------------------------------------------------------
3436
+
3437
+ proc EulerProj(ideal I)
3438
+ "USAGE: EulerProj(I); I an ideal
3439
+ RETURN: integer
3440
+ PURPOSE: computes the highest degree term of the Chern-Schwartz-MacPherson class
3441
+ of the variety defined by I, which equals the Euler characteristic
3442
+ EXAMPLE: example EulerProj; shows an example
3443
+ NOTE: uses CSMA(...)
3444
+ "
3445
+ {
3446
+ if( !homog(I) ) // if the ideal is not homogeneous
3447
+ {
3448
+ print("The ideal must be homogeneous, zero is returned.");
3449
+ return( int(0) );
3450
+ }
3451
+ int n=nvars(basering);
3452
+ return( CSMA(I)[n] );
3453
+ }
3454
+ example
3455
+ {
3456
+ "EXAMPLE:";echo =2;
3457
+ // consider the projective plane with homogeneous coordinates x, y, z
3458
+ ring r = 0, (x, y, z), dp;
3459
+ // Euler characteristic of a smooth cubic:
3460
+ ideal I=x3+y3+z3;
3461
+ I;
3462
+ EulerProj(I);
3463
+ // Euler characteristic of 3 non-collinear lines:
3464
+ ideal J=x*y*z;
3465
+ J;
3466
+ EulerProj(J);
3467
+ // Euler characteristic of 3 lines passing through one point
3468
+ ideal K=x*y*(x+y);
3469
+ K;
3470
+ EulerProj(K);
3471
+ }
3472
+ //----------------------------------------------------------------------------------------
3473
+ // The procedures below are for the internal usage only
3474
+ //----------------------------------------------------------------------------------------
3475
+
3476
+ static proc append_by_zeroes(int N, list c)
3477
+ "USAGE: append_by_zeroes( N, c); N integer, c a list
3478
+ RETURN: list
3479
+ PURPOSE: appends by zeroes up to the length N
3480
+ EXAMPLE: example append_by_zeroes; shows an example
3481
+ NOTE:
3482
+ "
3483
+ {
3484
+ int n=size(c);
3485
+ if(N>n) // if N is greater than the length of c, append c by zeroes up to the length N
3486
+ {
3487
+ int i;
3488
+ for(i=n+1;i<=N;i++)
3489
+ {
3490
+ c=c+list( poly(0) );
3491
+ }
3492
+ }
3493
+ return(c);
3494
+ }
3495
+ example
3496
+ {
3497
+ "EXAMPLE:";echo =2;
3498
+ ring r = 0, (x, y, z), dp;
3499
+ list l=(x, y, z);
3500
+ //append the list by two zeroes and get a list of length 5
3501
+ print( append_by_zeroes(5, l) );
3502
+ }
3503
+ //-----------------------------------------------------------------------
3504
+
3505
+ static proc is_integer(def r)
3506
+ "USAGE: is_integer(r); r any type
3507
+ RETURN: 1 or 0
3508
+ PURPOSE: checks whether r is of type int or bigint
3509
+ EXAMPLE: example is_integer; shows an example
3510
+ NOTE: returns 1 if r is of type int or bigint, otherwise returns 0
3511
+ "
3512
+ {
3513
+ if( (typeof(r)=="int") || (typeof(r)=="bigint") )
3514
+ {
3515
+ return(1);
3516
+ }
3517
+ else
3518
+ {
3519
+ return(0);
3520
+ }
3521
+ }
3522
+ example
3523
+ {
3524
+ "EXAMPLE:";echo =2;
3525
+ // test on int, bigint, poly
3526
+ ring r;
3527
+ int i=12;
3528
+ bigint j=16;
3529
+ poly f=x;
3530
+ print( is_integer(i) );
3531
+ print( is_integer(j) );
3532
+ print( is_integer(f) );
3533
+ }
3534
+ //------------------------------------------------------------------------------------
3535
+
3536
+ static proc integer_list(list l)
3537
+ "USAGE: integer_list(l); l list
3538
+ RETURN: list
3539
+ PURPOSE: gets the first positive ingerer entries of l, computes their maximum;
3540
+ used for adjusting the lists of optional parameters that are supposed to be integers
3541
+ EXAMPLE: example integer_list; shows an example
3542
+ NOTE: used in chWedge(...) and chSymm(...)
3543
+ "
3544
+ {
3545
+ int M=0;
3546
+ int n=size(l);
3547
+ if(n==0)
3548
+ {
3549
+ return(list(l, M));
3550
+ }
3551
+ // now n>0
3552
+ list rez; // the result will be computed here
3553
+ int i=1;
3554
+ while( is_integer( l[i] ) ) // take only the first integer entries of l
3555
+ {
3556
+ if(l[i]>0) // if they are positive
3557
+ {
3558
+ rez=rez+list( l[i] );
3559
+ if(l[i]>M) // adjust the maximum if necessary
3560
+ {
3561
+ M=l[i];
3562
+ }
3563
+ i++;
3564
+ }
3565
+ else // otherwise get out from the loop
3566
+ {
3567
+ break;
3568
+ }
3569
+ }
3570
+ return( list( rez, M) );
3571
+ }
3572
+ example
3573
+ {
3574
+ "EXAMPLE:";echo =2;
3575
+ // the first integer entries of 1,2,3,t are 1,2,3
3576
+ ring r=0,(t), ls;
3577
+ list l=1,2,3, t;
3578
+ print( integer_list(l) );
3579
+ }
3580
+ //---------------------------------------------------------------------------------------
3581
+
3582
+ static proc appendToAll(list L, list A)
3583
+ "USAGE: appendToAll( L, A ); L list of lists, A list
3584
+ RETURN: list
3585
+ PURPOSE: appends A to every entry of L
3586
+ EXAMPLE: example appendToAll; shows an example
3587
+ NOTE:
3588
+ "
3589
+ {
3590
+ int n=size(L);
3591
+ int i;
3592
+ for(i=1;i<=n;i++) // run through all elements of L
3593
+ {
3594
+ L[i]=L[i]+A; // and append A to each of them
3595
+ }
3596
+ return(L);
3597
+ }
3598
+ example
3599
+ {
3600
+ "EXAMPLE:"; echo=2;
3601
+ // Consider two lists
3602
+ list l1, l2;
3603
+ l1=1,2;
3604
+ l2=3,4;
3605
+ // The first one is
3606
+ print(l1);
3607
+ // The second one is
3608
+ print(l2);
3609
+ // Now consider the list with entries l1 and l2
3610
+ list L= l1, l2;
3611
+ print(L);
3612
+ // and consider a list A
3613
+ list A = 7,9;
3614
+ print(A);
3615
+ // append A to all entries of L
3616
+ print( appendToAll(L, A) );
3617
+ }
3618
+ //---------------------------------------------------------------------------------------
3619
+
3620
+ static proc listSame(int n, int k)
3621
+ "USAGE: listSame( n, k ); n integer, k non-negative integer
3622
+ RETURN: list
3623
+ PURPOSE: list with k entries each equal to n
3624
+ EXAMPLE: example listSame; shows an example
3625
+ NOTE: if k is negative or zero, the empty list is returned
3626
+ "
3627
+ {
3628
+ list rez;
3629
+ int i;
3630
+ for(i=1;i<=k;i++) // create a list with k entries, each equal to n
3631
+ {
3632
+ rez=rez+list(n);
3633
+ }
3634
+ return(rez);
3635
+ }
3636
+ example
3637
+ {
3638
+ "EXAMPLE:"; echo=2;
3639
+ // list of 5 zeroes
3640
+ print( listSame(0, 5) );
3641
+ }
3642
+ //---------------------------------------------------------------------------------------
3643
+
3644
+ static proc IJcoef(list I, list J)
3645
+ "USAGE: IJcoef( I, J); J, J lists of integers
3646
+ RETURN: bigint
3647
+ PURPOSE: computes the coefficient used in the formula of Lascoux
3648
+ EXAMPLE: example IJcoef; shows an example
3649
+ NOTE: these coefficients are denoted (I, J) in the paper of Lascoux
3650
+ "
3651
+ {
3652
+ int m = size(I);
3653
+ if(m != size(J)) // if the sizes of I and J are different
3654
+ {
3655
+ // give a warning
3656
+ print("The sizes of the partitions are different!");
3657
+ print("Zero is returned.");
3658
+ return( bigint(0) ); // and return zero
3659
+ }
3660
+ // now the sizes of I and J are equal m
3661
+ int h, k;
3662
+ bigintmat M[m][m]; // construct the required matrix
3663
+ for(h=1; h<=m; h++)
3664
+ {
3665
+ for(k=1; k<=m; k++)
3666
+ {
3667
+ M[h,k] = binomial( I[k]+k-1, J[h]+h-1 );
3668
+ }
3669
+ }
3670
+ return( det(M) ); // and return its determinant
3671
+ }
3672
+ example
3673
+ {
3674
+ "EXAMPLE:"; echo =2;
3675
+ // The coefficient corresponding to the partitions (1, 3, 4) and (0, 3, 3)
3676
+ list I = 1, 3, 4;
3677
+ list J = 1, 3, 3;
3678
+ print( IJcoef(I, J) );
3679
+ }
3680
+ //---------------------------------------------------------------------------------------
3681
+
3682
+ static proc invertPart(list l)
3683
+ "USAGE: invertPart(I); I list of integers (partition),
3684
+ RETURN: list of integers
3685
+ PURPOSE: inverts the ordering of the elements in the list
3686
+ EXAMPLE: example invertPart; shows an example
3687
+ NOTE:
3688
+ "
3689
+ {
3690
+ list L;
3691
+ int sz=size(l);
3692
+ int i;
3693
+ for(i=sz;i>=1;i--)
3694
+ {
3695
+ L=L+list(l[i]);
3696
+ }
3697
+ return(L);
3698
+ }
3699
+ example
3700
+ {
3701
+ "EXAMPLE:"; echo = 2;
3702
+ // Invert the ordering of elements in (3, 2, 1)
3703
+ list l = 3, 2, 1;
3704
+ print( invertPart(l) );
3705
+ }
3706
+ //---------------------------------------------------------------------------------------
3707
+
3708
+ static proc LRmul(list I, list J)
3709
+ "USAGE: LRmul(x, y); x, y lists of integers (partitions)
3710
+ RETURN: list of lists
3711
+ PURPOSE: computes the partitions z for which the Littlewood-Richardson
3712
+ coefficient c^z_{x,y} is non-zero together with that coefficient;
3713
+ partitions up to length r
3714
+ EXAMPLE: example LRmul; shows an example
3715
+ NOTE: uses LRmult(..) from lrcalc.lib, does the same,
3716
+ only uses the inverted ordering of the elements in the partition
3717
+ "
3718
+ {
3719
+ list rez=LRmult(invertPart(I), invertPart(J));
3720
+ int sz=size(rez);
3721
+ int i;
3722
+ for(i=1;i<=sz;i++)
3723
+ {
3724
+ rez[i][2]=invertPart(rez[i][2]);
3725
+ }
3726
+ return(rez);
3727
+ }
3728
+ example
3729
+ {
3730
+ "EXAMPLE:"; echo = 2;
3731
+ // Compute the partitions z for which the Littlewood-Richardson coefficient
3732
+ // c^z_{x,y} is non-zero together with that coefficient
3733
+ // for x= (1, 2), y=(1, 2)
3734
+ list x = 1, 2;
3735
+ list y = 1, 2;
3736
+ print( LRmul(x, y) );
3737
+ }
3738
+ //---------------------------------------------------------------------------------------
3739
+
3740
+ static proc hook(list I)
3741
+ "USAGE: hook(I); I list of integers (partition),
3742
+ RETURN: bigint
3743
+ PURPOSE: computes the product of the hook lenhths of the partition I
3744
+ EXAMPLE: example hook; shows an example
3745
+ NOTE:
3746
+ "
3747
+ {
3748
+ bigint rez=1;
3749
+ list dI= invertPart( dualPart(I) );
3750
+ I=invertPart( I );
3751
+ int szI=size(I);
3752
+ int szdI=size(dI);
3753
+ int i, j;
3754
+ for(i=1;i<=szI;i++)
3755
+ {
3756
+ for(j=1;j<=I[i];j++)
3757
+ {
3758
+ rez=rez*(I[i]+dI[j]-i-j+1);
3759
+ }
3760
+ }
3761
+ return(rez);
3762
+ }
3763
+ example
3764
+ {
3765
+ "EXAMPLE:"; echo = 2;
3766
+ // compute the product of all hook lengths of the partition (1, 1, 3)
3767
+ list I = 1, 1, 3;
3768
+ print( hook(I) );
3769
+ }
3770
+ //---------------------------------------------------------------------------------------
3771
+
3772
+ static proc apn0_int(int N, list c)
3773
+ "USAGE: apn0_int( N, c); N integer, c list of integers (partition)
3774
+ RETURN: list of integers
3775
+ PURPOSE: appends by integer zeroes up to the length N
3776
+ EXAMPLE: example apn0_int; shows an example
3777
+ NOTE:
3778
+ "
3779
+ {
3780
+ int n=size(c);
3781
+ if(N>n) // if N is greater than the length of c, append c by zeroes up to the length N
3782
+ {
3783
+ int i;
3784
+ for(i=n+1;i<=N;i++)
3785
+ {
3786
+ c=c+list( int(0) );
3787
+ }
3788
+ }
3789
+ return(c);
3790
+ }
3791
+ example
3792
+ {
3793
+ "EXAMPLE:";echo =2;
3794
+ ring r = 0, (x, y, z), dp;
3795
+ list l=(1, 2, 3);
3796
+ //append the list by two zeroes and get a list of length 5
3797
+ print( apn0_int(5, l) );
3798
+ }
3799
+ //---------------------------------------------------------------------------------------
3800
+
3801
+ static proc contentPoly(list I, list J, poly e)
3802
+ "USAGE: contentPoly(I, J, e); L, M lists of integers (partitions),
3803
+ e polynomial
3804
+ RETURN: poly
3805
+ PURPOSE: computes the content polynomial of the skew partition corresponding to I>J
3806
+ EXAMPLE: example contentPoly; shows an example
3807
+ NOTE:
3808
+ "
3809
+ {
3810
+ int i, j;
3811
+ int szI=size(I);
3812
+ I=invertPart(I);
3813
+ J=invertPart(J);
3814
+ J=apn0_int(szI, J);
3815
+ poly rez=1;
3816
+ for(i=1; i<=szI; i++)
3817
+ {
3818
+ for(j=J[i]+1; j<=I[i]; j++)
3819
+ {
3820
+ rez = rez*(e- i+j);
3821
+ }
3822
+ }
3823
+ return(rez);
3824
+ }
3825
+ example
3826
+ {
3827
+ "EXAMPLE:"; echo = 2;
3828
+ // compute the content Polynomial of the skew partition
3829
+ // corresponding to (1,2) > (0, 1) with respect to the variable x
3830
+ ring r = 0, (x), dp;
3831
+ list L=1,2;
3832
+ list M=0,1;
3833
+ print( contentPoly(L, M, x) );
3834
+ }
3835
+ //---------------------------------------------------------------------------------------
3836
+
3837
+ static proc Pcoef(list L, list M, poly e, poly f)
3838
+ "USAGE: Pcoef(L, M, e, f); L, M lists of integers (partitions),
3839
+ e, f polynomials
3840
+ RETURN: poly
3841
+ PURPOSE: computes the polynomial P_{L, M}(e, f) from the paper of Manivel
3842
+ EXAMPLE: example Pcoef; shows an example
3843
+ NOTE:
3844
+ "
3845
+ {
3846
+ list P = LRmul(dualPart(L), M);
3847
+ int sz=size(P);
3848
+ poly rez;
3849
+ //poly h;
3850
+ list T, DT;
3851
+ //bigint lrc;
3852
+ int i;
3853
+ for(i=1;i<=sz;i++)
3854
+ {
3855
+ T=P[i][2];
3856
+ DT=dualPart(T);
3857
+ //lrc=P[i][1];
3858
+ //h=contentPolyM(DT, L, e)*contentPoly(T, M, f);
3859
+ rez=rez+P[i][1]* contentPoly(DT, L, e)*contentPoly(T, M, f)/hook(DT);
3860
+ }
3861
+ return(rez);
3862
+ }
3863
+ example
3864
+ {
3865
+ "EXAMPLE:"; echo = 2;
3866
+ // compute P_{L, M}(e, f) from the paper of Manivel
3867
+ // for L = (0,1) and M = (1, 1)
3868
+ ring r = 0, (e, f), dp;
3869
+ list L=1,2,3;
3870
+ list M=1,2;
3871
+ print( Pcoef(L, M, e, f) );
3872
+ }
3873
+ //---------------------------------------------------------------------------------------
3874
+
3875
+ static proc max_deg(ideal I)
3876
+ "USAGE: max_deg(I); I an ideal
3877
+ RETURN: integer
3878
+ PURPOSE: computes the maximal degree of the generators of I
3879
+ EXAMPLE: example max_deg; shows an example
3880
+ NOTE:
3881
+ "
3882
+ {
3883
+ int rez=0;
3884
+ int i;
3885
+ int sz = ncols(I);
3886
+ for(i=1;i<=sz;i++)
3887
+ {
3888
+ rez=max(rez, deg(I[i]) );
3889
+ }
3890
+ return(rez);
3891
+ }
3892
+ example
3893
+ {
3894
+ "EXAMPLE:";echo =2;
3895
+ // the maximal degree of the ideal in k[x, y]:
3896
+ ring r = 0, (x, y), dp;
3897
+ ideal I= x4, y7, x2y3;
3898
+ print(max_deg(I));
3899
+ }
3900
+ //-------------------------------------------------------------------------------------------
3901
+
3902
+ static proc var_pow(int n)
3903
+ "USAGE: var_pow(n); n an integer
3904
+ RETURN: ideal
3905
+ PURPOSE: computes the ideal generated by the n-th powers of the variables of the base ring
3906
+ EXAMPLE: example var_pow; shows an example
3907
+ NOTE:
3908
+ "
3909
+ {
3910
+ ideal I=maxideal(1);
3911
+ int sz=ncols(I);
3912
+ int i;
3913
+ ideal J;
3914
+ for(i=1; i<=sz; i++)
3915
+ {
3916
+ J=J+ideal(I[i]^n);
3917
+ }
3918
+ return(J);
3919
+ }
3920
+ example
3921
+ {
3922
+ "EXAMPLE:";echo =2;
3923
+ // the 3-rd powers of the variables in k[x, y]:
3924
+ ring r = 0, (x, y), dp;
3925
+ print(var_pow(3));
3926
+ }
3927
+ //-------------------------------------------------------------------------------------------
3928
+
3929
+ static proc equal_deg(ideal I)
3930
+ "USAGE: equal_deg(I); I an ideal
3931
+ RETURN: ideal
3932
+ PURPOSE: computes an ideal generated by elements of the same degree
3933
+ that defines the same projective subscheme as I
3934
+ EXAMPLE: example equal_deg; shows an example
3935
+ NOTE:
3936
+ "
3937
+ {
3938
+ I=simplify(I, 8+2);
3939
+ int sz=ncols(I);
3940
+ int mxd=max_deg(I);
3941
+ int i;
3942
+ ideal J;
3943
+ for(i=1;i<=sz;i++)
3944
+ {
3945
+ J=J+I[i]*var_pow( mxd-deg(I[i]) );
3946
+ }
3947
+
3948
+ return(sort( simplify(J, 8+2) )[1]);
3949
+ }
3950
+ example
3951
+ {
3952
+ "EXAMPLE:"; echo=2;
3953
+ // change the ideal (x, y^2) in k[x, y, z]:
3954
+ ring r = 0, (x, y, z), dp;
3955
+ ideal I=x, y*z;
3956
+ // the ideal defines a two points subscheme in the projective plane
3957
+ // and is generated by elements of different degrees
3958
+ print(I);
3959
+ ideal J=equal_deg(I);
3960
+ // now the ideal is generated by elements of degree 2
3961
+ // and defines the same subscheme in the projective plane
3962
+ J;
3963
+ // notice that both ideals have the same saturation
3964
+ // with respect to the irrelevant ideal (x, y, z)
3965
+ // the saturation of the initial ideal coincides with the ideal itself
3966
+ sat(I, maxideal(1));
3967
+ // the saturation of the modified ideal
3968
+ sat(J, maxideal(1));
3969
+ }
3970
+ //-------------------------------------------------------------------------------------------
3971
+
3972
+ static proc CSM_hypersurf(poly f)
3973
+ "USAGE: CSM_hypersurf(f); f a polynomial
3974
+ RETURN: list of integers
3975
+ PURPOSE: computes the Chern-Schwartz-MacPherson classes of the hypersurface defined by f
3976
+ EXAMPLE: example CSM_hypersurf; shows an example
3977
+ NOTE:
3978
+ "
3979
+ {
3980
+ ideal I=jacob(f);
3981
+ I=simplify(I, 8+2); // ignore repetitions and zero generators
3982
+ I=sort(I)[1]; // sort the generators, it speeds up the computations
3983
+ int degGen=deg(I[1]); // the degree of the generators of the Jacobian ideal
3984
+ int i;
3985
+ int n=nvars(basering)-1; // the dimension of the projective space
3986
+ bigintmat REZ[1][n+1];
3987
+ if(degGen==-1) // if the Jacobian ideal is zero
3988
+ {
3989
+ for(i=0;i<=n;i++)
3990
+ {
3991
+ REZ[1,i+1]=binomial(n+1,i);
3992
+ }
3993
+ return(REZ);
3994
+ }
3995
+ //TODO need to check the zero ideal and I==1;
3996
+ int sz=ncols(I);
3997
+ def br@=basering; // remember the base ring
3998
+ list l15 = ringlist(basering)[2];
3999
+ for (int ii = 1; ii <= sz; ii++)
4000
+ {
4001
+ l15[size(l15)+1] = "t@("+string(ii)+")";
4002
+ }
4003
+ l15[size(l15)+1] = "u@";
4004
+ ring r@ = create_ring(ring_list(basering)[1], l15, "dp", "no_minpoly");
4005
+ ideal I=fetch(br@,I);
4006
+ ideal J(0..n);
4007
+ for(i=1; i<=sz; i++)
4008
+ {
4009
+ J(0)=J(0) + ideal( t@(i)-u@*I[i] );
4010
+ }
4011
+ J(0)=eliminate(J(0), u@);
4012
+ ideal T=t@(1..sz);
4013
+ for(i=1;i<=n;i++)
4014
+ {
4015
+ J(i) = sat( random_hypersurf(J(i-1), T), T );
4016
+ }
4017
+ poly prd=product(T);
4018
+ poly cl;
4019
+ poly mlt;
4020
+ for(i=0;i<=n;i++)
4021
+ {
4022
+ cl=cl+ mult( std(eliminate( J(i), prd)) ) *(-u@)^i*(1+u@)^(n-i);
4023
+ }
4024
+ cl=(1+u@)^(n+1)-cl;
4025
+ poly resPoly=NF( cl, u@^(n+1) );
4026
+ matrix cf=coeffs(resPoly, u@);
4027
+ for(i=0;i<=n;i++)
4028
+ {
4029
+ if( i < nrows(cf) )
4030
+ {
4031
+ REZ[1,i+1]=int(cf[i+1,1]);
4032
+ }
4033
+ else
4034
+ {
4035
+ REZ[1,i+1]=int(0);
4036
+ }
4037
+ }
4038
+ return(REZ);
4039
+ }
4040
+ example
4041
+ {
4042
+ "EXAMPLE:";echo =2;
4043
+ // consider the projective plane with homogeneous coordinates x, y, z
4044
+ ring r = 0, (x, y, z), dp;
4045
+ // the Chern-Schwartz-MacPherson class of a smooth cubic:
4046
+ poly f=x3+y3+z3;
4047
+ f;
4048
+ CSM_hypersurf(f);
4049
+ // the Chern-Schwartz-MacPherson class of singular cubic
4050
+ // that is a union of 3 non-collinear lines:
4051
+ poly g=x*y*z;
4052
+ g;
4053
+ CSM_hypersurf(g);
4054
+ // the Chern-Schwartz-MacPherson class of singular cubic
4055
+ // that is a union of 3 lines passing through one point
4056
+ poly h=x*y*(x+y);
4057
+ h;
4058
+ CSM_hypersurf(h);
4059
+ }
4060
+ //-------------------------------------------------------------------------------------------
4061
+
4062
+ static proc random_hypersurf(ideal I, ideal V)
4063
+ "USAGE: random_hypersurf(I, V); I, V ideals
4064
+ RETURN: ideal
4065
+ PURPOSE: computes the sum of I with the ideal generated by a random
4066
+ linear combination of the generators of V such that the dimension decreases
4067
+ EXAMPLE: example random_hypersurf; shows an example
4068
+ NOTE: if the ideal I=1 (the whole ring), then I is returned
4069
+ "
4070
+ {
4071
+ ideal H;
4072
+ ideal J;
4073
+ // if(isSubModule(ideal(1), I)) // if I equals 1 (the whole ring);
4074
+ if( is_zero(I) )
4075
+ {
4076
+ return(I);
4077
+ }
4078
+ // otherwise
4079
+ int ok=0;
4080
+ int ntries; // number of tries
4081
+ while( !ok ) // give two tries for every b in randomid(V, 1, b)
4082
+ {
4083
+ H=randomid(V, 1, ntries div 2 +1);
4084
+ ntries++; // increase by 1
4085
+ if( isSubModule( quotient(I, ideal(H) ), I) )
4086
+ {
4087
+ J=I + H;
4088
+ ok=1;
4089
+ }
4090
+ }
4091
+ return(J);
4092
+ }
4093
+ example
4094
+ {
4095
+ "EXAMPLE:";echo =2;
4096
+ // Consider an ideal in k[x, y, z, s, t] and find its intersection with a general hyperplane
4097
+ // given by as+bt=0
4098
+ ring r = 0, (x, y, z, s, t), dp;
4099
+ ideal I=x2, yz, s+t;
4100
+ I;
4101
+ ideal V= s, t;
4102
+ V;
4103
+ // the ideal of the intersection with the random general hyperplane
4104
+ random_hypersurf(I, V);
4105
+ }
4106
+ //-------------------------------------------------------------------------------------------
4107
+
4108
+ static proc prds(int n, def l)
4109
+ "USAGE: prds(n, l); n an integer, l list of polynomials or ideal
4110
+ RETURN: list of polynomials
4111
+ PURPOSE: computes all possible products of length n (without repetitions) of the entries of l
4112
+ EXAMPLE: example prds; shows an example
4113
+ NOTE:
4114
+ "
4115
+ {
4116
+ int sz;
4117
+ if(typeof(l)=="ideal")
4118
+ {
4119
+ sz=ncols(l);
4120
+ }
4121
+ else
4122
+ {
4123
+ sz=size(l);
4124
+ }
4125
+ if( (n>sz)||(sz==0)||(n<0) )
4126
+ {
4127
+ return( list() );
4128
+ }
4129
+ // otherwise
4130
+ if(n==0)
4131
+ {
4132
+ return( list(int(1)) );
4133
+ }
4134
+ if(sz==n)
4135
+ {
4136
+ return(product(l));
4137
+ }
4138
+ list L, LL, ll;
4139
+ ll=l[2..sz];
4140
+ poly f=l[1];
4141
+ L=prds(n, ll );
4142
+ LL=prds(n-1,ll);
4143
+ int i;
4144
+ sz=size(LL);
4145
+ for(i=1;i<=sz;i++)
4146
+ {
4147
+ LL[i]=f*LL[i];
4148
+ }
4149
+ return(L+LL);
4150
+ }
4151
+ example
4152
+ {
4153
+ "EXAMPLE:";echo =2;
4154
+ ring r = 0, (x, y, z, w), dp;
4155
+ // compute all possible 2-products between the variables x,y,z,w
4156
+ list l=x,y,z,w;
4157
+ prds(2, l);
4158
+ // compute all possible 3-products between the variables x,y,z,w
4159
+ ideal I=x,y,z,w;
4160
+ prds(3, l);
4161
+ }
4162
+ //-------------------------------------------------------------------------------------------