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

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

Potentially problematic release.


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

Files changed (491) hide show
  1. PySingular.cpython-314-x86_64-linux-gnu.so +0 -0
  2. passagemath_singular-10.6.31rc3.dist-info/METADATA +183 -0
  3. passagemath_singular-10.6.31rc3.dist-info/RECORD +491 -0
  4. passagemath_singular-10.6.31rc3.dist-info/WHEEL +6 -0
  5. passagemath_singular-10.6.31rc3.dist-info/top_level.txt +3 -0
  6. passagemath_singular.libs/libSingular-4-20aec911.4.1.so +0 -0
  7. passagemath_singular.libs/libcddgmp-21acf0c6.so.0.1.3 +0 -0
  8. passagemath_singular.libs/libfactory-4-fcee31da.4.1.so +0 -0
  9. passagemath_singular.libs/libflint-66e12231.so.21.0.0 +0 -0
  10. passagemath_singular.libs/libgf2x-a4cdec90.so.3.0.0 +0 -0
  11. passagemath_singular.libs/libgfortran-83c28eba.so.5.0.0 +0 -0
  12. passagemath_singular.libs/libgmp-6e109695.so.10.5.0 +0 -0
  13. passagemath_singular.libs/libgsl-cda90e79.so.28.0.0 +0 -0
  14. passagemath_singular.libs/libmpfr-82690d50.so.6.2.1 +0 -0
  15. passagemath_singular.libs/libntl-e6f0d543.so.44.0.1 +0 -0
  16. passagemath_singular.libs/libomalloc-0-5c9e866e.9.6.so +0 -0
  17. passagemath_singular.libs/libopenblasp-r0-6dcb67f9.3.29.so +0 -0
  18. passagemath_singular.libs/libpolys-4-5c0a87e0.4.1.so +0 -0
  19. passagemath_singular.libs/libquadmath-2284e583.so.0.0.0 +0 -0
  20. passagemath_singular.libs/libreadline-ea270e21.so.8.2 +0 -0
  21. passagemath_singular.libs/libsingular_resources-4-a1aafc6d.4.1.so +0 -0
  22. passagemath_singular.libs/libtinfo-ceb117d9.so.6.3 +0 -0
  23. sage/algebras/all__sagemath_singular.py +3 -0
  24. sage/algebras/fusion_rings/all.py +19 -0
  25. sage/algebras/fusion_rings/f_matrix.py +2448 -0
  26. sage/algebras/fusion_rings/fast_parallel_fmats_methods.cpython-314-x86_64-linux-gnu.so +0 -0
  27. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pxd +5 -0
  28. sage/algebras/fusion_rings/fast_parallel_fmats_methods.pyx +538 -0
  29. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.cpython-314-x86_64-linux-gnu.so +0 -0
  30. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pxd +3 -0
  31. sage/algebras/fusion_rings/fast_parallel_fusion_ring_braid_repn.pyx +331 -0
  32. sage/algebras/fusion_rings/fusion_double.py +899 -0
  33. sage/algebras/fusion_rings/fusion_ring.py +1580 -0
  34. sage/algebras/fusion_rings/poly_tup_engine.cpython-314-x86_64-linux-gnu.so +0 -0
  35. sage/algebras/fusion_rings/poly_tup_engine.pxd +24 -0
  36. sage/algebras/fusion_rings/poly_tup_engine.pyx +579 -0
  37. sage/algebras/fusion_rings/shm_managers.cpython-314-x86_64-linux-gnu.so +0 -0
  38. sage/algebras/fusion_rings/shm_managers.pxd +24 -0
  39. sage/algebras/fusion_rings/shm_managers.pyx +780 -0
  40. sage/algebras/letterplace/all.py +1 -0
  41. sage/algebras/letterplace/free_algebra_element_letterplace.cpython-314-x86_64-linux-gnu.so +0 -0
  42. sage/algebras/letterplace/free_algebra_element_letterplace.pxd +18 -0
  43. sage/algebras/letterplace/free_algebra_element_letterplace.pyx +755 -0
  44. sage/algebras/letterplace/free_algebra_letterplace.cpython-314-x86_64-linux-gnu.so +0 -0
  45. sage/algebras/letterplace/free_algebra_letterplace.pxd +35 -0
  46. sage/algebras/letterplace/free_algebra_letterplace.pyx +914 -0
  47. sage/algebras/letterplace/letterplace_ideal.cpython-314-x86_64-linux-gnu.so +0 -0
  48. sage/algebras/letterplace/letterplace_ideal.pyx +408 -0
  49. sage/algebras/quatalg/all.py +2 -0
  50. sage/algebras/quatalg/quaternion_algebra.py +4778 -0
  51. sage/algebras/quatalg/quaternion_algebra_cython.cpython-314-x86_64-linux-gnu.so +0 -0
  52. sage/algebras/quatalg/quaternion_algebra_cython.pyx +261 -0
  53. sage/algebras/quatalg/quaternion_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
  54. sage/algebras/quatalg/quaternion_algebra_element.pxd +29 -0
  55. sage/algebras/quatalg/quaternion_algebra_element.pyx +2176 -0
  56. sage/all__sagemath_singular.py +11 -0
  57. sage/ext_data/all__sagemath_singular.py +1 -0
  58. sage/ext_data/singular/function_field/core.lib +98 -0
  59. sage/interfaces/all__sagemath_singular.py +1 -0
  60. sage/interfaces/singular.py +2835 -0
  61. sage/libs/all__sagemath_singular.py +1 -0
  62. sage/libs/singular/__init__.py +1 -0
  63. sage/libs/singular/decl.pxd +1168 -0
  64. sage/libs/singular/function.cpython-314-x86_64-linux-gnu.so +0 -0
  65. sage/libs/singular/function.pxd +87 -0
  66. sage/libs/singular/function.pyx +1901 -0
  67. sage/libs/singular/function_factory.py +61 -0
  68. sage/libs/singular/groebner_strategy.cpython-314-x86_64-linux-gnu.so +0 -0
  69. sage/libs/singular/groebner_strategy.pxd +22 -0
  70. sage/libs/singular/groebner_strategy.pyx +582 -0
  71. sage/libs/singular/option.cpython-314-x86_64-linux-gnu.so +0 -0
  72. sage/libs/singular/option.pyx +671 -0
  73. sage/libs/singular/polynomial.cpython-314-x86_64-linux-gnu.so +0 -0
  74. sage/libs/singular/polynomial.pxd +39 -0
  75. sage/libs/singular/polynomial.pyx +661 -0
  76. sage/libs/singular/ring.cpython-314-x86_64-linux-gnu.so +0 -0
  77. sage/libs/singular/ring.pxd +58 -0
  78. sage/libs/singular/ring.pyx +893 -0
  79. sage/libs/singular/singular.cpython-314-x86_64-linux-gnu.so +0 -0
  80. sage/libs/singular/singular.pxd +72 -0
  81. sage/libs/singular/singular.pyx +1944 -0
  82. sage/libs/singular/standard_options.py +145 -0
  83. sage/matrix/all__sagemath_singular.py +1 -0
  84. sage/matrix/matrix_mpolynomial_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  85. sage/matrix/matrix_mpolynomial_dense.pxd +7 -0
  86. sage/matrix/matrix_mpolynomial_dense.pyx +615 -0
  87. sage/rings/all__sagemath_singular.py +1 -0
  88. sage/rings/function_field/all__sagemath_singular.py +1 -0
  89. sage/rings/function_field/derivations_polymod.py +911 -0
  90. sage/rings/function_field/element_polymod.cpython-314-x86_64-linux-gnu.so +0 -0
  91. sage/rings/function_field/element_polymod.pyx +406 -0
  92. sage/rings/function_field/function_field_polymod.py +2611 -0
  93. sage/rings/function_field/ideal_polymod.py +1775 -0
  94. sage/rings/function_field/order_polymod.py +1475 -0
  95. sage/rings/function_field/place_polymod.py +681 -0
  96. sage/rings/polynomial/all__sagemath_singular.py +1 -0
  97. sage/rings/polynomial/multi_polynomial_ideal_libsingular.cpython-314-x86_64-linux-gnu.so +0 -0
  98. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pxd +5 -0
  99. sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx +339 -0
  100. sage/rings/polynomial/multi_polynomial_libsingular.cpython-314-x86_64-linux-gnu.so +0 -0
  101. sage/rings/polynomial/multi_polynomial_libsingular.pxd +30 -0
  102. sage/rings/polynomial/multi_polynomial_libsingular.pyx +6277 -0
  103. sage/rings/polynomial/plural.cpython-314-x86_64-linux-gnu.so +0 -0
  104. sage/rings/polynomial/plural.pxd +48 -0
  105. sage/rings/polynomial/plural.pyx +3171 -0
  106. sage/symbolic/all__sagemath_singular.py +1 -0
  107. sage/symbolic/comparison_impl.pxi +428 -0
  108. sage/symbolic/constants_c_impl.pxi +178 -0
  109. sage/symbolic/expression.cpython-314-x86_64-linux-gnu.so +0 -0
  110. sage/symbolic/expression.pxd +7 -0
  111. sage/symbolic/expression.pyx +14200 -0
  112. sage/symbolic/getitem_impl.pxi +202 -0
  113. sage/symbolic/pynac.pxi +572 -0
  114. sage/symbolic/pynac_constant_impl.pxi +133 -0
  115. sage/symbolic/pynac_function_impl.pxi +206 -0
  116. sage/symbolic/pynac_impl.pxi +2576 -0
  117. sage/symbolic/pynac_wrap.h +124 -0
  118. sage/symbolic/series_impl.pxi +272 -0
  119. sage/symbolic/substitution_map_impl.pxi +94 -0
  120. sage_wheels/bin/ESingular +0 -0
  121. sage_wheels/bin/Singular +0 -0
  122. sage_wheels/bin/TSingular +0 -0
  123. sage_wheels/lib/singular/MOD/cohomo.la +41 -0
  124. sage_wheels/lib/singular/MOD/cohomo.so +0 -0
  125. sage_wheels/lib/singular/MOD/customstd.la +41 -0
  126. sage_wheels/lib/singular/MOD/customstd.so +0 -0
  127. sage_wheels/lib/singular/MOD/freealgebra.la +41 -0
  128. sage_wheels/lib/singular/MOD/freealgebra.so +0 -0
  129. sage_wheels/lib/singular/MOD/gfanlib.la +41 -0
  130. sage_wheels/lib/singular/MOD/gfanlib.so +0 -0
  131. sage_wheels/lib/singular/MOD/gitfan.la +41 -0
  132. sage_wheels/lib/singular/MOD/gitfan.so +0 -0
  133. sage_wheels/lib/singular/MOD/interval.la +41 -0
  134. sage_wheels/lib/singular/MOD/interval.so +0 -0
  135. sage_wheels/lib/singular/MOD/loctriv.la +41 -0
  136. sage_wheels/lib/singular/MOD/loctriv.so +0 -0
  137. sage_wheels/lib/singular/MOD/machinelearning.la +41 -0
  138. sage_wheels/lib/singular/MOD/machinelearning.so +0 -0
  139. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.la +41 -0
  140. sage_wheels/lib/singular/MOD/p_Procs_FieldGeneral.so +0 -0
  141. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.la +41 -0
  142. sage_wheels/lib/singular/MOD/p_Procs_FieldIndep.so +0 -0
  143. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.la +41 -0
  144. sage_wheels/lib/singular/MOD/p_Procs_FieldQ.so +0 -0
  145. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.la +41 -0
  146. sage_wheels/lib/singular/MOD/p_Procs_FieldZp.so +0 -0
  147. sage_wheels/lib/singular/MOD/partialgb.la +41 -0
  148. sage_wheels/lib/singular/MOD/partialgb.so +0 -0
  149. sage_wheels/lib/singular/MOD/pyobject.la +41 -0
  150. sage_wheels/lib/singular/MOD/pyobject.so +0 -0
  151. sage_wheels/lib/singular/MOD/singmathic.la +41 -0
  152. sage_wheels/lib/singular/MOD/singmathic.so +0 -0
  153. sage_wheels/lib/singular/MOD/sispasm.la +41 -0
  154. sage_wheels/lib/singular/MOD/sispasm.so +0 -0
  155. sage_wheels/lib/singular/MOD/subsets.la +41 -0
  156. sage_wheels/lib/singular/MOD/subsets.so +0 -0
  157. sage_wheels/lib/singular/MOD/systhreads.la +41 -0
  158. sage_wheels/lib/singular/MOD/systhreads.so +0 -0
  159. sage_wheels/lib/singular/MOD/syzextra.la +41 -0
  160. sage_wheels/lib/singular/MOD/syzextra.so +0 -0
  161. sage_wheels/libexec/singular/MOD/change_cost +0 -0
  162. sage_wheels/libexec/singular/MOD/singularsurf +11 -0
  163. sage_wheels/libexec/singular/MOD/singularsurf_jupyter +9 -0
  164. sage_wheels/libexec/singular/MOD/singularsurf_win +10 -0
  165. sage_wheels/libexec/singular/MOD/solve_IP +0 -0
  166. sage_wheels/libexec/singular/MOD/surfex +16 -0
  167. sage_wheels/libexec/singular/MOD/toric_ideal +0 -0
  168. sage_wheels/share/factory/gftables/10201 +342 -0
  169. sage_wheels/share/factory/gftables/1024 +37 -0
  170. sage_wheels/share/factory/gftables/10609 +356 -0
  171. sage_wheels/share/factory/gftables/11449 +384 -0
  172. sage_wheels/share/factory/gftables/11881 +398 -0
  173. sage_wheels/share/factory/gftables/121 +6 -0
  174. sage_wheels/share/factory/gftables/12167 +408 -0
  175. sage_wheels/share/factory/gftables/125 +7 -0
  176. sage_wheels/share/factory/gftables/12769 +428 -0
  177. sage_wheels/share/factory/gftables/128 +7 -0
  178. sage_wheels/share/factory/gftables/1331 +47 -0
  179. sage_wheels/share/factory/gftables/1369 +48 -0
  180. sage_wheels/share/factory/gftables/14641 +490 -0
  181. sage_wheels/share/factory/gftables/15625 +523 -0
  182. sage_wheels/share/factory/gftables/16 +3 -0
  183. sage_wheels/share/factory/gftables/16129 +540 -0
  184. sage_wheels/share/factory/gftables/16384 +549 -0
  185. sage_wheels/share/factory/gftables/16807 +563 -0
  186. sage_wheels/share/factory/gftables/1681 +58 -0
  187. sage_wheels/share/factory/gftables/169 +8 -0
  188. sage_wheels/share/factory/gftables/17161 +574 -0
  189. sage_wheels/share/factory/gftables/1849 +64 -0
  190. sage_wheels/share/factory/gftables/18769 +628 -0
  191. sage_wheels/share/factory/gftables/19321 +646 -0
  192. sage_wheels/share/factory/gftables/19683 +659 -0
  193. sage_wheels/share/factory/gftables/2048 +71 -0
  194. sage_wheels/share/factory/gftables/2187 +75 -0
  195. sage_wheels/share/factory/gftables/2197 +76 -0
  196. sage_wheels/share/factory/gftables/2209 +76 -0
  197. sage_wheels/share/factory/gftables/22201 +742 -0
  198. sage_wheels/share/factory/gftables/22801 +762 -0
  199. sage_wheels/share/factory/gftables/2401 +82 -0
  200. sage_wheels/share/factory/gftables/243 +11 -0
  201. sage_wheels/share/factory/gftables/24389 +815 -0
  202. sage_wheels/share/factory/gftables/24649 +824 -0
  203. sage_wheels/share/factory/gftables/25 +3 -0
  204. sage_wheels/share/factory/gftables/256 +11 -0
  205. sage_wheels/share/factory/gftables/26569 +888 -0
  206. sage_wheels/share/factory/gftables/27 +3 -0
  207. sage_wheels/share/factory/gftables/27889 +932 -0
  208. sage_wheels/share/factory/gftables/2809 +96 -0
  209. sage_wheels/share/factory/gftables/28561 +954 -0
  210. sage_wheels/share/factory/gftables/289 +12 -0
  211. sage_wheels/share/factory/gftables/29791 +995 -0
  212. sage_wheels/share/factory/gftables/29929 +1000 -0
  213. sage_wheels/share/factory/gftables/3125 +107 -0
  214. sage_wheels/share/factory/gftables/32 +4 -0
  215. sage_wheels/share/factory/gftables/32041 +1070 -0
  216. sage_wheels/share/factory/gftables/32761 +1094 -0
  217. sage_wheels/share/factory/gftables/32768 +1095 -0
  218. sage_wheels/share/factory/gftables/343 +14 -0
  219. sage_wheels/share/factory/gftables/3481 +118 -0
  220. sage_wheels/share/factory/gftables/361 +14 -0
  221. sage_wheels/share/factory/gftables/36481 +1218 -0
  222. sage_wheels/share/factory/gftables/3721 +126 -0
  223. sage_wheels/share/factory/gftables/37249 +1244 -0
  224. sage_wheels/share/factory/gftables/38809 +1296 -0
  225. sage_wheels/share/factory/gftables/39601 +1322 -0
  226. sage_wheels/share/factory/gftables/4 +3 -0
  227. sage_wheels/share/factory/gftables/4096 +139 -0
  228. sage_wheels/share/factory/gftables/44521 +1486 -0
  229. sage_wheels/share/factory/gftables/4489 +152 -0
  230. sage_wheels/share/factory/gftables/49 +4 -0
  231. sage_wheels/share/factory/gftables/4913 +166 -0
  232. sage_wheels/share/factory/gftables/49729 +1660 -0
  233. sage_wheels/share/factory/gftables/5041 +170 -0
  234. sage_wheels/share/factory/gftables/50653 +1691 -0
  235. sage_wheels/share/factory/gftables/512 +20 -0
  236. sage_wheels/share/factory/gftables/51529 +1720 -0
  237. sage_wheels/share/factory/gftables/52441 +1750 -0
  238. sage_wheels/share/factory/gftables/529 +20 -0
  239. sage_wheels/share/factory/gftables/5329 +180 -0
  240. sage_wheels/share/factory/gftables/54289 +1812 -0
  241. sage_wheels/share/factory/gftables/57121 +1906 -0
  242. sage_wheels/share/factory/gftables/58081 +1938 -0
  243. sage_wheels/share/factory/gftables/59049 +1971 -0
  244. sage_wheels/share/factory/gftables/6241 +210 -0
  245. sage_wheels/share/factory/gftables/625 +23 -0
  246. sage_wheels/share/factory/gftables/63001 +2102 -0
  247. sage_wheels/share/factory/gftables/64 +5 -0
  248. sage_wheels/share/factory/gftables/6561 +221 -0
  249. sage_wheels/share/factory/gftables/6859 +231 -0
  250. sage_wheels/share/factory/gftables/6889 +232 -0
  251. sage_wheels/share/factory/gftables/729 +27 -0
  252. sage_wheels/share/factory/gftables/7921 +266 -0
  253. sage_wheels/share/factory/gftables/8 +3 -0
  254. sage_wheels/share/factory/gftables/81 +5 -0
  255. sage_wheels/share/factory/gftables/8192 +276 -0
  256. sage_wheels/share/factory/gftables/841 +30 -0
  257. sage_wheels/share/factory/gftables/9 +3 -0
  258. sage_wheels/share/factory/gftables/9409 +316 -0
  259. sage_wheels/share/factory/gftables/961 +34 -0
  260. sage_wheels/share/info/singular.info +191898 -0
  261. sage_wheels/share/singular/LIB/GND.lib +1359 -0
  262. sage_wheels/share/singular/LIB/JMBTest.lib +976 -0
  263. sage_wheels/share/singular/LIB/JMSConst.lib +1363 -0
  264. sage_wheels/share/singular/LIB/KVequiv.lib +699 -0
  265. sage_wheels/share/singular/LIB/SingularityDBM.lib +491 -0
  266. sage_wheels/share/singular/LIB/VecField.lib +1542 -0
  267. sage_wheels/share/singular/LIB/absfact.lib +959 -0
  268. sage_wheels/share/singular/LIB/ainvar.lib +730 -0
  269. sage_wheels/share/singular/LIB/aksaka.lib +419 -0
  270. sage_wheels/share/singular/LIB/alexpoly.lib +2542 -0
  271. sage_wheels/share/singular/LIB/algebra.lib +1193 -0
  272. sage_wheels/share/singular/LIB/all.lib +136 -0
  273. sage_wheels/share/singular/LIB/arcpoint.lib +514 -0
  274. sage_wheels/share/singular/LIB/arnold.lib +4553 -0
  275. sage_wheels/share/singular/LIB/arnoldclassify.lib +2058 -0
  276. sage_wheels/share/singular/LIB/arr.lib +3486 -0
  277. sage_wheels/share/singular/LIB/assprimeszerodim.lib +755 -0
  278. sage_wheels/share/singular/LIB/autgradalg.lib +3361 -0
  279. sage_wheels/share/singular/LIB/bfun.lib +1964 -0
  280. sage_wheels/share/singular/LIB/bimodules.lib +774 -0
  281. sage_wheels/share/singular/LIB/brillnoether.lib +226 -0
  282. sage_wheels/share/singular/LIB/brnoeth.lib +5017 -0
  283. sage_wheels/share/singular/LIB/central.lib +2169 -0
  284. sage_wheels/share/singular/LIB/chern.lib +4162 -0
  285. sage_wheels/share/singular/LIB/cimonom.lib +571 -0
  286. sage_wheels/share/singular/LIB/cisimplicial.lib +1835 -0
  287. sage_wheels/share/singular/LIB/classify.lib +3239 -0
  288. sage_wheels/share/singular/LIB/classify2.lib +1462 -0
  289. sage_wheels/share/singular/LIB/classifyMapGerms.lib +1515 -0
  290. sage_wheels/share/singular/LIB/classify_aeq.lib +3253 -0
  291. sage_wheels/share/singular/LIB/classifyceq.lib +2092 -0
  292. sage_wheels/share/singular/LIB/classifyci.lib +1133 -0
  293. sage_wheels/share/singular/LIB/combinat.lib +91 -0
  294. sage_wheels/share/singular/LIB/compregb.lib +276 -0
  295. sage_wheels/share/singular/LIB/control.lib +1636 -0
  296. sage_wheels/share/singular/LIB/crypto.lib +3795 -0
  297. sage_wheels/share/singular/LIB/curveInv.lib +667 -0
  298. sage_wheels/share/singular/LIB/curvepar.lib +1817 -0
  299. sage_wheels/share/singular/LIB/customstd.lib +100 -0
  300. sage_wheels/share/singular/LIB/deRham.lib +5979 -0
  301. sage_wheels/share/singular/LIB/decodegb.lib +2134 -0
  302. sage_wheels/share/singular/LIB/decomp.lib +1655 -0
  303. sage_wheels/share/singular/LIB/deflation.lib +872 -0
  304. sage_wheels/share/singular/LIB/deform.lib +925 -0
  305. sage_wheels/share/singular/LIB/difform.lib +3055 -0
  306. sage_wheels/share/singular/LIB/divisors.lib +750 -0
  307. sage_wheels/share/singular/LIB/dmod.lib +5817 -0
  308. sage_wheels/share/singular/LIB/dmodapp.lib +3269 -0
  309. sage_wheels/share/singular/LIB/dmodideal.lib +1211 -0
  310. sage_wheels/share/singular/LIB/dmodloc.lib +2645 -0
  311. sage_wheels/share/singular/LIB/dmodvar.lib +818 -0
  312. sage_wheels/share/singular/LIB/dummy.lib +17 -0
  313. sage_wheels/share/singular/LIB/elim.lib +1009 -0
  314. sage_wheels/share/singular/LIB/ellipticcovers.lib +548 -0
  315. sage_wheels/share/singular/LIB/enumpoints.lib +146 -0
  316. sage_wheels/share/singular/LIB/equising.lib +2127 -0
  317. sage_wheels/share/singular/LIB/ffmodstd.lib +2384 -0
  318. sage_wheels/share/singular/LIB/ffsolve.lib +1289 -0
  319. sage_wheels/share/singular/LIB/findifs.lib +778 -0
  320. sage_wheels/share/singular/LIB/finitediff.lib +1768 -0
  321. sage_wheels/share/singular/LIB/finvar.lib +7989 -0
  322. sage_wheels/share/singular/LIB/fpadim.lib +2429 -0
  323. sage_wheels/share/singular/LIB/fpalgebras.lib +1666 -0
  324. sage_wheels/share/singular/LIB/fpaprops.lib +1462 -0
  325. sage_wheels/share/singular/LIB/freegb.lib +3853 -0
  326. sage_wheels/share/singular/LIB/general.lib +1350 -0
  327. sage_wheels/share/singular/LIB/gfan.lib +1768 -0
  328. sage_wheels/share/singular/LIB/gitfan.lib +3130 -0
  329. sage_wheels/share/singular/LIB/gkdim.lib +99 -0
  330. sage_wheels/share/singular/LIB/gmspoly.lib +589 -0
  331. sage_wheels/share/singular/LIB/gmssing.lib +1739 -0
  332. sage_wheels/share/singular/LIB/goettsche.lib +909 -0
  333. sage_wheels/share/singular/LIB/graal.lib +1366 -0
  334. sage_wheels/share/singular/LIB/gradedModules.lib +2541 -0
  335. sage_wheels/share/singular/LIB/graphics.lib +360 -0
  336. sage_wheels/share/singular/LIB/grobcov.lib +7706 -0
  337. sage_wheels/share/singular/LIB/groups.lib +1123 -0
  338. sage_wheels/share/singular/LIB/grwalk.lib +507 -0
  339. sage_wheels/share/singular/LIB/hdepth.lib +194 -0
  340. sage_wheels/share/singular/LIB/help.cnf +57 -0
  341. sage_wheels/share/singular/LIB/hess.lib +1946 -0
  342. sage_wheels/share/singular/LIB/hnoether.lib +4292 -0
  343. sage_wheels/share/singular/LIB/hodge.lib +400 -0
  344. sage_wheels/share/singular/LIB/homolog.lib +1965 -0
  345. sage_wheels/share/singular/LIB/hyperel.lib +975 -0
  346. sage_wheels/share/singular/LIB/inout.lib +679 -0
  347. sage_wheels/share/singular/LIB/integralbasis.lib +6224 -0
  348. sage_wheels/share/singular/LIB/interval.lib +1418 -0
  349. sage_wheels/share/singular/LIB/intprog.lib +778 -0
  350. sage_wheels/share/singular/LIB/invar.lib +443 -0
  351. sage_wheels/share/singular/LIB/involut.lib +980 -0
  352. sage_wheels/share/singular/LIB/jacobson.lib +1215 -0
  353. sage_wheels/share/singular/LIB/kskernel.lib +534 -0
  354. sage_wheels/share/singular/LIB/latex.lib +3146 -0
  355. sage_wheels/share/singular/LIB/lejeune.lib +651 -0
  356. sage_wheels/share/singular/LIB/linalg.lib +2040 -0
  357. sage_wheels/share/singular/LIB/locnormal.lib +212 -0
  358. sage_wheels/share/singular/LIB/lrcalc.lib +526 -0
  359. sage_wheels/share/singular/LIB/makedbm.lib +294 -0
  360. sage_wheels/share/singular/LIB/mathml.lib +813 -0
  361. sage_wheels/share/singular/LIB/matrix.lib +1372 -0
  362. sage_wheels/share/singular/LIB/maxlike.lib +1132 -0
  363. sage_wheels/share/singular/LIB/methods.lib +212 -0
  364. sage_wheels/share/singular/LIB/moddiq.lib +322 -0
  365. sage_wheels/share/singular/LIB/modfinduni.lib +181 -0
  366. sage_wheels/share/singular/LIB/modnormal.lib +218 -0
  367. sage_wheels/share/singular/LIB/modprimdec.lib +1278 -0
  368. sage_wheels/share/singular/LIB/modquotient.lib +269 -0
  369. sage_wheels/share/singular/LIB/modstd.lib +1024 -0
  370. sage_wheels/share/singular/LIB/modular.lib +545 -0
  371. sage_wheels/share/singular/LIB/modules.lib +2561 -0
  372. sage_wheels/share/singular/LIB/modwalk.lib +609 -0
  373. sage_wheels/share/singular/LIB/mondromy.lib +1016 -0
  374. sage_wheels/share/singular/LIB/monomialideal.lib +3851 -0
  375. sage_wheels/share/singular/LIB/mprimdec.lib +2353 -0
  376. sage_wheels/share/singular/LIB/mregular.lib +1863 -0
  377. sage_wheels/share/singular/LIB/multigrading.lib +5629 -0
  378. sage_wheels/share/singular/LIB/ncHilb.lib +777 -0
  379. sage_wheels/share/singular/LIB/ncModslimgb.lib +791 -0
  380. sage_wheels/share/singular/LIB/ncalg.lib +16311 -0
  381. sage_wheels/share/singular/LIB/ncall.lib +31 -0
  382. sage_wheels/share/singular/LIB/ncdecomp.lib +468 -0
  383. sage_wheels/share/singular/LIB/ncfactor.lib +13371 -0
  384. sage_wheels/share/singular/LIB/ncfrac.lib +1023 -0
  385. sage_wheels/share/singular/LIB/nchilbert.lib +448 -0
  386. sage_wheels/share/singular/LIB/nchomolog.lib +759 -0
  387. sage_wheels/share/singular/LIB/ncloc.lib +361 -0
  388. sage_wheels/share/singular/LIB/ncpreim.lib +795 -0
  389. sage_wheels/share/singular/LIB/ncrat.lib +2849 -0
  390. sage_wheels/share/singular/LIB/nctools.lib +1887 -0
  391. sage_wheels/share/singular/LIB/nets.lib +1456 -0
  392. sage_wheels/share/singular/LIB/nfmodstd.lib +1000 -0
  393. sage_wheels/share/singular/LIB/nfmodsyz.lib +732 -0
  394. sage_wheels/share/singular/LIB/noether.lib +1106 -0
  395. sage_wheels/share/singular/LIB/normal.lib +8700 -0
  396. sage_wheels/share/singular/LIB/normaliz.lib +2226 -0
  397. sage_wheels/share/singular/LIB/ntsolve.lib +362 -0
  398. sage_wheels/share/singular/LIB/numerAlg.lib +560 -0
  399. sage_wheels/share/singular/LIB/numerDecom.lib +2261 -0
  400. sage_wheels/share/singular/LIB/olga.lib +1933 -0
  401. sage_wheels/share/singular/LIB/orbitparam.lib +351 -0
  402. sage_wheels/share/singular/LIB/parallel.lib +319 -0
  403. sage_wheels/share/singular/LIB/paraplanecurves.lib +3110 -0
  404. sage_wheels/share/singular/LIB/perron.lib +202 -0
  405. sage_wheels/share/singular/LIB/pfd.lib +2223 -0
  406. sage_wheels/share/singular/LIB/phindex.lib +642 -0
  407. sage_wheels/share/singular/LIB/pointid.lib +673 -0
  408. sage_wheels/share/singular/LIB/polybori.lib +1430 -0
  409. sage_wheels/share/singular/LIB/polyclass.lib +525 -0
  410. sage_wheels/share/singular/LIB/polylib.lib +1174 -0
  411. sage_wheels/share/singular/LIB/polymake.lib +1902 -0
  412. sage_wheels/share/singular/LIB/presolve.lib +1533 -0
  413. sage_wheels/share/singular/LIB/primdec.lib +9576 -0
  414. sage_wheels/share/singular/LIB/primdecint.lib +1782 -0
  415. sage_wheels/share/singular/LIB/primitiv.lib +401 -0
  416. sage_wheels/share/singular/LIB/puiseuxexpansions.lib +1631 -0
  417. sage_wheels/share/singular/LIB/purityfiltration.lib +960 -0
  418. sage_wheels/share/singular/LIB/qhmoduli.lib +1561 -0
  419. sage_wheels/share/singular/LIB/qmatrix.lib +293 -0
  420. sage_wheels/share/singular/LIB/random.lib +455 -0
  421. sage_wheels/share/singular/LIB/ratgb.lib +489 -0
  422. sage_wheels/share/singular/LIB/realclassify.lib +5759 -0
  423. sage_wheels/share/singular/LIB/realizationMatroids.lib +772 -0
  424. sage_wheels/share/singular/LIB/realrad.lib +1197 -0
  425. sage_wheels/share/singular/LIB/recover.lib +2628 -0
  426. sage_wheels/share/singular/LIB/redcgs.lib +3984 -0
  427. sage_wheels/share/singular/LIB/reesclos.lib +465 -0
  428. sage_wheels/share/singular/LIB/resbinomial.lib +2802 -0
  429. sage_wheels/share/singular/LIB/resgraph.lib +789 -0
  430. sage_wheels/share/singular/LIB/resjung.lib +820 -0
  431. sage_wheels/share/singular/LIB/resolve.lib +5110 -0
  432. sage_wheels/share/singular/LIB/resources.lib +170 -0
  433. sage_wheels/share/singular/LIB/reszeta.lib +5473 -0
  434. sage_wheels/share/singular/LIB/ring.lib +1328 -0
  435. sage_wheels/share/singular/LIB/ringgb.lib +343 -0
  436. sage_wheels/share/singular/LIB/rinvar.lib +1153 -0
  437. sage_wheels/share/singular/LIB/rootisolation.lib +1481 -0
  438. sage_wheels/share/singular/LIB/rootsmr.lib +709 -0
  439. sage_wheels/share/singular/LIB/rootsur.lib +886 -0
  440. sage_wheels/share/singular/LIB/rstandard.lib +607 -0
  441. sage_wheels/share/singular/LIB/rwalk.lib +336 -0
  442. sage_wheels/share/singular/LIB/sagbi.lib +1353 -0
  443. sage_wheels/share/singular/LIB/sagbiNormaliz.lib +1622 -0
  444. sage_wheels/share/singular/LIB/sagbiNormaliz0.lib +1498 -0
  445. sage_wheels/share/singular/LIB/sagbigrob.lib +449 -0
  446. sage_wheels/share/singular/LIB/schreyer.lib +321 -0
  447. sage_wheels/share/singular/LIB/schubert.lib +2551 -0
  448. sage_wheels/share/singular/LIB/sets.lib +524 -0
  449. sage_wheels/share/singular/LIB/sheafcoh.lib +1663 -0
  450. sage_wheels/share/singular/LIB/signcond.lib +437 -0
  451. sage_wheels/share/singular/LIB/sing.lib +1094 -0
  452. sage_wheels/share/singular/LIB/sing4ti2.lib +419 -0
  453. sage_wheels/share/singular/LIB/solve.lib +2243 -0
  454. sage_wheels/share/singular/LIB/spcurve.lib +1077 -0
  455. sage_wheels/share/singular/LIB/spectrum.lib +62 -0
  456. sage_wheels/share/singular/LIB/sresext.lib +757 -0
  457. sage_wheels/share/singular/LIB/ssi.lib +143 -0
  458. sage_wheels/share/singular/LIB/standard.lib +2769 -0
  459. sage_wheels/share/singular/LIB/stanleyreisner.lib +473 -0
  460. sage_wheels/share/singular/LIB/stdmodule.lib +547 -0
  461. sage_wheels/share/singular/LIB/stratify.lib +1070 -0
  462. sage_wheels/share/singular/LIB/surf.lib +506 -0
  463. sage_wheels/share/singular/LIB/surf_jupyter.lib +223 -0
  464. sage_wheels/share/singular/LIB/surfacesignature.lib +522 -0
  465. sage_wheels/share/singular/LIB/surfex.lib +1462 -0
  466. sage_wheels/share/singular/LIB/swalk.lib +877 -0
  467. sage_wheels/share/singular/LIB/symodstd.lib +1570 -0
  468. sage_wheels/share/singular/LIB/systhreads.lib +74 -0
  469. sage_wheels/share/singular/LIB/tasks.lib +1324 -0
  470. sage_wheels/share/singular/LIB/tateProdCplxNegGrad.lib +2412 -0
  471. sage_wheels/share/singular/LIB/teachstd.lib +858 -0
  472. sage_wheels/share/singular/LIB/template.lib +116 -0
  473. sage_wheels/share/singular/LIB/toric.lib +1119 -0
  474. sage_wheels/share/singular/LIB/transformation.lib +116 -0
  475. sage_wheels/share/singular/LIB/triang.lib +1197 -0
  476. sage_wheels/share/singular/LIB/tropical.lib +8741 -0
  477. sage_wheels/share/singular/LIB/tropicalEllipticCovers.lib +2922 -0
  478. sage_wheels/share/singular/LIB/tropicalNewton.lib +1128 -0
  479. sage_wheels/share/singular/LIB/tst.lib +1108 -0
  480. sage_wheels/share/singular/LIB/weierstr.lib +241 -0
  481. sage_wheels/share/singular/LIB/zeroset.lib +1478 -0
  482. sage_wheels/share/singular/emacs/.emacs-general +184 -0
  483. sage_wheels/share/singular/emacs/.emacs-singular +234 -0
  484. sage_wheels/share/singular/emacs/COPYING +44 -0
  485. sage_wheels/share/singular/emacs/cmd-cmpl.el +241 -0
  486. sage_wheels/share/singular/emacs/ex-cmpl.el +1681 -0
  487. sage_wheels/share/singular/emacs/hlp-cmpl.el +4318 -0
  488. sage_wheels/share/singular/emacs/lib-cmpl.el +179 -0
  489. sage_wheels/share/singular/emacs/singular.el +4273 -0
  490. sage_wheels/share/singular/emacs/singular.xpm +39 -0
  491. sage_wheels/share/singular/singular.idx +5002 -0
@@ -0,0 +1,4553 @@
1
+ //////////////////////////////////////////////////////////////////////////////
2
+ version="version arnold.lib 4.4.0.3 Jun_2024 "; // $Id: 608681047a5ce03775a162f832985a7a1a7d1d71 $
3
+ category="Commutative Algebra";
4
+ info="
5
+ LIBRARY: arnold.lib Classification of isolated singularities with a nondegenerate Newton Boundary
6
+ AUTHORS: Janko Boehm, email: boehm@mathematik.uni-kl.de
7
+ Magdaleen Marais, email: msmarais@sun.ac.za
8
+ Gerhard Pfister, email: pfister@mathematik.uni-kl.de
9
+
10
+ OVERVIEW:
11
+
12
+ We classify isolated singularities at 0 which is equivalent to a nondegenerate Newton boundary of corank <=2 with respect to right- and stable equivalence. We do this by @*
13
+ giving a unique normal form corresponding to a normalized nondegenerate Newton boundary. We furthermore determine the normal form equation, that is a polynomial in the @*
14
+ given normal form family of the input polynomial. In addition we determine the Milnor number, modality, delta invariant and the number of branches of an input polynomial @*
15
+ that is equivalent to a germ with a nondegenerate Newton boundary in a new alternative efficient way, as well as, a regular basis of a germ with a nondegenerate @*
16
+ Newton boundary.@*
17
+
18
+
19
+ V.I. Arnold has listed normal forms for all isolated hypersurface singularities over the complex numbers with, in particular, either modality <=2 or Milnor number <=16. @*
20
+ Moreover, he has described an algorithmic classifier, which determines the type of a given such singularity. @*
21
+ This library extends Arnold's work to a large class of singularities which is unbounded with regard to modality and Milnor number. It implements an algorithmic @*
22
+ classifier, which determines a normal form, as well as a normal form equation, for any corank <=2 singularity which is equivalent to a germ with non-degenerate Newton @*
23
+ boundary in the sense of Kouchnirenko.@*
24
+
25
+
26
+ The implementation is based on the papers:
27
+
28
+ Janko Boehm, Magdaleen Marais, Gerhard Pfister: Classification of Complex Singularities with Non-Degenerate Newton Boundary,@*
29
+ https://doi.org/10.48550/arXiv.2010.10185
30
+
31
+ Janko Boehm, Magdaleen Marais, Gerhard Pfister: Moduli Parameters of Complex Singularities with Non-Degenerate Newton Boundary,@*
32
+ https://doi.org/10.48550/arXiv.2402.05093
33
+
34
+ General assumption: the input polynomial is given in a ring with ordering ds;
35
+
36
+ Acknowledgements: This research was supported by the Rubbi fund of the Department of Mathematical Sciences of Stellenbosch University, DFG SPP 1489,@*
37
+ DFG TRR 195 (Project B5).
38
+
39
+ KEYWORDS:
40
+ singularities; classification; modality; delta invariant; determinacy bound; milnor number; normal form; normal form equation
41
+
42
+ SEE ALSO: realclassify_lib, classify_lib, classify2_lib, arnoldclassify_lib
43
+
44
+ PROCEDURES:
45
+ poshull(L); determine the convex hull of a list of monomials in mon[x,y]
46
+ monomials(f); determine the set of monomials of a polynomial
47
+ coeff(f,m); determine the coefficient of a given monomial of a polynomial
48
+ newtonPolygon(poly f); determine the Newton polygon of the points corresponding to the monomials of a polynomial
49
+ verticesOfNP(NP); determine the vertices of a Newton polygon
50
+ termsOnPolygon(f1,NP); determine the sum of the terms of a given polynomial of which the corresponding points lie on its corresponding Newton polygon
51
+ latticePoints(NP); determine all the points that lie on a given Newton polygon
52
+ latticeToMonomials(L); determine the corresponding monomials of a list of points
53
+ terms(f); determine the terms of a given polynomial
54
+ piecewiseWeightOfPolygon(NP); determine the piecewise weight defined by a given Newton polygon
55
+ piecewiseOrd(f,w); determine the piecewise order of a given polynomial with regard to a given piecewise weight
56
+ piecewisedegree(f,w); determine the piecewise degree of a given polynomial with regard to a given piecewise weight
57
+ piecewiseJet(f,w,d); determine the piecewise jet of a given polynomial of a given degree, with regard to a given piecewise weight
58
+ regularBasis(F,n); determine a regular basis for a polynomial with respect to the piecewise weight defined by its Newton polygon
59
+ determineNormalForm(F); determine a normal form, modality, milnor number, delta invariant, number of branches, determinacy bound and corank @*
60
+ of a given polynomial, if possible
61
+ normalForm(F); determine a normalform for F.value, if F is of type Poly, or return F.normalForm
62
+ determineExceptionalHypersurface(N); determine the exceptional hypersurface of the normalform stored in N.normalForm, and store the calculated hypersurface in the field N.exceptionalHypersurface
63
+ exceptionalHypersurface(N); return N.exceptionalHypersurface
64
+ determineNormalFormEquation(N); determine a normalform equation of a polynomial in the give normalform
65
+ normalFormEquation(N); return N.normalFormEquation
66
+ normalFormEquationUpToRescaling(N); N.normalFormEquationUpToRescaling, a germ which is right-equivalent to N.normalFormEquation, by the transformation x-->ax, y-->by, a,b complex numbers, such
67
+ that its ring is minimal
68
+ nondegeneratePart(N); determine the nondegenrate part of a singularity
69
+ germWithNNB(N); determine a germ with a nondegenrate Newton boundary that is equivalent to a given polynomial, if possible
70
+ determineGermWithSemiNormalizedNNB(N); determine a germ with a normalized nondegenerate Newton boundary that is equivalent to N.phi.sourcegerm.value
71
+ germWithSemiNormalizedNNB(N); return a germ with a nondegenerate normalized Newton boundary, up to scalar multiplication of each of its variables,@*
72
+ of a given polynomial, if possibles
73
+ modalityNNB(f); determine the modality of the singularity defined by a polynomial,if the polynomial is right equivalent to a germ with @*
74
+ a nondegenerate Newton boundary
75
+ milnorNNB(f); determine the Milnor number of a polynomial that is equivalent to a germ with a nondegenerate Newton boundary
76
+ determinacyBound(f); determine an upper bound for the determinacy of a polynomial
77
+ deltaNNB(f); determine the Delta invariant and number of branches of a polynomial that is right equivalent to a germ @*
78
+ with a nondegenerate Newton boundary
79
+ moduliMonomials(N); give the monomials corresponding to the moduli terms in a given normal form
80
+ determineArnoldType(N); determine the Arnold classification of N.phi.sourcegerm and store it in the field N.ArnoldType
81
+ ArnoldType(N); return the Arnold type of N.phi.sourcegerm.value
82
+ newtonNumber(F); determine the Newton number of a polynomial in Q[x,y]
83
+ transformationsBeforeSplit(N); the transformations (and in some cases their inverses) that was transformed on a given polynomial to write it as a direct sum @*
84
+ of its degenerate and nondegenerate parts, given up to filtration d, where d is a determinacy bound for the given polynomial
85
+ transformationsAfterSplit(N); the transformations (and in some cases their inverses) that was transformed on the degenerate part of a given polynomial @*
86
+ was splitted off to transform it to a germ with nondegenerate Newton boundary (in some cases the transformations normalize the Newton boundary is also given), @*
87
+ is given up to filtration d, where d is a determinacy bound for the polynomial, if possible
88
+ ";
89
+
90
+ LIB "gfanlib.so";
91
+ LIB "polyclass.lib";
92
+ LIB "absfact.lib";
93
+ LIB "primdec.lib";
94
+ LIB "realclassify.lib";
95
+ LIB "zeroset.lib";
96
+ LIB "elim.lib";
97
+ LIB "hnoether.lib";
98
+ LIB "arr.lib";
99
+ LIB "presolve.lib";
100
+ LIB "random.lib";
101
+ LIB "general.lib";
102
+ LIB "monomialideal.lib";
103
+ LIB "parallel.lib";
104
+ LIB "primitiv.lib";
105
+ LIB "transformation.lib";
106
+
107
+ static proc mod_init()
108
+ {
109
+ newstruct("List","ring in, number newFromOld, list values");
110
+ }
111
+
112
+ proc poshull(list L)
113
+ "USAGE: poshull(L); L list
114
+ RETURN: the cone generated by the integer vectors in L
115
+ EXAMPLE: example poshull, shows an example"
116
+ {
117
+ intmat A[size(L)][size(L[1])]=L[1..size(L)];
118
+ return(coneViaPoints(A));
119
+ }
120
+ example
121
+ {
122
+ "EXAMPLE:"; echo=2;
123
+ ring R=0,(x,y),ds;
124
+ intvec v1 = 1,1;
125
+ intvec v2=1,2;
126
+ def c = poshull(list(v1,v2));
127
+ c;
128
+ }
129
+
130
+ static proc facetsAsCones(cone c)
131
+ "USAGE: facetsAsCones(c); c cone
132
+ RETURN: return the facets of c as lists where the first entry is the normal vector and the second entry is a list of generators of the cone
133
+ EXAMPLE: example facetsAsCones, shows an example"
134
+ {
135
+ intmat R= intmat(rays(c));
136
+ intmat Fc=intmat(facets(c));
137
+ intmat M = intmat(facets(c)*transpose(R));
138
+ intmat r[1][ncols(R)];
139
+ int j;
140
+ int l=1;
141
+ list F;
142
+ for (int i=1;i<=nrows(M);i++)
143
+ {
144
+ list L;
145
+ l=1;
146
+ for (j=1;j<=ncols(M);j++)
147
+ {
148
+ if (M[i,j]==0)
149
+ {
150
+ r=R[j,1..ncols(R)];
151
+ L[l]=intvec(r);
152
+ l=l+1;
153
+ }
154
+ }
155
+ F[i]=list(intvec(Fc[i,1..ncols(Fc)]),L);kill L;
156
+ }
157
+ return(F);}
158
+ example
159
+ {
160
+ "EXAMPLE:"; echo=2;
161
+ ring R=0,(x,y),ds;
162
+ intvec v1 = 1,1;
163
+ intvec v2=1,2;
164
+ def c = poshull(list(v1,v2));
165
+ facetsAsCones(c);
166
+ }
167
+
168
+ proc monomials(poly f)
169
+ "USAGE: monomials(f); f poly
170
+ RETURN: the set of monomials of f as a list
171
+ EXAMPLE: example monomials, shows an example"
172
+ {
173
+ list L;
174
+ poly m;
175
+ poly p = f;
176
+ int i = 1;
177
+ while (p<>0)
178
+ {
179
+ L[i]=leadmonom(p);
180
+ p=p-lead(p);
181
+ i=i+1;
182
+ }
183
+ return(L);
184
+ }
185
+ example
186
+ {
187
+ "EXAMPLE:"; echo=2;
188
+ ring R=0,(x,y),ds;
189
+ poly f = 2*x^2+5*x*y+7*x^7;
190
+ monomials(f);
191
+ }
192
+
193
+ proc coeff(poly f, poly m)
194
+ "USAGE: coeff(f,m); f poly, m poly
195
+ RETURN: the coefficient of m in f
196
+ EXAMPLE: example coeff, shows an example"
197
+ {
198
+ poly p = f;
199
+ int i = 1;
200
+ while (p<>0)
201
+ {
202
+ if (m==leadmonom(p))
203
+ {
204
+ return(leadcoef(p));
205
+ }
206
+ p=p-lead(p);
207
+ }
208
+ return(0);
209
+ }
210
+ example
211
+ {
212
+ "EXAMPLE:"; echo=2;
213
+ ring R=0,(x,y),ds;
214
+ poly f = 2*x^2+5*x*y+7*x^7;
215
+ poly m = x*y;
216
+ coeff(f,m);
217
+ }
218
+
219
+ proc newtonPolygon(poly f)
220
+ "USAGE: newtonPolygon(f); poly f
221
+ RETURN: a list with an entry for each of the finite facets of f; each entry consists out of a list with first entry the normal vector of the corresponding facet and second entry @*
222
+ a list containing the coordinates of the vertices of the corresponding facet
223
+ EXAMPLE: example newtonPolygon, shows an example"
224
+ {
225
+ list M=monomials(f);
226
+ list E;
227
+ intvec v;
228
+ for (int i=1;i<=size(M);i++)
229
+ {
230
+ v=exponentvector(M[i]);
231
+ v[size(v)+1]=1;
232
+ E[i]=v;
233
+ }
234
+ E[size(M)+1]=intvec(1,0,0);
235
+ E[size(M)+2]=intvec(0,1,0);
236
+ cone cc = poshull(E);
237
+ list F=facetsAsCones(cc);
238
+ list F1;
239
+ list ry;
240
+ int r=1;
241
+ intvec nv;
242
+ intvec ry1,ry2;
243
+ list ryy;
244
+ list fi;
245
+ for (i=1;i<=size(F);i++)
246
+ {
247
+ ry=F[i][2];
248
+ nv=F[i][1];
249
+ nv=nv[1..2];
250
+ ry1=ry[1];ry1=ry1[1..2];
251
+ ry2=ry[2];ry2=ry2[1..2];
252
+ if (ry1[1]>ry2[1]) {ryy=list(ry2,ry1);} else {ryy=list(ry1,ry2);}
253
+ if ((ry[1][3]<>0) and (ry[2][3]<>0)){fi[r]=ryy[1][1];F1[r]=list(nv,ryy);r=r+1;}
254
+ }
255
+ intvec fii=sort(fi)[2];
256
+ list F2;
257
+ int j;
258
+ for (i=1;i<=size(fii);i++)
259
+ {
260
+ F2[i]=F1[fii[i]];
261
+ }
262
+ return(F2);
263
+ }
264
+ example
265
+ {
266
+ "EXAMPLE:"; echo=2;
267
+ ring R=0,(x,y),ds;
268
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8;
269
+ newtonPolygon(f);
270
+ }
271
+
272
+ proc verticesOfNP(list NP)
273
+ "USAGE: verticesOfNP(NP); NP list as given by @ref(newtonPolygon)
274
+ RETURN: the vertices of the Newton polygon NP as a list
275
+ EXAMPLE: example verticesOfNP, shows an example"
276
+ {
277
+ list L;
278
+ int j,jj;
279
+ intvec co;
280
+ L[1]=NP[1][2][1];
281
+ for (j=1;j<=size(NP);j++)
282
+ {
283
+ L[j+1]=NP[j][2][2];
284
+ }
285
+ return(L);
286
+ }
287
+ example
288
+ {
289
+ "EXAMPLE:"; echo=2;
290
+ ring R=(0),(x,y),ds;
291
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8;
292
+ list NP = newtonPolygon(f);
293
+ verticesOfNP(NP);
294
+ }
295
+
296
+ proc termsOnPolygon(poly f1,list NP)
297
+ "USAGE: termsOnPolygon(f, NP); poly f, NP list as given by @ref(newtonPolygon)
298
+ RETURN: the sum of the terms of f on the Newton polygon NP
299
+ EXAMPLE: example termsOnPolygon, shows an example"
300
+ {
301
+ list HB=latticePoints(NP);
302
+ poly g;
303
+ for (int j=1;j<=size(HB);j++)
304
+ {
305
+ g=g+coeff(f1,x^HB[j][1]*y^HB[j][2])*x^HB[j][1]*y^HB[j][2];
306
+ }
307
+ return(g);
308
+ }
309
+ example
310
+ {
311
+ "EXAMPLE:"; echo=2;
312
+ ring R=0,(x,y),ds;
313
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
314
+ list NP = newtonPolygon(f);
315
+ termsOnPolygon(f,NP);
316
+ }
317
+
318
+ proc latticePoints(list NP)
319
+ "USAGE: latticePoints(NP); NP list as given by @ref(newtonPolygon)
320
+ RETURN: a list of all the points lying on NP
321
+ EXAMPLE: example latticePoints, shows an example"
322
+ {
323
+ int maxx,maxy;
324
+ for (int i=1;i<=size(NP);i++)
325
+ {
326
+ if (NP[i][2][1][1]>maxx) {maxx=NP[i][2][1][1];}
327
+ if (NP[i][2][2][1]>maxx) {maxx=NP[i][2][2][1];}
328
+ if (NP[i][2][1][2]>maxy) {maxy=NP[i][2][1][2];}
329
+ if (NP[i][2][2][2]>maxy) {maxy=NP[i][2][2][2];}
330
+ }
331
+ int x,y;
332
+ list LP;
333
+ for (x=0;x<=maxx;x++)
334
+ {
335
+ for (y=0;y<=maxy;y++)
336
+ {
337
+ if (isOnPolygon(intvec(x,y),NP)){LP[size(LP)+1]=intvec(x,y);}
338
+ }
339
+ }
340
+ return(LP);
341
+ }
342
+ example
343
+ {
344
+ "EXAMPLE:"; echo=2;
345
+ ring R=0,(x,y),ds;
346
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
347
+ list NP = newtonPolygon(f);
348
+ latticePoints(NP);
349
+ }
350
+
351
+ proc latticeToMonomials(list L)
352
+ "USAGE: latticeToMonomials(L); a list L of points in N^2
353
+ RETURN: a list of monomials corresponding to the points in L
354
+ EXAMPLE: example latticeToMonomials, shows an example"
355
+ {
356
+ list M;
357
+ for (int i=1;i<=size(L);i++)
358
+ {
359
+ M[size(M)+1]=var(1)^(L[i][1])*var(2)^(L[i][2]);
360
+ }
361
+ return(M);
362
+ }
363
+ example
364
+ {
365
+ "EXAMPLE:"; echo=2;
366
+ ring R=0,(x,y),ds;
367
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
368
+ list NP = newtonPolygon(f);
369
+ list L =latticePoints(NP);
370
+ latticeToMonomials(L);
371
+ }
372
+
373
+ proc terms(poly f)
374
+ "USAGE: terms(f); poly f
375
+ RETURN: a list of the terms of f
376
+ EXAMPLE: example terms, shows an example"
377
+ {
378
+ list L;
379
+ poly m;
380
+ poly p = f;
381
+ int i = 1;
382
+ while (p<>0)
383
+ {
384
+ L[i]=lead(p);
385
+ p=p-lead(p);
386
+ i=i+1;
387
+ }
388
+ return(L);
389
+ }
390
+ example
391
+ {
392
+ "EXAMPLE:"; echo=2;
393
+ ring R=0,(x,y),ds;
394
+ poly f = 2*x^9+5*x^2*y^4+10*y^2*x^4+11*y^8+x^3*y^5+21*y^2*x^5;
395
+ terms(f);
396
+ }
397
+
398
+ proc piecewiseWeightOfPolygon(list NP)
399
+ "USAGE: piecewiseWeightOfPolygon(NP); a list NP as given by @ref(newtonPolygon)
400
+ RETURN: the piecewiseweight defined by the Newton polygon NP
401
+ EXAMPLE: example piecewiseWeightOfPolygon, shows an example"
402
+ {
403
+ if (size(NP)==1){return(list(NP[1][1]));}
404
+ list w;
405
+ list l;
406
+ intvec vt = setintersection(NP[1][2],NP[2][2])[1];
407
+ int d1=weighteddeg(var(1)^vt[1]*var(2)^vt[2],NP[1][1]);
408
+ int d2=weighteddeg(var(1)^vt[1]*var(2)^vt[2],NP[2][1]);
409
+ int c1 = lcm(d1,d2) div d1;
410
+ int c2 = lcm(d1,d2) div d2;
411
+ NP[1][1]=c1*NP[1][1];
412
+ NP[2][1]=c2*NP[2][1];
413
+ w =NP[1][1],NP[2][1];
414
+ for (int i=3;i<=size(NP);i++)
415
+ {
416
+ vt = setintersection(NP[i-1][2],NP[i][2])[1];
417
+ int d1=weighteddeg(var(1)^vt[1]*var(2)^vt[2],NP[i-1][1]);
418
+ int d2=weighteddeg(var(1)^vt[1]*var(2)^vt[2],NP[i][1]);
419
+ int c1 = lcm(d1,d2) div d1;
420
+ int c2 = lcm(d1,d2) div d2;
421
+ for (int j =1;j<=i-1;j++)
422
+ {
423
+ NP[j][1]=c1*NP[j][1];
424
+ }
425
+ NP[i][1]=c2*NP[i][1];
426
+ w=l;
427
+ for(int k=1;k<=i;k++)
428
+ {
429
+ w[size(w)+1]=NP[k][1];
430
+ }
431
+ }
432
+ return(w);
433
+ }
434
+ example
435
+ {
436
+ "EXAMPLE:"; echo=2;
437
+ ring R=0,(x,y),ds;
438
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
439
+ list NP = newtonPolygon(f);
440
+ piecewiseWeightOfPolygon(NP);
441
+ }
442
+
443
+ proc piecewiseOrd(poly f, list w)
444
+ "USAGE: piecewiseOrd(f,w); f poly, w a piecewise weight given by a list, which can be computed using @ref(piecewiseWeightOfPolygon)
445
+ RETURN: the piecewiseOrd with regard to the weight w of f
446
+ EXAMPLE: example piecewiseOrd, shows an example"
447
+ {
448
+ list Mon = monomials(f);
449
+ if(size(Mon)==0){return(-1);}
450
+ int d = piecewisedegree(Mon[1],w);
451
+ int d0;
452
+ for(int i=2;i<=size(Mon);i++)
453
+ {
454
+ d0 = piecewisedegree(Mon[i],w);
455
+ if(d0<d){d=d0;}
456
+ }
457
+ return(d);
458
+ }
459
+ example
460
+ {
461
+ "EXAMPLE:"; echo=2;
462
+ ring R=0,(x,y),ds;
463
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
464
+ list NP = newtonPolygon(f);
465
+ list w = piecewiseWeightOfPolygon(NP);
466
+ piecewiseOrd(f,w);
467
+ }
468
+
469
+ proc piecewisedegree(poly f, list pw)
470
+ "USAGE: piecewisedegree(f,w); f poly, w a piecewise weight given by a list, which can be computed using @ref(piecewiseWeightOfPolygon)
471
+ RETURN: the piecewise degree of f, with regard to the weight w
472
+ EXAMPLE: example piecewisedegree, shows an example"
473
+ {
474
+ list mon = monomials(f);
475
+ int d3=0;
476
+ for(int i=1;i<=size(mon);i++)
477
+ {
478
+ int d1=weighteddeg(mon[i],pw[1]);
479
+ int d2;
480
+ for (int j=2;j<=size(pw);j++){
481
+ d2=weighteddeg(mon[i],pw[j]);
482
+ if(d2<d1){d1=d2;}
483
+ }
484
+ if(d1>d3){d3=d1;}
485
+ }
486
+ return(d3);}
487
+ example
488
+ {
489
+ "EXAMPLE:"; echo=2;
490
+ ring R=0,(x,y),ds;
491
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
492
+ list NP = newtonPolygon(f);
493
+ list w = piecewiseWeightOfPolygon(NP);
494
+ piecewisedegree(f,w);
495
+ }
496
+
497
+ proc piecewiseJet(poly f, list pw, int d)
498
+ "USAGE: piecewiseJet(f,w,d); f poly, w a piecewise weight given by a list, which can be computed using @ref(piecewiseWeightOfPolygon), d int
499
+ RETURN: the piecewise d-jet of f, with regard to the weight w
500
+ EXAMPLE: example piecewiseJet, shows an example"
501
+ {
502
+ if (f==0){return(f);}
503
+ poly ff=0;
504
+ poly g(0)=0;
505
+ for(int i=1;i<=size(pw);i++)
506
+ {
507
+ poly g(i)= jet(f,d,pw[i]);
508
+ ff=ff+g(i)-jet(g(i-1),d,pw[i]);
509
+ }
510
+ return(ff);}
511
+ example
512
+ {
513
+ "EXAMPLE:"; echo=2;
514
+ ring R=0,(x,y),ds;
515
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
516
+ list NP = newtonPolygon(f);
517
+ list w = piecewiseWeightOfPolygon(NP);
518
+ int d =piecewiseOrd(f,w);
519
+ piecewiseJet(f,w,d);
520
+ }
521
+
522
+ proc determineNormalForm(Poly F)
523
+ "USAGE: determineNormalForm(F); F poly
524
+ RETURN: if F.value is right equivalent to a germ with a nondegenerate Newton boundary an N of type NormalForm with fields:@*
525
+ N.inputRing: the ring F.in@*
526
+ @*
527
+ N.numbervars: the embedding dimension (given as type int)@*
528
+ @*
529
+ N.normalForm: a normal form of F.value (given as type Poly)@*
530
+ @*
531
+ N.singularityType: the corner points of the Newton boundary of the normal form of F.value, which classifies the singularity type (given as type string)@*
532
+ @*
533
+ N.parameters: the monomials corresponding to the moduli terms in N.normalForm @*
534
+ (given as a list with entries of type Poly over the ring N.phi.targetgerm.in)@*
535
+ @*
536
+ N.corank: the corank of the singularity defined by F.value (given as type int)@*
537
+ @*
538
+ N.modality: the modality of the singularity defined by F.value (given as type int)@*
539
+ @*
540
+ N.milnorNumber: the Milnor number of F.value (given as type int)@*
541
+ @*
542
+ N.delta: the Delta invariant of F.value (given as type int)@*
543
+ @*
544
+ N.numberOfBranches: the number of branches of F.value (given as type int)@*
545
+ @*
546
+ N.determinacy: a determinacy bound for F.value (given as type int)@*
547
+ @*
548
+ N.nondegeneratePart: the nondegenerate part of the normal form of F.value (given as type Poly)@*
549
+ @*
550
+ N.nonNormalizedNNBGerm: a polynomial that is stable equivalent to F.value with a nondegenerate Newton boundary @*
551
+ (that is not necessarily normalized, given as type Poly)@*
552
+ @*
553
+ N.semiNormalizedNNBGerm: a polynomial that is stable equivalent to F.value with a normalized nondegenerate Newton boundary up to scalar multiplication @*
554
+ of each of its variables (given as type Poly)@*
555
+ @*
556
+ N.phiBeforeMorseSplit: the transformations (and in some cases their inverses) of the transformations that was transformed on F.value to write F.value @*
557
+ as a direct sum of its degenerate and nondegenerate parts, given up to filtration d, where d is a determinacy bound for F.value @*
558
+ (given as type RightEquivalenceChainWithPrecision as defined in @ref(polyclass.lib))@*
559
+ @*
560
+ N.phi: the transformations (and in some cases their inverses) of the transformations that was transformed on the degenerate part of F.value to transform @*
561
+ it to a germ with nondegenerate Newton boundary (in some cases the transformations normalize the Newton boundary is also given),@*
562
+ is given up to filtration d, where d is a determinacy bound for F.value (given as type RightEquivalenceChainWithPrecision as @*
563
+ defined in @ref(polyclass.lib)),@*
564
+
565
+ an ERROR message otherwise
566
+ EXAMPLE: example determineNormalForm, shows an example"
567
+ {
568
+ def B = basering;
569
+ def R = F.in;
570
+ setring R;
571
+ poly f = F.value;
572
+ if(ord(f)<2)
573
+ {
574
+ ERROR("The input Polynomial is not in m^2.")
575
+ }
576
+ RightEquivalenceChainWithPrecision Tr;
577
+ RightEquivalenceChainWithPrecision TrMorse;
578
+ NormalForm N;
579
+ poly ff=0;
580
+ Poly FF = makePoly(ff);
581
+ N.semiNormalizedNNBGerm =FF;
582
+ N.normalFormEquation=FF;
583
+ N.normalFormEquationUpToRescaling=FF;
584
+ poly h1=0;
585
+ Poly H1 = makePoly(h1);
586
+ N.extension1 = H1;
587
+ poly h2=0;
588
+ Poly H2 = makePoly(h2);
589
+ poly eh = -1;
590
+ Poly EH =makePoly(eh);
591
+ N.exceptionalHypersurface=EH;
592
+ N.extension2 = H2;
593
+ N.inputRing =F.in;
594
+ N.numbervars = nvars(F.in);
595
+ list L;
596
+ Tr.sourcegerm = F;
597
+ Tr.targetgerm = F;
598
+ L = classifyNB(Tr,1,0,1);
599
+ if(L[1]==-1){ERROR("The input polynomial is degenerate, that is, has infinite milnornumber.");return(N);}
600
+ N.milnorNumber = L[1];
601
+ Tr = L[2];
602
+ if(L[6]==1)
603
+ {
604
+ Poly P =Tr.targetgerm;
605
+ def S = P.in;
606
+ setring S;
607
+ N.nonNormalizedNNBGerm=P;
608
+ poly f = P.value;
609
+ list NP = newtonPolygon(f);
610
+ list V =latticePoints(NP);
611
+ list Vm = latticeToMonomials(V);
612
+ f=0;
613
+ int l1;
614
+ int l2;
615
+ for (int i = 1;i<=size(Vm);i++)
616
+ {
617
+ if(leadexp(Vm[i])[1]==1){l1=1;}
618
+ if(leadexp(Vm[i])[2]==1){l2=1;}
619
+ f = f+Vm[i];
620
+ }
621
+ if(l1==1)
622
+ {
623
+ poly fy = subst(f,var(1),0);
624
+ f=f-fy;
625
+ f =f+var(2)^(L[1]+1);
626
+ }
627
+ if(l2==1)
628
+ {
629
+ poly fx = subst(f,var(2),0);
630
+ f=f-fx;
631
+ f =f+var(1)^(L[1]+1);
632
+ }
633
+ Poly P = makePoly(f);
634
+ }
635
+ else
636
+ {
637
+ Poly P =Tr.targetgerm;
638
+ def S = P.in;
639
+ setring S;
640
+ if(L[3]<>0)
641
+ {
642
+ N.nonNormalizedNNBGerm=P;
643
+ N.semiNormalizedNNBGerm = P;
644
+ }
645
+ else
646
+ {
647
+ Poly J = makePoly(0);
648
+ N.nonNormalizedNNBGerm=J;
649
+ N.semiNormalizedNNBGerm = J;
650
+ }
651
+ }
652
+ TrMorse = L[5];
653
+ Poly H = L[4];
654
+ N.nondegeneratePart=H;
655
+ N.phiBeforeMorseSplit = TrMorse;
656
+ N.corank = L[3];
657
+ if(L[3]<>0 && L[3]<>1)
658
+ {
659
+ list RB = regularBasis(P,1);
660
+ }
661
+ else
662
+ {
663
+ list RB;
664
+ }
665
+ int sRB = size(RB);
666
+ N.determinacy = Tr.precision;
667
+ if(L[3]<>0 && L[3]<>1)
668
+ {
669
+ list NB = newtonPolygon(P.value);
670
+ int n = size(NB);
671
+ int a = 0;
672
+ number b;
673
+ number c;
674
+ while(0==0)
675
+ {
676
+ b = number(NB[n-a][1][2])/number(NB[n-a][1][1]);
677
+ c = number(NB[a+1][1][1])/number(NB[a+1][1][2]);
678
+ if(b<c)
679
+ {
680
+ map phi = S,var(2),var(1);
681
+ poly p = Tr.targetgerm.value;
682
+ Tr.targetgerm.value = phi(p);
683
+ N.nonNormalizedNNBGerm=Tr.targetgerm;
684
+ PolynomialRightEquivalence RE;
685
+ RE.in=basering;
686
+ RE.images = list(makePoly(var(2)),makePoly(var(1)));
687
+ Tr.transformations[size(Tr.transformations)+1]=RE;
688
+
689
+ poly f = P.value;
690
+ f=phi(f);
691
+ P.value=f;
692
+ poly rbp;
693
+ for(int i=1;i<=size(RB);i++)
694
+ {
695
+ rbp=RB[i];
696
+ RB[i]=phi(rbp);
697
+ }
698
+ NB = newtonPolygon(P.value);
699
+ break;
700
+ }
701
+ a=a+1;
702
+ if(a+1>=(n-a)){break;}
703
+ }
704
+ string s= "("+string(NB[1][2][1][1])+","+string(NB[1][2][1][2])+")";
705
+ for(int i=1;i<=n;i++)
706
+ {
707
+ s =s+",("+string(NB[i][2][2][1])+","+string(NB[i][2][2][2])+")";
708
+ }
709
+ N.singularityType=s;
710
+ list V =verticesOfNP(NB);
711
+ list M = latticeToMonomials(V);
712
+ ring K = (0,a(1..size(RB))),(var(1),var(2)),ds;
713
+ setring K;
714
+ poly f;
715
+ list M=fetch(S,M);
716
+ if(sRB<>0)
717
+ {
718
+ list RB = fetch(S,RB);
719
+ }
720
+ else
721
+ {
722
+ list RB;
723
+ }
724
+ list SM = setminus(M,RB);
725
+ for(int i=1;i<=size(SM);i++)
726
+ {
727
+ f=f+SM[i];
728
+ }
729
+ for(i=1;i<=size(RB);i++)
730
+ {
731
+ f=f+a(i)*RB[i];
732
+ }
733
+ Poly F=makePoly(f);
734
+ N.normalForm=F;
735
+ setring R;
736
+ }
737
+ else
738
+ {
739
+ N.singularityType = "("+string(L[1])+")";
740
+ setring P.in;
741
+ P.value = leadmonom(P.value);
742
+ N.normalForm =P;
743
+ setring R;
744
+ }
745
+ if(L[3]<>0 && L[3]<>1)
746
+ {
747
+ list Q = deltaInvariant(P,L[1]);
748
+ N.delta = Q[1];
749
+ N.numberOfBranches = Q[2];
750
+ }
751
+ else
752
+ {
753
+ N.delta = L[1];
754
+ N.numberOfBranches =1;
755
+ }
756
+ setring S;
757
+ if(L[3]<>0 && L[3]<>1)
758
+ {
759
+ for(int i = 1;i<=size(RB);i++)
760
+ {
761
+ RB[i]=makePoly(RB[i]);
762
+ }
763
+ N.parameters = RB;
764
+ }
765
+ else
766
+ {
767
+ list RB;
768
+ N.parameters = RB;
769
+ }
770
+ int n = size(RB);
771
+ setring R;
772
+ N.modality=n;
773
+ poly g=0;
774
+ Poly G = makePoly(g);
775
+ G.value = g;
776
+ N.normalFormEquation = G;
777
+ N.phi=Tr;
778
+ setring B;
779
+ return(N);
780
+ }
781
+ example
782
+ {
783
+ "EXAMPLE:"; echo=2;
784
+ ring R = 0,(x,y,z),ds;
785
+ poly g = (x^2+y^2)^2+5*x^(10)+y^(11)+z^2;
786
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
787
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
788
+ poly phiz = z+2*x+x^2+y^4*x;
789
+ map phi = R,phix,phiy,phiz;
790
+ g = phi(g);
791
+ Poly F = makePoly(g);
792
+ determineNormalForm(F);
793
+ }
794
+
795
+ proc normalForm(def F)
796
+ "USAGE: normalForm(F); F Poly or F NormalForm which can be computed using @ref(determineNormalForm)
797
+ RETURN: the normalform of F.value or N.normalForm
798
+ EXAMPLE: example normalForm, shows an example"
799
+ {
800
+ def S = basering;
801
+ NormalForm N;
802
+ if(typeof(F)=="Poly")
803
+ {
804
+ N= determineNormalForm(F);
805
+ }
806
+ if(typeof(F)=="NormalForm")
807
+ {
808
+ N=F;
809
+ }
810
+ Poly G = N.normalForm;
811
+ setring S;
812
+ return(G);
813
+ }
814
+ example
815
+ {
816
+ "EXAMPLE:"; echo=2;
817
+ ring R = 0,(x,y,z),ds;
818
+ poly g = (x^2+y^2)^2+5*x^(10)+y^(11)+z^2;
819
+ g = x^2*y^4+y^2*x^4+5*x^(10)+y^(11)+x^4*y^3+z^2;
820
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
821
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
822
+ poly phiz = z+2*x+x^2+y^4*x;
823
+ map phi = R,phix,phiy,phiz;
824
+ g = phi(g);
825
+ Poly F = makePoly(g);
826
+ NormalForm N;
827
+ N=determineNormalForm(F);
828
+ normalForm(F);
829
+ normalForm(N);
830
+ }
831
+
832
+ proc determineExceptionalHypersurface(NormalForm N)
833
+ "USAGE: determineExceptionalHypersurface(N); N a NormalForm as given by @ref(determineNormalForm)
834
+ RETURN: a polynomial defining the exceptional hypersurface for the normal form stored in N.normalForm, i.e. the parameter values that are not allowed for N.normalForm, stored in N.exceptionalHypersurface @*
835
+ EXAMPLE: example determineExceptionalHypersurface, shows an example"
836
+ {
837
+ def R = basering;
838
+ int c = N.corank;
839
+ if(c==1){poly f = 1; Poly F = makePoly(f);N.exceptionalHypersurface=F;return(N);}
840
+ def S = N.normalForm.in;
841
+ setring S;
842
+ list L = ringlist(S);
843
+ int n = size(L[1][2]);
844
+ ring T = 0,(var(1),var(2),a(1..n)),ds;
845
+ setring T;
846
+ poly g;
847
+ poly PolyTermsOnDelta;
848
+ poly diffPolyTermsOnDelta;
849
+ setring S;
850
+ if(size(N.normalForm.value)==0)
851
+ {
852
+ ERROR("a Normalform has not yet been determined.")
853
+ }
854
+ poly f = N.normalForm.value;
855
+ list NP = newtonPolygon(f);
856
+ list Delta;
857
+ int j = size(NP);
858
+ poly termsOnDelta;
859
+ poly PolyTermsOnDelta;
860
+ poly diffPolyTermsOnDelta;
861
+ for(int i=1;i<=j;i++)
862
+ {
863
+ Delta[1]=NP[i];
864
+ termsOnDelta = termsOnPolygon(f,Delta);
865
+ PolyTermsOnDelta=sat_with_exp(ideal(termsOnDelta),ideal(var(1)*var(2)))[1][1];
866
+ if(Delta[1][1][1]>Delta[1][1][2])
867
+ {
868
+ PolyTermsOnDelta=subst(PolyTermsOnDelta,var(1),1);
869
+ diffPolyTermsOnDelta=diff(PolyTermsOnDelta,var(2));
870
+ }
871
+ else
872
+ {
873
+ PolyTermsOnDelta=subst(PolyTermsOnDelta,var(2),1);
874
+ diffPolyTermsOnDelta=diff(PolyTermsOnDelta,var(1));
875
+ }
876
+ setring T;
877
+ poly PolyTermsOnDelta = imap(S,PolyTermsOnDelta);
878
+ poly diffPolyTermsOnDelta = imap(S,diffPolyTermsOnDelta);
879
+ if(Delta[1][1][1]>Delta[1][1][2])
880
+ {
881
+ poly h = resultant(PolyTermsOnDelta,diffPolyTermsOnDelta,var(2));
882
+ }
883
+ else
884
+ {
885
+ poly h = resultant(PolyTermsOnDelta,diffPolyTermsOnDelta,var(1));
886
+ }
887
+ if(g<>0)
888
+ {
889
+ g=g*h;
890
+ }
891
+ else
892
+ {
893
+ g=h;
894
+ }
895
+ setring S;
896
+ }
897
+ setring T;
898
+ ideal I = g;
899
+ I=radical(I);
900
+ Poly G = makePoly(I[1]);
901
+ N.exceptionalHypersurface=G;
902
+ setring R;
903
+ return(N);
904
+ }
905
+ example
906
+ {
907
+ ring R = 0,(x,y,z),ds;
908
+ poly g = x^2*y^4+y^2*x^4+5*x^(10)+y^(11)+z^2;
909
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
910
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
911
+ poly phiz = z+2*x+x^2+y^4*x;
912
+ map phi = R,phix,phiy,phiz;
913
+ g = phi(g);
914
+ Poly F = makePoly(g);
915
+ NormalForm N= determineNormalForm(F);
916
+ determineExceptionalHypersurface(N);
917
+ }
918
+
919
+ proc exceptionalHypersurface(NormalForm N)
920
+ "USAGE: exceptionalHypersurface(N); N NormalForm of which the field N.exceptionalHypersurface is filled using @ref(determineNormalForm) and using @ref(determineExceptionalHypersurface)
921
+ RETURN: N.exceptionalHypersurface
922
+ EXAMPLE: example exceptionalHypersurface, shows an example"
923
+ {
924
+ def S = basering;
925
+ Poly F = N.exceptionalHypersurface;
926
+ def R = F.in;
927
+ setring R;
928
+ if(F.value<>-1)
929
+ {
930
+ setring S;
931
+ return(F);
932
+ }
933
+ else
934
+ {
935
+ N=determineExceptionalHypersurface(N);
936
+ F = N.exceptionalHypersurface;
937
+ setring S;
938
+ return(F);
939
+ }
940
+ }
941
+ example
942
+ {
943
+ ring R = 0,(x,y,z),ds;
944
+ poly g = x^2*y^4+y^2*x^4+5*x^(10)+y^(11)+z^2;
945
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
946
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
947
+ poly phiz = z+2x+x^2+y^4*x;
948
+ map phi = R,phix,phiy,phiz;
949
+ g = phi(g);
950
+ Poly F = makePoly(g);
951
+ NormalForm N= determineNormalForm(F);
952
+ N=determineExceptionalHypersurface(N);
953
+ exceptionalHypersurface(N);
954
+ }
955
+
956
+
957
+ proc nondegeneratePart(NormalForm N)
958
+ "USAGE: nondegeneratePart(N); N NormalForm as given by @ref(determineNormalForm)
959
+ RETURN: the nondegenerate part, returned as type Poly, of the singularity defined by N.phi.sourcegerm.value
960
+ EXAMPLE: example nondegeneratePart, shows an example"
961
+ {
962
+ return(N.nondegeneratePart);
963
+ }
964
+ example
965
+ {
966
+ "EXAMPLE:"; echo=2;
967
+ ring R = 0,(x,y,z),ds;
968
+ poly g = (x^2+y^2)^2+5*x^(10)+y^(11)+z^2;
969
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
970
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
971
+ poly phiz = z+2x+x^2+y^4*x;
972
+ map phi = R,phix,phiy,phiz;
973
+ g = phi(g);
974
+ Poly F = makePoly(g);
975
+ NormalForm N = determineNormalForm(F);
976
+ nondegeneratePart(N);
977
+ }
978
+
979
+ proc germWithNNB(NormalForm N)
980
+ "USAGE: germWithNNB(N); N NormalForm as given by @ref(determineNormalForm)
981
+ RETURN: a germ with a nondegenerate Newton boundary, returned as type Poly, that is stable equivalent to N.phi.sourcegerm.value, if possible, or an ERROR message otherwise
982
+ EXAMPLE: example germWithNNB, shows an example"
983
+ {
984
+ return(N.nonNormalizedNNBGerm);
985
+ }
986
+ example
987
+ {
988
+ "EXAMPLE:"; echo=2;
989
+ ring R = 0,(x,y),ds;
990
+ poly g = (x^2+y^2)^2+5*x^(10)+y^(11);
991
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
992
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
993
+ map phi = R,phix,phiy;
994
+ g = phi(g);
995
+ Poly F = makePoly(g);
996
+ NormalForm N = determineNormalForm(F);
997
+ germWithNNB(N);
998
+ }
999
+
1000
+ proc determineGermWithSemiNormalizedNNB(NormalForm N)
1001
+ "USAGE: germWithSemiNormalizedNNB(N); N NormalForm as given by @ref(determineNormalForm)
1002
+ RETURN: a polynomial, stored in N.phi.targetgerm, that is stable equivalent to N.phi.sourcegerm.value with a normalized nondegenerate Newton boundary up to scalar multiplication @*
1003
+ of each of its variables, if possible, or an ERROR message otherwise
1004
+ EXAMPLE: example germWithSemiNormalizedNNB, shows an example"
1005
+ {
1006
+ ring R = basering;
1007
+ Poly FF =N.semiNormalizedNNBGerm;
1008
+ def S = FF.in;
1009
+ setring S;
1010
+ if(FF.value <>0 || N.corank==0)
1011
+ {
1012
+ setring R;
1013
+ return(N.semiNormalizedNNBGerm);
1014
+ }
1015
+ else
1016
+ {
1017
+ RightEquivalenceChainWithPrecision Tr1;
1018
+ Tr1 = N.phi;
1019
+ list L =classifyNB(Tr1,0,1,1);
1020
+ Tr1 = L[2];
1021
+ Poly H = Tr1.targetgerm;
1022
+ def RR = H.in;
1023
+ setring RR;
1024
+ if(H.value==0)
1025
+ {
1026
+ ERROR("The degenerate part of the germ is 0");
1027
+ }
1028
+ N.semiNormalizedNNBGerm=Tr1.targetgerm;
1029
+ N.phi = Tr1;
1030
+ setring R;
1031
+ return(N);
1032
+ }
1033
+ }
1034
+ example
1035
+ {
1036
+ "EXAMPLE:"; echo=2;
1037
+ ring R = 0,(x,y),ds;
1038
+ poly g = (x^2+y^2)^2+5*x^(10)+y^(11);
1039
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
1040
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
1041
+ map phi = R,phix,phiy;
1042
+ g = phi(g);
1043
+ Poly F = makePoly(g);
1044
+ NormalForm N = determineNormalForm(F);
1045
+ N=determineGermWithSemiNormalizedNNB(N);
1046
+ }
1047
+
1048
+
1049
+ proc germWithSemiNormalizedNNB(NormalForm N)
1050
+ "USAGE: germWithSemiNormalizedNNB(N); N NormalForm as given by @ref(determineNormalizedNNBGerm)
1051
+ RETURN: a polynomial, returned as a Poly, that is stable equivalent to N.phi.sourcegerm.value with a normalized nondegenerate Newton boundary up to scalar multiplication @*
1052
+ of each of its variables, if possible, or an ERROR message otherwise
1053
+ EXAMPLE: example germWithSemiNormalizedNNB, shows an example"
1054
+ {
1055
+ ring R = basering;
1056
+ Poly FF =N.semiNormalizedNNBGerm;
1057
+ def S = FF.in;
1058
+ setring S;
1059
+ if(FF.value ==0 && N.corank<>0)
1060
+ {
1061
+ ERROR"The input germ is not transformed to a germ with a normalized nondegernerate Newton boundary";
1062
+ }
1063
+ else
1064
+ {
1065
+ return(N.semiNormalizedNNBGerm);
1066
+ }
1067
+ }
1068
+ example
1069
+ {
1070
+ "EXAMPLE:"; echo=2;
1071
+ ring R = 0,(x,y),ds;
1072
+ poly g = (x^2+y^2)^2+5*x^(10)+y^(11);
1073
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
1074
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
1075
+ map phi = R,phix,phiy;
1076
+ g = phi(g);
1077
+ Poly F = makePoly(g);
1078
+ NormalForm N = determineNormalForm(F);
1079
+ N=determineGermWithSemiNormalizedNNB(N);
1080
+ germWithSemiNormalizedNNB(N);
1081
+ }
1082
+
1083
+
1084
+ proc modalityNNB(def f)
1085
+ "USAGE: modalityNNB(f,w); f poly or Poly or NormalForm
1086
+ RETURN: the modality of f (or f.value or f.phi.sourcegerm.value), if f (or f.value or f.phi.sourcegerm.value) is equivalent to a germ with a nondegenerate Newton boundary, @*
1087
+ or an ERROR message otherwise
1088
+ EXAMPLE: example modalityNNB, shows an example"
1089
+ {
1090
+ int k=0;
1091
+ if(typeof(f)=="poly")
1092
+ {
1093
+ Poly F = makePoly(f);
1094
+ k=1;
1095
+ }
1096
+ if(typeof(f)=="Poly")
1097
+ {
1098
+ Poly F = f;
1099
+ k=1;
1100
+ }
1101
+ if(typeof(f)=="NormalForm")
1102
+ {
1103
+ int m = f.modality;
1104
+ return(m);
1105
+ }
1106
+ if(k==0)
1107
+ {
1108
+ ERROR("Input of wrong type.");
1109
+ }
1110
+ RightEquivalenceChainWithPrecision Tr;
1111
+ Tr.sourcegerm = F;
1112
+ Tr.targetgerm = F;
1113
+ list L = classifyNB(Tr,0,0,1);
1114
+ Tr = L[2];
1115
+ F = Tr.targetgerm;
1116
+ int m = modalityNB(F);
1117
+ return(m);
1118
+ }
1119
+ example
1120
+ {
1121
+ "EXAMPLE:"; echo=2;
1122
+ ring R=0,(x,y),ds;
1123
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
1124
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
1125
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
1126
+ map phi = R,phix,phiy;
1127
+ f = phi(f); // f is equivalent to a germ with a nondegenerate Newton boundary
1128
+ Poly F = makePoly(f);
1129
+ NormalForm N;
1130
+ N = determineNormalForm(F);
1131
+ modalityNNB(f);
1132
+ modalityNNB(F);
1133
+ modalityNNB(N);
1134
+ }
1135
+
1136
+ proc milnorNNB(def f)
1137
+ "USAGE: milnorNNB(f,w); f poly or Poly or NormalForm
1138
+ RETURN: the Milnor number of f (or f.value or f.phi.sourcegerm.value), if f (or f.value or f.phi.sourcegerm.value) is equivalent to a germ with a nondegenerate Newton boundary, @*
1139
+ or an ERROR message otherwise
1140
+ EXAMPLE: example milnorNNB, shows an example"
1141
+ {
1142
+ int k =0;
1143
+ if(typeof(f)=="poly")
1144
+ {
1145
+ Poly F = makePoly(f);
1146
+ k=1;
1147
+ }
1148
+ if(typeof(f)=="Poly")
1149
+ {
1150
+ Poly F = f;
1151
+ k=1;
1152
+ }
1153
+ if(typeof(f)=="NormalForm")
1154
+ {
1155
+ int m = f.milnorNumber;
1156
+ return(m);
1157
+ }
1158
+ if(k==0)
1159
+ {
1160
+ ERROR("Input of wrong type.");
1161
+ }
1162
+ RightEquivalenceChainWithPrecision Tr;
1163
+ Tr.sourcegerm = F;
1164
+ Tr.targetgerm = F;
1165
+ list L = classifyNB(Tr,0,0,1);
1166
+ int m = L[1];
1167
+ return(m);
1168
+ }
1169
+ example
1170
+ {
1171
+ "EXAMPLE:"; echo=2;
1172
+ ring R=0,(x,y),ds;
1173
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
1174
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
1175
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
1176
+ map phi = R,phix,phiy;
1177
+ f = phi(f); // f is equivalent to a germ with a nondegenerate Newton boundary
1178
+ Poly F = makePoly(f);
1179
+ NormalForm N = determineNormalForm(F);
1180
+ milnorNNB(f);
1181
+ milnorNNB(F);
1182
+ milnorNNB(N);
1183
+ }
1184
+
1185
+ proc determinacyBound(def f)
1186
+ "USAGE: determinacyBound(f); f poly or Poly or NormalForm
1187
+ RETURN: an upper bound for the determinacy bound of f (or f.value or f.phi.sourcegerm.value)
1188
+ EXAMPLE: example determinacyBound, shows an example"
1189
+ {
1190
+ int k =0;
1191
+ if(typeof(f)=="poly")
1192
+ {
1193
+ Poly F = makePoly(f);
1194
+ k=1;
1195
+ }
1196
+ if(typeof(f)=="Poly")
1197
+ {
1198
+ Poly F = f;
1199
+ k=1;
1200
+ }
1201
+ if(typeof(f)=="NormalForm")
1202
+ {
1203
+ int d = f.determinacy;
1204
+ return(d);
1205
+ }
1206
+ if(k==0)
1207
+ {
1208
+ ERROR("Input of wrong type.");
1209
+ }
1210
+ RightEquivalenceChainWithPrecision Tr;
1211
+ Tr.sourcegerm = F;
1212
+ Tr.targetgerm = F;
1213
+ Tr = truncateAtHighestCorner(Tr);
1214
+ int d =Tr.precision;
1215
+ return(d);
1216
+ }
1217
+ example
1218
+ {
1219
+ "EXAMPLE:"; echo=2;
1220
+ ring R=0,(x,y),ds;
1221
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
1222
+ Poly F = makePoly(f);
1223
+ NormalForm N = determineNormalForm(F);
1224
+ determinacyBound(f);
1225
+ determinacyBound(F);
1226
+ determinacyBound(N);
1227
+ }
1228
+
1229
+ proc deltaNNB(def f)
1230
+ "USAGE: deltaNNB(f); f poly or Poly or NormalForm
1231
+ RETURN: a List with entries d,n, where d is the Delta invariant and n is the number of branches of f (or f.value or f.phi.sourcegerm.value), if f (or f.value or f.phi.sourcegerm.value) @*
1232
+ is equivalent to a germ with a nondegenerate Newton Boundary, or an ERROR message otherwise
1233
+ EXAMPLE: example deltaNNB, shows an example"
1234
+ {
1235
+ int k =0;
1236
+ if(typeof(f)=="poly")
1237
+ {
1238
+ Poly F = makePoly(f);
1239
+ k=1;
1240
+ }
1241
+ if(typeof(f)=="Poly")
1242
+ {
1243
+ Poly F = f;
1244
+ k=1;
1245
+ }
1246
+ if(typeof(f)=="NormalForm")
1247
+ {
1248
+ int d = f.delta;
1249
+ int n = f.numberOfBranches;
1250
+ list Q = d,n;
1251
+ return(Q);
1252
+ }
1253
+ if(k==0)
1254
+ {
1255
+ ERROR("Input of wrong type.");
1256
+ }
1257
+ RightEquivalenceChainWithPrecision Tr;
1258
+ Tr.sourcegerm = F;
1259
+ Tr.targetgerm = F;
1260
+ list L = classifyNB(Tr,0,0,1);
1261
+ Tr =L[2];
1262
+ Poly P = Tr.targetgerm;
1263
+ list Q = deltaInvariant(P,L[1]);
1264
+ return(Q);
1265
+ }
1266
+ example
1267
+ {
1268
+ "EXAMPLE:"; echo=2;
1269
+ ring R=0,(x,y),ds;
1270
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
1271
+ Poly F = makePoly(f);
1272
+ NormalForm N = determineNormalForm(F);
1273
+ deltaNNB(f);
1274
+ deltaNNB(F);
1275
+ deltaNNB(N);
1276
+ }
1277
+
1278
+ proc moduliMonomials(NormalForm N)
1279
+ "USAGE: moduliMonomials(N); N NormalForm
1280
+ RETURN: the list of the moduli monomials of the normal form N.normalForm
1281
+ EXAMPLE: example moduliMonomials, shows an example"
1282
+ {
1283
+ list RB = N.parameters;
1284
+ return(RB);
1285
+ }
1286
+ example
1287
+ {
1288
+ "EXAMPLE:"; echo=2;
1289
+ ring R=0,(x,y),ds;
1290
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
1291
+ Poly F = makePoly(f);
1292
+ NormalForm N = determineNormalForm(F);
1293
+ moduliMonomials(N);
1294
+ }
1295
+
1296
+ proc newtonNumber(def F)
1297
+ "USAGE: newtonNumber(F); F poly or Poly
1298
+ RETURN: the Newton number of F (or F.value)
1299
+ EXAMPLE: example newtonNumber, shows an example"
1300
+ {
1301
+ def R = basering;
1302
+ int k =0;
1303
+ if(typeof(F)=="poly")
1304
+ {
1305
+ poly f = F;
1306
+ k=1;
1307
+ }
1308
+ if(typeof(F)=="Poly")
1309
+ {
1310
+ def S = F.in;
1311
+ setring S;
1312
+ poly f = F.value;
1313
+ k=1;
1314
+ }
1315
+ if(k==0)
1316
+ {
1317
+ ERROR("Input of wrong type.");
1318
+ }
1319
+ list NP = newtonPolygon(f);
1320
+ list iv = verticesOfNP(NP);
1321
+ number s=0;
1322
+ for(int i=1;i<=size(iv)-1;i++)
1323
+ {
1324
+ s = s+(1/2)*absValue(iv[i+1][1]-iv[i][1])*absValue(iv[i+1][2]-iv[i][2]);
1325
+ s = s+iv[i][1]*(iv[i][2]-iv[i+1][2]);
1326
+ }
1327
+ int newtonNumber = int(2*s-iv[1][2]-iv[size(iv)][1]+1);
1328
+ setring R;
1329
+ return(newtonNumber)
1330
+ }
1331
+ example
1332
+ {
1333
+ "EXAMPLE:"; echo=2;
1334
+ ring R=0,(x,y),ds;
1335
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8+x^3*y^5+y^2*x^5;
1336
+ Poly F = makePoly(f);
1337
+ newtonNumber(F);
1338
+ newtonNumber(f);
1339
+ }
1340
+
1341
+ proc transformationsBeforeSplit(NormalForm N)
1342
+ "USAGE: transformationsBeforeSplit(N); N NormalForm as given by @ref(determineNormalForm)
1343
+ RETURN: the transformations (and in some cases their inverses) that was transformed on N.phi.sourcegerm.value to write it as a direct sum of its degenerate and nondegenerate parts, @*
1344
+ given up to filtration d, where d is a determinacy bound for F.value (returned as type RightEquivalenceChainWithPrecision as defined in @ref(polyclass.lib))
1345
+ EXAMPLE: example transformationsBeforeSplit, shows an example"
1346
+ {
1347
+ return(N.phiBeforeMorseSplit);
1348
+ }
1349
+ example
1350
+ {
1351
+ "EXAMPLE:"; echo=2;
1352
+ ring R = 0,(x,y,z),ds;
1353
+ poly g = (x^2+y^2)^2+5*x^(10)+y^(11)+z^2;
1354
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
1355
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
1356
+ poly phiz = z+2x+x^2+y^4*x;
1357
+ map phi = R,phix,phiy,phiz;
1358
+ g = phi(g);
1359
+ Poly F = makePoly(g);
1360
+ NormalForm N = determineNormalForm(F);
1361
+ transformationsBeforeSplit(N);
1362
+ }
1363
+ proc transformationsAfterSplit(NormalForm N)
1364
+ "USAGE: transformationsAfterSplit(N); N NormalForm as given by @ref(determineNormalForm)
1365
+ RETURN: the transformations (and in some cases their inverses) that was transformed, after the degenerate part was splitted off, of N.phi.sourcegerm.value to transform it to a germ @*
1366
+ with nondegenerate Newton boundary (in some cases the transformations normalize the Newton boundary is also given), is given up to filtration d, where d is a determinacy bound for N.source (returned as type RightEquivalenceChainWithPrecision as defined in @ref(polyclass.lib))@*
1367
+ EXAMPLE: example transformationsAfterSplit, shows an example"
1368
+ {
1369
+ ring B = basering;
1370
+ Poly semiNormalizedNNBGerm = N.semiNormalizedNNBGerm;
1371
+ def R = semiNormalizedNNBGerm.in;
1372
+ setring R;
1373
+ if(semiNormalizedNNBGerm.value==0){
1374
+ "";
1375
+ "The transformations are only given up to transforming the input polynomial to a germ with a nondegenerate Newton boundary. The final transformations to normalize the germ are not yet determined.
1376
+ ";}
1377
+ setring B;
1378
+ return(N.phi);
1379
+ }
1380
+ example
1381
+ {
1382
+ "EXAMPLE:"; echo=2;
1383
+ ring R = 0,(x,y,z),ds;
1384
+ poly g = (x^2+y^2)^2+5*x^(10)+y^(11)+z^2;
1385
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
1386
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
1387
+ poly phiz = z+2*x+x^2+y^4*x;
1388
+ map phi = R,phix,phiy,phiz;
1389
+ g = phi(g);
1390
+ Poly F = makePoly(g);
1391
+ NormalForm N = determineNormalForm(F);
1392
+ transformationsAfterSplit(N);
1393
+ }
1394
+
1395
+
1396
+ proc determineNormalFormEquation(NormalForm N)
1397
+ "USAGE: determineNormalFormEquation(N); N a NormalForm as given by @ref(determineNormalForm)
1398
+ RETURN: a normalform equation, stored in N.normalFormEquation, occuring in the normalform, stored in N.normalForm, of the polynomial, stored in N.phi.sourcegerm, as well as polynomials, stored in N.extension1 and N.extension2 (of type Poly), defining the parameters, @*
1399
+ given as ring variables in N.normalFormEquation.
1400
+ EXAMPLE: example determineNormalFormEquation, shows an example"
1401
+ {
1402
+ def B = basering;
1403
+ int c = N.corank;
1404
+ if(c==1){N.normalFormEquation=N.normalForm; return(N);}
1405
+ RightEquivalenceChainWithPrecision Tr=N.phi;
1406
+ for(int rr=2;rr<=2;rr++)
1407
+ {
1408
+ if(rr==2)
1409
+ {
1410
+ list L = classifyNB(Tr,0,1,1);
1411
+ Tr = L[2];
1412
+ Poly F = Tr.targetgerm;
1413
+ }
1414
+ else
1415
+ {
1416
+ list L = classifyNB(Tr,0,1,0);
1417
+ Tr = L[2];
1418
+ }
1419
+ list RB = N.parameters;
1420
+ int nn = size(RB);
1421
+ if(nn>0)
1422
+ {
1423
+ def SS = RB[1].in;
1424
+ setring SS;
1425
+ }
1426
+ list sb;
1427
+ for(int i=1;i<=nn;i++)
1428
+ {
1429
+ sb[i]=RB[i].value;
1430
+ }
1431
+ Poly F = Tr.targetgerm;
1432
+ ring R = F.in;
1433
+ setring R;
1434
+ if(rr==2)
1435
+ {
1436
+ N.semiNormalizedNNBGerm=F;
1437
+ }
1438
+ if(nn==0)
1439
+ {
1440
+ N.normalFormEquation = N.normalForm;
1441
+ return(N);
1442
+ }
1443
+ if(nn>0)
1444
+ {
1445
+ list rb=fetch(SS,sb);
1446
+ list param = rb;
1447
+ list Rb;
1448
+ for(int i=1;i<=nn;i++)
1449
+ {
1450
+ Rb[i]=makePoly(rb[i]);
1451
+ }
1452
+ N.parameters=Rb;
1453
+ }
1454
+ else
1455
+ {
1456
+ list param;
1457
+ list rb;
1458
+ }
1459
+ poly f = F.value;
1460
+ list NB = newtonPolygon(f);
1461
+ poly f1 = termsOnPolygon(f,NB);
1462
+ poly diffx=diff(f,x);
1463
+ poly diffy = diff(f,y);
1464
+ int d=Tr.precision;
1465
+ list w = piecewiseWeightOfPolygon(NB);
1466
+ int wd = -1;
1467
+ for(int i=1;i<=size(rb);i++)
1468
+ {
1469
+ int s=piecewisedegree(rb[i],w);
1470
+ int dr = deg(rb[i]);
1471
+ if(wd<s)
1472
+ {wd=s;}
1473
+ if(dr>d)
1474
+ {d=dr;}
1475
+ }
1476
+ Tr.precision=d;
1477
+ f = jet(f,d);
1478
+ poly f11=jet(f1,d);
1479
+ poly f1gprec = f1-f11;
1480
+ f = piecewiseJet(f,w,wd);
1481
+ poly fgamma = f-f11;
1482
+ for(int i=1;i<=size(rb);i++)
1483
+ {
1484
+ fgamma = fgamma-coeff(fgamma,rb[i])*rb[i];
1485
+ }
1486
+ list T = monomials(fgamma);
1487
+ int wfgamma = piecewiseOrd(fgamma,w);
1488
+ int l=0;
1489
+ while(size(T)<>0)
1490
+ {
1491
+ poly erase = piecewiseJet(fgamma,w,wfgamma)-piecewiseJet(fgamma,w,wfgamma-1);
1492
+ if(erase<>0)
1493
+ {
1494
+ int HDT;
1495
+ HDT = wfgamma+1;
1496
+ ideal I=idealOfHigherWeightedDeg(f,HDT,w,d);
1497
+ ideal Iparam;
1498
+ for(int i=1;i<=size(param);i++)
1499
+ {
1500
+ int j = piecewisedegree(param[i],w);
1501
+ if(j==wfgamma)
1502
+ {
1503
+ poly mm = poly(param[i]);
1504
+ I =I,mm;
1505
+ param=delete(param,i);
1506
+ i=i-1;
1507
+ }
1508
+ }
1509
+ list L = ringlist(R);
1510
+ L[3][1][1]="dp";
1511
+ def R1 = ring(L);
1512
+ setring R1;
1513
+ poly diffx = fetch(R,diffx);
1514
+ poly diffy = fetch(R,diffy);
1515
+ ideal I = fetch(R,I);
1516
+ poly erase = fetch(R,erase);
1517
+ ideal G = diffx,diffy,I;
1518
+ matrix T;
1519
+ ideal L=liftstd(G,T);
1520
+ list W =division(erase,L);
1521
+ int c = ncols(T);
1522
+ matrix subT =submat(T,1..2,1..c);
1523
+ matrix Gen = subT*W[1];
1524
+ poly gen1 = jet(Gen[1,1],d);
1525
+ poly gen2 = jet(Gen[2,1],d);
1526
+ setring R;
1527
+ poly erase = fetch(R1,erase);
1528
+ poly gen1 = fetch(R1,gen1);
1529
+ poly gen2 = fetch(R1,gen2);
1530
+ if(l==1)
1531
+ {
1532
+ poly gen1y = subst(gen1,x,0);
1533
+ gen1 = CutOff(gen1-gen1y,diffx,wfgamma+1,w);
1534
+ gen1 = gen1+gen1y;
1535
+ poly gen2x = subst(gen2,y,0);
1536
+ gen2 = CutOff(gen2-gen2x,diffy,wfgamma+1,w);
1537
+ gen2 = gen2+gen2x;
1538
+ }
1539
+ matrix N1[1][2] = x-gen1,y-gen2;
1540
+ int p1 = ord(gen1);
1541
+ int p2 = ord(gen2);
1542
+ int p3 = min(p1,p2);
1543
+ int t =timer;
1544
+ f=transWithPrecision(f,N1,d);
1545
+ PolynomialRightEquivalence RE;
1546
+ RE.in=basering;
1547
+ RE.images = list(makePoly(var(1)-gen1),makePoly(var(2)-gen2));
1548
+ Tr.transformations[size(Tr.transformations)+1]=RE;
1549
+ int r=timer-t;
1550
+ if(r>1){l=1;}
1551
+ f = jet(f,d);
1552
+ f = piecewiseJet(f,w,wd);
1553
+ poly fgamma = f-f11;
1554
+ for(int i=1;i<=size(rb);i++)
1555
+ {
1556
+ fgamma = fgamma-coeff(fgamma,rb[i])*rb[i];
1557
+ }
1558
+ list T = monomials(fgamma);
1559
+ if(size(T)==0){break;}
1560
+ int wfgamma1 = piecewiseOrd(fgamma,w);
1561
+ while(wfgamma1<wfgamma || wfgamma==wfgamma1)
1562
+ {
1563
+ ideal P=y^(p3);
1564
+ for(i=1;i<=p3;i++)
1565
+ {
1566
+ P=P,x^i*y^(p3-i);
1567
+ }
1568
+ P=diffx*P,diffy*P;
1569
+ ideal J = P,I;
1570
+ setring R1;
1571
+ ideal G = fetch(R,J);
1572
+ poly fgamma = fetch(R,fgamma);
1573
+ poly erase = piecewiseJet(fgamma,w,wfgamma);
1574
+ matrix T;
1575
+ ideal L=liftstd(G,T);
1576
+ list W =division(erase,L);
1577
+ int c = ncols(T);
1578
+ matrix subT =submat(T,1..2*p3+2,1..c);
1579
+ matrix Gen = subT*matrix(W[1]);
1580
+ for(int j=1;j<=p3+1;j++)
1581
+ {
1582
+ poly genx(j) = jet(x^(j-1)*y^(p3-(j-1))*Gen[j,1],d);
1583
+ }
1584
+ for(j=1;j<=p3+1;j++)
1585
+ {
1586
+ poly geny(j) = jet(x^(j-1)*y^(p3-(j-1))*Gen[j+p3+1,1],d);
1587
+ }
1588
+ poly gen1;
1589
+ for(j=1;j<=p3+1;j++)
1590
+ {
1591
+ gen1 = gen1+genx(j);
1592
+ }
1593
+ poly gen2;
1594
+ for(j=1;j<=p3+1;j++)
1595
+ {
1596
+ gen2 = gen2+geny(j);
1597
+ }
1598
+ setring R;
1599
+ poly gen1 = fetch(R1,gen1);
1600
+ poly gen2 = fetch(R1,gen2);
1601
+ if(l==1)
1602
+ {
1603
+ poly gen1y = subst(gen1,x,0);
1604
+ gen1 = CutOff(gen1-gen1y,diffx,wfgamma+1,w);
1605
+ gen1 = gen1+gen1y;
1606
+ poly gen2x = subst(gen2,y,0);
1607
+ gen2 = CutOff(gen2-gen2x,diffy,wfgamma+1,w);
1608
+ gen2 = gen2+gen2x;
1609
+ }
1610
+ matrix N1[1][2] = x-gen1,y-gen2;
1611
+ int p1 = ord(gen1);
1612
+ int p2 = ord(gen2);
1613
+ if(p1==0){p3=p2;}
1614
+ if(p2==0){p3=p1;}
1615
+ if(p1==0 & p2==0)
1616
+ {
1617
+ int p3 = min(p1,p2);}
1618
+ f=transWithPrecision(f,N1,d);
1619
+ PolynomialRightEquivalence RE;
1620
+ RE.in=basering;
1621
+ RE.images = list(makePoly(var(1)-gen1),makePoly(var(2)-gen2));
1622
+ Tr.transformations[size(Tr.transformations)+1]=RE;
1623
+ f = jet(f,d);
1624
+ f = piecewiseJet(f,w,wd);
1625
+ poly fgamma = f-f11;
1626
+ for(int i=1;i<=size(rb);i++)
1627
+ {
1628
+ fgamma = fgamma-coeff(fgamma,rb[i])*rb[i];
1629
+ }
1630
+ list T = monomials(fgamma);
1631
+ if(size(T)==0){break;}
1632
+ wfgamma1 = piecewiseOrd(fgamma,w);
1633
+ }
1634
+ }
1635
+ else{wfgamma=piecewiseOrd(fgamma,w);}
1636
+ }
1637
+ F=makePoly(f);
1638
+ Tr.targetgerm=F;
1639
+ }
1640
+ if(basering<>R)
1641
+ {
1642
+ poly f1gprec =fetch(R,f1gprec);
1643
+ }
1644
+ f=f+f1gprec;
1645
+ Poly F = makePoly(f);
1646
+ N.normalFormEquationUpToRescaling = F;
1647
+ poly h1=0;
1648
+ Poly H1 = makePoly(h1);
1649
+ N.extension1 = H1;
1650
+ poly h2=0;
1651
+ Poly H2 = makePoly(h2);
1652
+ N.extension2 = H2;
1653
+ poly pp = f11;
1654
+ int r;
1655
+ number cp;
1656
+ int e1;
1657
+ int e2;
1658
+ poly h;
1659
+ int j=0;
1660
+ int k1=0;
1661
+ int k2=0;
1662
+ int i=0;
1663
+ int ll = size(f11);
1664
+ for(int l = 1;l<=ll;l++)
1665
+ {
1666
+ poly f = F.value;
1667
+ if(basering <> R)
1668
+ {
1669
+ poly pp=fetch(R,pp);
1670
+ }
1671
+ poly m = leadmonom(pp);
1672
+ pp=pp-leadcoef(pp)*m;
1673
+ e2=leadexp(m)[2];
1674
+ e1=leadexp(m)[1];
1675
+ for(r=1;r<=size(rb);r++)
1676
+ {
1677
+ if(rb[r]==m)
1678
+ {
1679
+ break;
1680
+ }
1681
+ if(r==size(rb))
1682
+ {
1683
+ if(basering <>R)
1684
+ {
1685
+ number cp=0;
1686
+ }
1687
+ if(basering<>R)
1688
+ {
1689
+ poly f = F.value;
1690
+ }
1691
+ cp= (1/coeff(f,m));
1692
+ list L = ringlist(R);
1693
+ if(minpoly==0) //scaling without field extension
1694
+ {
1695
+ if(size(L[1])==1)
1696
+ {
1697
+ list LS = list(0,list(number(a),list(list("lp",1))),list(0));
1698
+ L[1]=LS;
1699
+ }
1700
+ def S = ring(L);
1701
+ if((e2==1||e1==0)&&j==0)
1702
+ {
1703
+ if(e2==1)
1704
+ {
1705
+ if(k1==0) //the monomial xy^(e'2) has not been normalized tested
1706
+ {
1707
+ k2=1; // set the monomial yx^(e1) to has been normalized
1708
+ poly my =m;
1709
+ f=jet(f,Tr.precision);
1710
+ f=subst(f,var(2),cp*var(2));
1711
+ Tr=addTransformation(Tr,poly(var(1)),poly(cp*var(2)),poly(var(1)),poly((1/cp)*var(2)));
1712
+ if(basering<>R)
1713
+ {
1714
+ poly f1gprec =fetch(R,f1gprec);
1715
+ }
1716
+ f=f+f1gprec;
1717
+ F = makePoly(f);
1718
+ Tr.targetgerm=F;
1719
+ }
1720
+ else //the monomial xy^(e'2) has been normalized
1721
+ {
1722
+ int n= leadexp(mx)[2];
1723
+ list LS = factorize(var(2)^(e1*n-1)-(1/cp));
1724
+ for(int k=1;k<=size(LS[1]);k++)
1725
+ {
1726
+ if(deg(LS[1][k])==1)
1727
+ {
1728
+ poly h = LS[1][k];
1729
+ if(LS[2][k]==1) //do not need a field extension
1730
+ {
1731
+ number g = -number((subst(h,var(2),0))/coeff(h,var(2)));
1732
+ f=jet(f,Tr.precision);
1733
+ f = subst(f,var(2),g*var(2));
1734
+ Tr=addTransformation(Tr,poly(var(1)),poly(g*var(2)),poly(var(1)),poly((1/g)*var(2)));
1735
+ Tr.transformations[size(Tr.transformations)+1]=RE;
1736
+ f=subst(f,var(1),(1/(g^n))*var(1));
1737
+ Tr=addTransformation(Tr,poly((1/(g^n))*var(1)),poly(var(2)),poly((1/g^n)*var(1)),poly(var(2)));
1738
+ if(basering<>R)
1739
+ {
1740
+ poly f1gprec =fetch(R,f1gprec);
1741
+ }
1742
+ f=f+f1gprec;
1743
+ Poly F = makePoly(f);
1744
+ Tr.targetgerm=F;
1745
+ kill g;
1746
+ break;
1747
+ }
1748
+ }
1749
+ if(k==size(LS[1])) //need a field extension tested
1750
+ {
1751
+ poly h = LS[1][2];
1752
+ setring S;
1753
+ poly h = fetch(R,h);
1754
+ minpoly = number(subst(h,var(2),a));
1755
+ poly f = fetch(R,f);
1756
+ f = jet(f,Tr.precision);
1757
+ list rb = fetch(R,rb);
1758
+ f = subst(f,var(2),a*var(2));
1759
+ Tr=addTransformation(Tr,poly(var(1)),poly(a*var(2)),poly(var(1)),poly((1/a)*var(2)));
1760
+ f=subst(f,var(1),a^(-n)*var(1));
1761
+ Tr=addTransformation(Tr,poly(a^(-n)*var(1)),poly(var(2)),poly((1/(a^(-n)))*var(1)),poly(var(2)));
1762
+ if(basering<>R)
1763
+ {
1764
+ poly f1gprec =fetch(R,f1gprec);
1765
+ }
1766
+ f=f+f1gprec;
1767
+ F = makePoly(f);
1768
+ Tr.targetgerm=F;
1769
+ break;
1770
+ }
1771
+ }
1772
+ }
1773
+ }
1774
+ else //e2<>1 --> m=y^(e2)
1775
+ {
1776
+ j=1;
1777
+ if(k2==1) //the monomial yx^(e1) has been normalized tested
1778
+ {
1779
+ pp =pp+coeff(f,my)*my;
1780
+ l=l-1;
1781
+ }
1782
+ list LS = factorize(var(2)^e2-(cp));
1783
+ for(int k=1;k<=size(LS[1]);k++)
1784
+ {
1785
+ if(deg(LS[1][k])==1) //no need for an field extension tested
1786
+ {
1787
+ poly h = LS[1][k];
1788
+ if(LS[2][k]==1)
1789
+ {
1790
+ number g = -number((subst(h,var(2),0))/coeff(h,var(2)));
1791
+ f=jet(f,Tr.precision);
1792
+ f = subst(f,var(2),g*var(2));
1793
+ Tr=addTransformation(Tr,poly(var(1)),poly(g*var(2)),poly(var(1)),poly((1/g)*var(2)));
1794
+ if(basering<>R)
1795
+ {
1796
+ poly f1gprec =fetch(R,f1gprec);
1797
+ }
1798
+ f=f+f1gprec;
1799
+ Poly F = makePoly(f);
1800
+ Tr.targetgerm=F;
1801
+ kill g;
1802
+ break;
1803
+ }
1804
+ }
1805
+ if(k==size(LS[1])) //need for an field extension tested
1806
+ {
1807
+ poly h = LS[1][2];
1808
+ setring S;
1809
+ poly h = fetch(R,h);
1810
+ minpoly = number(subst(h,var(2),a));
1811
+ poly f = fetch(R,f);
1812
+ f = jet(f,Tr.precision);
1813
+ list rb = fetch(R,rb);
1814
+ f = subst(f,var(2),a*var(2));
1815
+ Tr=addTransformation(Tr,poly(var(1)),poly(a*var(2)),poly(var(1)),poly((1/a)*var(2)));
1816
+ if(basering<>R)
1817
+ {
1818
+ poly f1gprec =fetch(R,f1gprec);
1819
+ }
1820
+ f=f+f1gprec;
1821
+ F = makePoly(f);
1822
+ Tr.targetgerm=F;
1823
+ break;
1824
+ }
1825
+ }
1826
+ }
1827
+ }
1828
+ else //m=xy^(e2) || m=x^(e1)
1829
+ {
1830
+ if(e1==1) //m=xy^(e2)
1831
+ {
1832
+ if(k2==0) //the monomial yx^(e'1) has not been normalized tested
1833
+ {
1834
+ poly mx = m;
1835
+ k1=1;
1836
+ f = jet(f,Tr.precision);
1837
+ f=subst(f,var(1),cp*var(1));
1838
+ Tr=addTransformation(Tr,poly(cp*var(1)),poly(var(2)),poly((1/cp)*var(1)),poly(var(2)));
1839
+ if(basering<>R)
1840
+ {
1841
+ poly f1gprec =fetch(R,f1gprec);
1842
+ }
1843
+ f=f+f1gprec;
1844
+ F = makePoly(f);
1845
+ Tr.targetgerm=F;
1846
+ }
1847
+ else //the monomial yx^(e'1) has been normalized
1848
+ {
1849
+ int n= leadexp(my)[1];
1850
+ list LS = factorize(var(1)^(e2*n-1)-(1/cp));
1851
+ for(int k=1;k<=size(LS[1]);k++)
1852
+ {
1853
+ if(deg(LS[1][k])==1) //do not need a field extension
1854
+ {
1855
+ poly h = LS[1][k];
1856
+ if(LS[2][k]==1)
1857
+ {
1858
+ number g = -number((subst(h,var(1),0))/coeff(h,var(1)));
1859
+ f=jet(f,Tr.precision);
1860
+ f = subst(f,var(1),g*var(1));
1861
+ Tr=addTransformation(Tr,poly(g*var(1)),poly(var(2)),poly((1/g)*var(1)),poly(var(2)));
1862
+ f=subst(f,var(2),var(2),(1/(g^n))*var(2));
1863
+ Tr=addTransformation(Tr,poly(var(1)),poly((1/(g^n))*var(2)),poly(*var(1)),poly((g^n)*var(2)));
1864
+ if(basering<>R)
1865
+ {
1866
+ poly f1gprec =fetch(R,f1gprec);
1867
+ }
1868
+ f=f+f1gprec;
1869
+ Poly F = makePoly(f);
1870
+ Tr.targetgerm=F;
1871
+ kill g;
1872
+ break;
1873
+ }
1874
+ }
1875
+ if(k==size(LS[1])) //need a field extension
1876
+ {
1877
+ poly h = LS[1][2];
1878
+ setring S;
1879
+ poly h = fetch(R,h);
1880
+ minpoly = number(subst(h,var(1),a));
1881
+ poly f = fetch(R,f);
1882
+ f = jet(f,Tr.precision);
1883
+ list rb = fetch(R,rb);
1884
+ f = subst(f,var(1),a*var(1));
1885
+ Tr=addTransformation(Tr,poly(a*var(1)),poly(var(2)),poly((1/a)*var(1)),poly(var(2)));
1886
+ f=subst(f,var(2),(1/(a^n))*var(2));
1887
+ Tr=addTransformation(Tr,poly(var(1)),poly((1/(a^n))*var(2)),poly(var(1)),poly(a^n*var(2)));
1888
+ if(basering<>R)
1889
+ {
1890
+ poly f1gprec =fetch(R,f1gprec);
1891
+ }
1892
+ f=f+f1gprec;
1893
+ F = makePoly(f);
1894
+ Tr.targetgerm=F;
1895
+ break;
1896
+ }
1897
+ }
1898
+ }
1899
+ }
1900
+ else //m=x^(e1) || j==1
1901
+ {
1902
+ j=0;
1903
+ if(k1==1) //the monomial xy^(e'2) has been normalized tested
1904
+ {
1905
+ pp =pp+coeff(f,mx)*mx;
1906
+ l=l-1;
1907
+ }
1908
+ list LS = factorize(var(1)^e1-cp);
1909
+ for(int k=1;k<=size(LS[1]);k++)
1910
+ {
1911
+ if(deg(LS[1][k])==1) //do not need a field extension tested
1912
+ {
1913
+ poly h = LS[1][k];
1914
+ poly g = -subst(h,var(1),0);
1915
+ number ch = coeff(h,var(1));
1916
+ f = jet(f,Tr.precision);
1917
+ f = subst(f,var(1),(1/ch)*g*var(1));
1918
+ Tr=addTransformation(Tr,poly((1/ch)*g*var(1)),poly(var(2)),poly(ch*(1/g)*var(1)),poly(var(2)));
1919
+ if(basering<>R)
1920
+ {
1921
+ poly f1gprec =fetch(R,f1gprec);
1922
+ }
1923
+ f=f+f1gprec;
1924
+ Poly F = makePoly(f);
1925
+ Tr.targetgerm=F;
1926
+ kill g;
1927
+ break;
1928
+ }
1929
+ if(k==size(LS[1])) //need a field extension tested
1930
+ {
1931
+ poly h = LS[1][2];
1932
+ setring S;
1933
+ poly h = fetch(R,h);
1934
+ minpoly = number(subst(h,var(1),a));
1935
+ poly f = fetch(R,f);
1936
+ list rb = fetch(R,rb);
1937
+ f = jet(f,Tr.precision);
1938
+ f = subst(f,var(1),a*var(1));
1939
+ Tr=addTransformation(Tr,poly(a*var(1)),poly(var(2)),poly((1/a)*var(1)),poly(var(2)));
1940
+ if(basering<>R)
1941
+ {
1942
+ poly f1gprec =fetch(R,f1gprec);
1943
+ }
1944
+ f=f+f1gprec;
1945
+ F = makePoly(f);
1946
+ Tr.targetgerm=F;
1947
+ break;
1948
+ }
1949
+ }
1950
+ }
1951
+ }
1952
+ }
1953
+ else //scaling with field extension
1954
+ {
1955
+ if((e2==1||e1==0)&&j==0)
1956
+ {
1957
+ if(e2==1) //the monomial xy^(e'2) has not been normalized
1958
+ {
1959
+ if(k1==0) // set the monomial yx^(e1) to has been normalized
1960
+ {
1961
+ k2=1; // set the monomial yx^(e1) to has been normalized
1962
+ poly my =m;
1963
+ f=jet(f,Tr.precision);
1964
+ f=subst(f,var(2),cp*var(2));
1965
+ Tr=addTransformation(Tr,poly(var(1)),poly(cp*var(2)),poly(var(1)),poly((1/cp)*var(2)));
1966
+ if(basering<>R)
1967
+ {
1968
+ poly f1gprec =fetch(R,f1gprec);
1969
+ }
1970
+ f=f+f1gprec;
1971
+ F = makePoly(f);
1972
+ Tr.targetgerm=F;
1973
+ }
1974
+ else //the monomial xy^(e'2) has been normalized
1975
+ {
1976
+ int n= leadexp(mx)[2];
1977
+ list LS = factorize(var(2)^(e1*n-1)-(1/cp));
1978
+ for(int k=1;k<=size(LS[1]);k++)
1979
+ {
1980
+ if(deg(LS[1][k])==1) //do not need a field extension
1981
+ {
1982
+ poly h = LS[1][k];
1983
+ if(LS[2][k]==1)
1984
+ {
1985
+ number g = -number((subst(h,var(2),0))/coeff(h,var(2)));
1986
+ f=jet(f,Tr.precision);
1987
+ f = subst(f,var(2),g*var(2));
1988
+ Tr=addTransformation(Tr,poly(var(1)),poly(g*var(2)),poly(var(1)),poly((1/g)*var(2)));
1989
+ f=subst(f,var(1),var(1),(1/(g^n))*var(1));
1990
+ Tr=addTransformation(Tr,poly(var(1)),poly((1/(g^n))*var(2)),poly(var(1)),poly((g^n)*var(2)));
1991
+ if(basering<>R)
1992
+ {
1993
+ poly f1gprec =fetch(R,f1gprec);
1994
+ }
1995
+ f=f+f1gprec;
1996
+ Poly F = makePoly(f);
1997
+ Tr.targetgerm=F;
1998
+ kill g;
1999
+ break;
2000
+ }
2001
+ }
2002
+ if(k==size(LS[1])) //need a field extension
2003
+ {
2004
+ poly h = LS[1][2];
2005
+ def T = basering;
2006
+ def S = addvarsTo(R,list("e","v"),1);
2007
+ setring S;
2008
+ poly h = fetch(T,h);
2009
+ poly min1 = subst(h,var(2),e);
2010
+ poly min2 = e*v-1;
2011
+ Poly Min1 = makePoly(min1);
2012
+ Poly Min2 = makePoly(min2);
2013
+ N.extension1 =Min1;
2014
+ N.extension2 =Min2;
2015
+ ideal I = std(min1,min2);
2016
+ poly f = fetch(T,f);
2017
+ f = jet(f,Tr.precision);
2018
+ list rb = fetch(R,rb);
2019
+ f = subst(f,var(2),e*var(2));
2020
+ Tr=addTransformation(Tr,poly(var(1)),poly(e*var(2)),poly(var(1)),poly(v*var(2)));
2021
+ f=subst(f,var(1),v^n*var(1));
2022
+ Tr=addTransformation(Tr,poly(var(1)),poly(v*var(2)),poly(var(1)),poly(e^n*var(2)));
2023
+ poly fff = f;
2024
+ poly fff1;
2025
+ int s =size(f);
2026
+ for(int i=1;i<=s;i++)
2027
+ {
2028
+ poly c = leadcoef(fff)*leadmonom(fff);
2029
+ c = reduce(c,I);
2030
+ fff1=fff1+c;
2031
+ fff=fff-leadcoef(fff)*leadmonom(fff);
2032
+ }
2033
+ f= fff1;
2034
+ poly f1gprec = fetch(R,f1gprec);
2035
+ f=f+f1gprec;
2036
+ F = makePoly(f);
2037
+ Tr.targetgerm=F;
2038
+ break;
2039
+ }
2040
+ }
2041
+ }
2042
+ }
2043
+ else //e2<>1 --> m=y^(e2)
2044
+ {
2045
+ j=1;
2046
+ if(k2==1) //the monomial yx^(e1) has been normalized
2047
+ {
2048
+ pp =pp+coeff(f,my)*my;
2049
+ l=l-1;
2050
+ }
2051
+ list LS = factorize(var(2)^e2-(cp));
2052
+ for(int k=1;k<=size(LS[1]);k++)
2053
+ {
2054
+ if(deg(LS[1][k])==1)
2055
+ {
2056
+ poly h = LS[1][k];
2057
+ if(LS[2][k]==1) //no need for an field extension tested
2058
+ {
2059
+ number g = -number((subst(h,var(2),0))/coeff(h,var(2)));
2060
+ f=jet(f,Tr.precision);
2061
+ f = subst(f,var(2),g*var(2));
2062
+ Tr=addTransformation(Tr,poly(var(1)),poly(g*var(2)),poly(var(1)),poly((1/g)*var(2)));
2063
+ if(basering<>R)
2064
+ {
2065
+ poly f1gprec =fetch(R,f1gprec);
2066
+ }
2067
+ f=f+f1gprec;
2068
+ Poly F = makePoly(f);
2069
+ Tr.targetgerm=F;
2070
+ kill g;
2071
+ break;
2072
+ }
2073
+ }
2074
+ if(k==size(LS[1])) //need for a field extension
2075
+ {
2076
+ poly h = LS[1][2];
2077
+ def T = basering;
2078
+ def S = addvarsTo(T,list("e"),1);
2079
+ setring S;
2080
+ poly h = fetch(T,h);
2081
+ poly min = subst(h,var(2),e);
2082
+ Poly Min = makePoly(min);
2083
+ Poly H = N.extension1;
2084
+ def RH = basering;
2085
+ setring H.in;
2086
+ if(H.value==0)
2087
+ {
2088
+ int k=0;
2089
+ }
2090
+ setring RH;
2091
+ if(k==0)
2092
+ {
2093
+ N.extension1 =Min;
2094
+ }
2095
+ else
2096
+ {
2097
+ N.extension2= Min;
2098
+ }
2099
+ ideal I = std(min);
2100
+ poly f = fetch(T,f);
2101
+ f = jet(f,Tr.precision);
2102
+ list rb = fetch(R,rb);
2103
+ f = subst(f,var(2),e*var(2));
2104
+ Tr=addTransformation(Tr,poly(var(1)),poly(e*var(2)),poly(0),poly(0));
2105
+ poly fff = f;
2106
+ poly fff1;
2107
+ int s =size(f);
2108
+ for(int i=1;i<=s;i++)
2109
+ {
2110
+ poly ccc = leadcoef(fff)*leadmonom(fff);
2111
+ ccc = reduce(ccc,I);
2112
+ fff1=fff1+ccc;
2113
+ fff=fff-leadcoef(fff)*leadmonom(fff);
2114
+ }
2115
+ f= fff1;
2116
+ if(basering<>R)
2117
+ {
2118
+ poly f1gprec =fetch(R,f1gprec);
2119
+ }
2120
+ f=f+f1gprec;
2121
+ F = makePoly(f);
2122
+ Tr.targetgerm=F;
2123
+ break;
2124
+ }
2125
+ }
2126
+ }
2127
+ }
2128
+ else //m=xy^(e2) || m=x^(e1)
2129
+ {
2130
+ if(e1==1)
2131
+ {
2132
+ if(k2==0) //the monomial yx^(e'1) has not been normalized
2133
+ {
2134
+ poly mx = m;
2135
+ k1=1;
2136
+ f = jet(f,Tr.precision);
2137
+ f=subst(f,var(1),cp*var(1));
2138
+ Tr=addTransformation(Tr,poly(cp*var(1)),poly(e*var(2)),poly((1/cp)*var(1)),poly(var(2)));
2139
+ if(basering<>R)
2140
+ {
2141
+ poly f1gprec =fetch(R,f1gprec);
2142
+ }
2143
+ f=f+f1gprec;
2144
+ F = makePoly(f);
2145
+ Tr.targetgerm=F;
2146
+ }
2147
+ else //the monomial yx^(e'1) has been normalized
2148
+ {
2149
+ int n= leadexp(my)[1];
2150
+ list LS = factorize(var(1)^(e2*n-1)-(1/cp));
2151
+ for(int k=1;k<=size(LS[1]);k++)
2152
+ {
2153
+ if(deg(LS[1][k])==1)
2154
+ {
2155
+ poly h = LS[1][k];
2156
+ if(LS[2][k]==1) //do not need a field extension
2157
+ {
2158
+ number g = -number((subst(h,var(1),0))/coeff(h,var(1)));
2159
+ f=jet(f,Tr.precision);
2160
+ f = subst(f,var(1),g*var(1));
2161
+ Tr=addTransformation(Tr,poly(g*var(1)),poly(var(2)),poly((1/g)*var(1)),poly(var(2)));
2162
+ f=subst(f,var(2),var(2),(1/(g^n))*var(2));
2163
+ Tr=addTransformation(Tr,poly(var(1)),poly((1/(g^n))*var(2)),poly(var(1)),poly(g^n*var(2)));
2164
+ if(basering<>R)
2165
+ {
2166
+ poly f1gprec =fetch(R,f1gprec);
2167
+ }
2168
+ f=f+f1gprec;
2169
+ Poly F = makePoly(f);
2170
+ Tr.targetgerm=F;
2171
+ kill g;
2172
+ break;
2173
+ }
2174
+ }
2175
+ if(k==size(LS[1])) //need a field extension tested
2176
+ {
2177
+ poly h = LS[1][2];
2178
+ def T = basering;
2179
+ def S = addvarsTo(R,list("e","v"),1);
2180
+ setring S;
2181
+ poly h = fetch(T,h);
2182
+ poly min1 = subst(h,var(1),v);
2183
+ poly min2 = e*v-1;
2184
+ Poly Min1 = makePoly(min1);
2185
+ Poly Min2 = makePoly(min2);
2186
+ N.extension1 =Min1;
2187
+ N.extension2= Min2;
2188
+ ideal I = min1,min2;
2189
+ I=std(I);
2190
+ poly f = fetch(T,f);
2191
+ f = jet(f,Tr.precision);
2192
+ list rb = fetch(R,rb);
2193
+ f = subst(f,var(1),v*var(1));
2194
+ Tr=addTransformation(Tr,poly(v*var(1)),poly(var(2)),poly(e*var(1)),poly(var(2)));
2195
+ f=subst(f,var(2),e^n*var(2));
2196
+ Tr=addTransformation(Tr,poly(var(1)),poly(e^n*var(2)),poly(var(1)),poly(v^n*var(2)));
2197
+ poly fff = f;
2198
+ poly fff1;
2199
+ int s =size(f);
2200
+ poly cl;
2201
+ for(int i=1;i<=s;i++)
2202
+ {
2203
+ cl = leadcoef(fff)*leadmonom(fff);
2204
+ cl = reduce(cl,I);
2205
+ fff1=fff1+cl;
2206
+ fff=fff-leadcoef(fff)*leadmonom(fff);
2207
+ }
2208
+ f= fff1;
2209
+ if(basering<>R)
2210
+ {
2211
+ poly f1gprec =fetch(R,f1gprec);
2212
+ }
2213
+ f=f+f1gprec;
2214
+ F = makePoly(f);
2215
+ Tr.targetgerm=F;
2216
+ break;
2217
+ }
2218
+ }
2219
+ }
2220
+ }
2221
+ else //m=x^(e1) || j==1
2222
+ {
2223
+ j=0;
2224
+ if(k1==1) //the monomial xy^(e'2) has been normalized tested
2225
+ {
2226
+ pp =pp+coeff(f,mx)*mx;
2227
+ l=l-1;
2228
+ }
2229
+ list LS = factorize(var(1)^e1-(cp)); //getoets
2230
+ for(int k=1;k<=size(LS[1]);k++)
2231
+ {
2232
+ if(deg(LS[1][k])==1)
2233
+ {
2234
+ poly h = LS[1][k];
2235
+ if(LS[2][k]==1) //do not need a field extension
2236
+ {
2237
+ number g = -number((subst(h,var(1),0))/coeff(h,var(1)));
2238
+ f=jet(f,Tr.precision);
2239
+ f = subst(f,var(1),g*var(1));
2240
+ Tr=addTransformation(Tr,poly(g*var(1)),poly(var(2)),poly((1/g)*var(1)),poly(var(2)));
2241
+ if(basering<>R)
2242
+ {
2243
+ poly f1gprec =fetch(R,f1gprec);
2244
+ }
2245
+ f=f+f1gprec;
2246
+ Poly F = makePoly(f);
2247
+ Tr.targetgerm=F;
2248
+ kill g;
2249
+ break;
2250
+ }
2251
+ }
2252
+ if(k==size(LS[1])) //need a field extension tested
2253
+ {
2254
+ def T = basering;
2255
+ poly h = LS[1][2];
2256
+ def S = addvarsTo(R,list("v"),1);
2257
+ setring S;
2258
+ poly h = fetch(T,h);
2259
+ poly min = subst(h,var(1),v);
2260
+ Poly Min = makePoly(min);
2261
+ Poly H = N.extension1;
2262
+ def RH = basering;
2263
+ setring H.in;
2264
+ if(H.value==0)
2265
+ {
2266
+ int k =0;
2267
+ }
2268
+ setring RH;
2269
+ if(k==0)
2270
+ {
2271
+ N.extension1 =Min;
2272
+ }
2273
+ else
2274
+ {
2275
+ N.extension2= Min;
2276
+ }
2277
+ ideal I = std(min);
2278
+ poly f = fetch(T,f);
2279
+ f = jet(f,Tr.precision);
2280
+ list rb = fetch(R,rb);
2281
+ f = subst(f,var(1),v*var(1));
2282
+ Tr=addTransformation(Tr,poly(v*var(1)),poly(var(2)),poly(0),poly(0));
2283
+ poly fff = f;
2284
+ poly fff1;
2285
+ int s =size(f);
2286
+ for(int i=1;i<=s;i++)
2287
+ {
2288
+ poly cc = leadcoef(fff)*leadmonom(fff);
2289
+ cc = reduce(cc,I);
2290
+ fff1=fff1+cc;
2291
+ fff=fff-leadcoef(fff)*leadmonom(fff);
2292
+ }
2293
+ f= fff1;
2294
+ if(basering<>R)
2295
+ {
2296
+ poly f1gprec =fetch(R,f1gprec);
2297
+ }
2298
+ f=f+f1gprec;
2299
+ F = makePoly(f);
2300
+ Tr.targetgerm=F;
2301
+ break;
2302
+ }
2303
+ }
2304
+ }
2305
+ }
2306
+ }
2307
+ }
2308
+ }
2309
+ }
2310
+ setring R;
2311
+ N.phi = Tr;
2312
+ N.normalFormEquation = F;
2313
+ setring B;
2314
+ return(N);
2315
+ }
2316
+ example
2317
+ {
2318
+ "EXAMPLE:"; echo=2;
2319
+ ring R=0,(x,y),ds;
2320
+ poly g = x4+2*x2y2+y4+x^(10)+y^(10);
2321
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
2322
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
2323
+ map phi = R,phix,phiy;
2324
+ g=phi(g);
2325
+ Poly F = makePoly(g);
2326
+ NormalForm N;
2327
+ N = determineNormalForm(F);
2328
+ determineNormalFormEquation(N);
2329
+ }
2330
+
2331
+ proc normalFormEquation(NormalForm N)
2332
+ "USAGE: normalFormEquation(N); N NormalForm of which the field N.normalFormEquation is filled using @ref(determineNormalForm) and using @ref(determineNormalFormEquation)
2333
+ RETURN: N.normalFormEquation
2334
+ EXAMPLE: example normalFormEquation, shows an example"
2335
+ {
2336
+ def S = basering;
2337
+ Poly F = N.normalFormEquation;
2338
+ def R = F.in;
2339
+ setring R;
2340
+ if(F.value<>0)
2341
+ {
2342
+ setring S;
2343
+ return(F);
2344
+ }
2345
+ else
2346
+ {
2347
+ N=determineNormalFromEquation(N);
2348
+ F = N.normalFormEquation;
2349
+ setring S;
2350
+ return(F);
2351
+ }
2352
+ }
2353
+ example
2354
+ {
2355
+ "EXAMPLE:"; echo=2;
2356
+ ring R=0,(x,y),ds;
2357
+ poly g = x^4+2*x^2*y^2+y^4+x^(10)+y^(10);
2358
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
2359
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
2360
+ map phi = R,phix,phiy;
2361
+ g=phi(g);
2362
+ Poly F = makePoly(g);
2363
+ NormalForm N;
2364
+ N = determineNormalForm(F);
2365
+ N = determineNormalFormEquation(N);
2366
+ normalFormEquation(N);
2367
+ }
2368
+
2369
+ proc normalFormEquationUpToRescaling(NormalForm N)
2370
+ "USAGE: normalFormEquationUpToRescaling(N); N NormalForm of which the field N.normalFormEquation is filled using @ref(determineNormalForm) and using @ref(determineNormalFormEquation)
2371
+ RETURN: N.normalFormEquationUpToRescaling, a Poly which is right-equivalent to N.normalFormEquation, by the transformation x-->ax, y-->by, a,b complex numbers, such that its ring is minimal
2372
+ EXAMPLE: example normalFormEquationUpToRescaling, shows an example"
2373
+ {
2374
+ def S = basering;
2375
+ Poly F = N.normalFormEquationUpToRescaling;
2376
+ def R = F.in;
2377
+ setring R;
2378
+ if(F.value<>0)
2379
+ {
2380
+ setring S;
2381
+ return(F);
2382
+ }
2383
+ else
2384
+ {
2385
+ N=determineNormalFromEquation(N);
2386
+ F = N.normalFormEquationUpToRescaling;
2387
+ setring S;
2388
+ return(F);
2389
+ }
2390
+ }
2391
+ example
2392
+ {
2393
+ "EXAMPLE:"; echo=2;
2394
+ ring R=0,(x,y),ds;
2395
+ poly g = x^4+2*x^2*y^2+y^4+x^(10)+y^(10);
2396
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
2397
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
2398
+ map phi = R,phix,phiy;
2399
+ g=phi(g);
2400
+ Poly F = makePoly(g);
2401
+ NormalForm N;
2402
+ N = determineNormalForm(F);
2403
+ N = determineNormalFormEquation(N);
2404
+ normalFormEquationUpToRescaling(N);
2405
+ }
2406
+
2407
+ proc determineArnoldType(N)
2408
+ "USAGE: determineArnoldType(N); N NormalForm which was created using @ref(determineNormalForm), with the field N.modality<=2
2409
+ RETURN: a NormalForm N in which the Arnold classification of N.phi.sourcegerm is stored in N.ArnoldType
2410
+ EXAMPLE: example N.ArnoldType, shows an example"
2411
+ {
2412
+ def B = basering;
2413
+ if(N.modality>2)
2414
+ {ERROR("The singularity has modality>2")}
2415
+ Poly F = N.normalForm;
2416
+ def R = F.in;
2417
+ setring R;
2418
+ poly f = F.value;
2419
+ list NP = newtonPolygon(f);
2420
+ list V =latticePoints(NP);
2421
+ list Vm = latticeToMonomials(V);
2422
+ ring S=0,(x,y),ds;
2423
+ list V = fetch(R,Vm);
2424
+ poly f=0;
2425
+ for(int i=1;i<=size(V);i++)
2426
+ {
2427
+ f=f+V[i];
2428
+ }
2429
+ N.ArnoldType = complexType(f)[1];
2430
+ setring B;
2431
+ return(N);
2432
+ }
2433
+ example
2434
+ {
2435
+ "EXAMPLE:"; echo=2;
2436
+ ring R=0,(x,y),ds;
2437
+ poly g = x^4+2*x^2*y^2+y^4+x^(10)+y^(10);
2438
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
2439
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
2440
+ map phi = R,phix,phiy;
2441
+ g=phi(g);
2442
+ Poly F = makePoly(g);
2443
+ NormalForm N;
2444
+ N = determineNormalForm(F);
2445
+ N = determineArnoldType(N);
2446
+ N.ArnoldType;
2447
+ }
2448
+
2449
+ proc ArnoldType(N)
2450
+ "USAGE: ArnoldType(N); N NormalForm which was created using @ref(determineNormalForm), with the field N.modality<=2
2451
+ RETURN: a NormalForm N in which the Arnold classification of N.phi.sourcegerm is stored in N.ArnoldType
2452
+ EXAMPLE: example N.ArnoldType, shows an example"
2453
+ {
2454
+ def S = basering;
2455
+ string CT = N.ArnoldType;
2456
+ if(CT<>"")
2457
+ {
2458
+ setring S;
2459
+ return(CT);
2460
+ }
2461
+ else
2462
+ {
2463
+ N=determineArnoldType(N);
2464
+ string CT = N.ArnoldType;
2465
+ setring S;
2466
+ return(CT);
2467
+ }
2468
+ }
2469
+ example
2470
+ {
2471
+ "EXAMPLE:"; echo=2;
2472
+ ring R=0,(x,y),ds;
2473
+ poly g = x^4+2*x^2*y^2+y^4+x^(10)+y^(10);
2474
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
2475
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
2476
+ map phi = R,phix,phiy;
2477
+ g=phi(g);
2478
+ Poly F = makePoly(g);
2479
+ NormalForm N;
2480
+ N = determineNormalForm(F);
2481
+ N = determineArnoldType(N);
2482
+ ArnoldType(N);
2483
+ }
2484
+
2485
+ proc determineNormalFormList(poly f)
2486
+ "USAGE: determineNormalFormList(f); f poly
2487
+ RETURN: if f is right equivalent to a germ with a nondegenerate Newton boundary a list with entries:@*
2488
+ [1]: the embedding dimension (given as type int)@*
2489
+ [2]: the corank of the singularity defined by f (given as type int)@*
2490
+ [3]: the corner points of the Newton boundary of the normal form of f, which classifies the singularity type (given as type string)@*
2491
+ [4]: a ring that contains a polynomial "normalform" that is the normalform of f (given as type poly)@*
2492
+ [5]: a ring that contains a polynomial "nondegeneratepart" that is the nondegenerate part of the normalform of f (given as type poly)@*
2493
+ [6]: a list of the monomials corresponding to the moduli terms in normalform (given as a list with entries of type poly)@*
2494
+ [7]: the modality of the singularity defined by f (given as type int)@*
2495
+ [8]: the Milnor number of f (given as type int)@*
2496
+ [9]: the Delta invariant of f (given as type int)@*
2497
+ [10]: the number of branches of f (given as type int)@*
2498
+ [11]: a determinacy bound for f (given as type int),@*
2499
+ an ERROR message otherwise
2500
+ EXAMPLE: example determineNormalFormList, shows an example"
2501
+ {
2502
+ def R = basering;
2503
+ Poly F = makePoly(f);
2504
+ NormalForm N;
2505
+ N = determineNormalForm(F);
2506
+ Poly P = N.normalForm;
2507
+ list L;
2508
+ L[1] = N.numbervars;
2509
+ L[2] = N.corank;
2510
+ L[3] = N.singularityType;
2511
+ Poly NormalF = N.normalForm;
2512
+ def RR = NormalF.in;
2513
+ setring RR;
2514
+ poly normalformpoly = NormalF.value;
2515
+ export normalformpoly;
2516
+ setring R;
2517
+ L[4] = RR;
2518
+ Poly NGP=N.nondegeneratePart;
2519
+ def S = NGP.in;
2520
+ setring S;
2521
+ poly nondegeneratepart = NGP.value;
2522
+ export nondegeneratepart;
2523
+ setring R;
2524
+ L[5] = N.parameters;
2525
+ L[6] = S;
2526
+ L[7] = N.modality;
2527
+ L[8] = N.milnorNumber;
2528
+ L[9] = N.delta;
2529
+ L[10] = N.numberOfBranches;
2530
+ L[11] = N.determinacy;
2531
+ return(L);
2532
+ }
2533
+ example
2534
+ {
2535
+ "EXAMPLE:"; echo=2;
2536
+ ring R = 0,(x,y,z),ds;
2537
+ poly f = (x^2+y^2)^2+5*x^(10)+y^(11)+z^2;
2538
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
2539
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
2540
+ poly phiz = z+2x+x^2+y^4*x;
2541
+ map phi = R,phix,phiy,phiz;
2542
+ f = phi(f);
2543
+ list L = determineNormalFormList(f);
2544
+ L[1]; //Embedding dimension
2545
+ L[2]; //Corank of singularity
2546
+ L[3]; //Normalform of type
2547
+ def RR = L[4];
2548
+ setring RR;
2549
+ normalformpoly; //Normalform
2550
+ setring R;
2551
+ L[5]; //Momomials corresponding to moduli terms
2552
+ def SS = L[6];
2553
+ setring SS;
2554
+ nondegeneratepart; //Nondegenerate part
2555
+ L[7]; //Modality
2556
+ L[8]; //Milnor number
2557
+ L[9]; //Delta invariant
2558
+ L[10]; //Number of branches
2559
+ L[11]; //Determinacy
2560
+ }
2561
+
2562
+ proc determineNormalFormWithEqList(poly f)
2563
+ "USAGE: determineNormalFormEqList(f); f poly
2564
+ RETURN: if f is right equivalent to a germ with a nondegenerate Newton boundary a list with entries:@*
2565
+ [1]: the embedding dimension (given as type int)@*
2566
+ [2]: the corank of the singularity defined by f (given as type int)@*
2567
+ [3]: the corner points of the Newton boundary of the normal form of f, which classifies the singularity type (given as type string)@*
2568
+ [4]: a ring that contains a polynomial "normalform" that is the normalform of f (given as type poly)@*
2569
+ [5]: a ring that contains a polynomial "nondegeneratepart" that is the nondegenerate part of the normalform of f (given as type poly)@*
2570
+ [6]: a list of the monomials corresponding to the moduli terms in normalform (given as a list with entries of type poly)@*
2571
+ [7]: a ring containing a normalform equation "normalformequation" of f in the normalform "normalform" (given as a poly), @*
2572
+ as well as polynomials "extension1" and "extension2" (given as poly's) that defines the parameters, given as variables, in the given normalform equation @*
2573
+ [8]: the modality of the singularity defined by f (given as type int)@*
2574
+ [9]: the Milnor number of f (given as type int)@*
2575
+ [10]: the Delta invariant of f (given as type int)@*
2576
+ [11]: the number of branches of f (given as type int)@*
2577
+ [12]: a determinacy bound for f (given as type int),@*
2578
+ an ERROR message otherwise
2579
+ EXAMPLE: example determineNormalFormWithEqList, shows an example"
2580
+ {
2581
+ def R = basering;
2582
+ Poly F = makePoly(f);
2583
+ NormalForm N;
2584
+ N = determineNormalForm(F);
2585
+ N= determineNormalFormEquation(N);
2586
+ Poly P = N.normalForm;
2587
+ list L;
2588
+ L[1] = N.numbervars;
2589
+ L[2] = N.corank;
2590
+ L[3] = N.singularityType;
2591
+ Poly NormalF = N.normalForm;
2592
+ def RR = NormalF.in;
2593
+ setring RR;
2594
+ poly normalformpoly = NormalF.value;
2595
+ export normalformpoly;
2596
+ setring R;
2597
+ L[4] = RR;
2598
+ Poly NGP=N.nondegeneratePart;
2599
+ def S = NGP.in;
2600
+ setring S;
2601
+ poly nondegeneratepart = NGP.value;
2602
+ export nondegeneratepart;
2603
+ setring R;
2604
+ L[5] = N.parameters;
2605
+ L[6] = S;
2606
+ Poly normalFE = N.normalFormEquation;
2607
+ def SS = normalFE.in;
2608
+ setring SS;
2609
+ poly normalformequation = normalFE.value;
2610
+ normalformequation;
2611
+ export normalformequation;
2612
+ Poly Ext1=N.extension1;
2613
+ poly extension1=Ext1.value;
2614
+ extension1;
2615
+ Poly Ext2=N.extension2;
2616
+ poly extension2=Ext2.value;
2617
+ export extension1;
2618
+ export extension2;
2619
+ setring R;
2620
+ L[7]=SS;
2621
+ L[8] = N.modality;
2622
+ L[9] = N.milnorNumber;
2623
+ L[10] = N.delta;
2624
+ L[11] = N.numberOfBranches;
2625
+ L[12] = N.determinacy;
2626
+ return(L);
2627
+ }
2628
+ example
2629
+ {
2630
+ "EXAMPLE:"; echo=2;
2631
+ ring R = 0,(x,y,z),ds;
2632
+ poly f = (x^2+y^2)^2+5*x^(10)+y^(11)+z^2;
2633
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
2634
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
2635
+ poly phiz = z+2x+x^2+y^4*x;
2636
+ map phi = R,phix,phiy,phiz;
2637
+ f = phi(f);
2638
+ list L = determineNormalFormWithEqList(f);
2639
+ L[1]; //Embedding dimension
2640
+ L[2]; //Corank of singularity
2641
+ L[3]; //Normalform of type
2642
+ def RR = L[4];
2643
+ setring RR;
2644
+ normalformpoly; //Normalform
2645
+ setring R;
2646
+ L[5]; //Momomials corresponding to moduli terms
2647
+ def TT = L[6];
2648
+ setring TT;
2649
+ nondegeneratepart; //Nondegenerate part
2650
+ def SS = L[7];
2651
+ setring SS;
2652
+ normalformequation; //Normalform equation
2653
+ minpoly; //minpoly defining the parameter in the underlying ring
2654
+ extension1; //poly defining a parameter, given as a variable, in the ring
2655
+ extension2; //poly defining a parameter, given as a varible, in the ring
2656
+ setring R;
2657
+ L[8]; //Modality
2658
+ L[9]; //Milnor number
2659
+ L[10]; //Delta invariant
2660
+ L[11]; //Number of branches
2661
+ L[12]; //Determinacy
2662
+ }
2663
+
2664
+ proc determineNormalFormWithEHList(poly f)
2665
+ "USAGE: determineNormalFormWithEHList(f); f poly
2666
+ RETURN: if f is right equivalent to a germ with a nondegenerate Newton boundary a list with entries:@*
2667
+ [1]: the embedding dimension (given as type int)@*
2668
+ [2]: the corank of the singularity defined by f (given as type int)@*
2669
+ [3]: the corner points of the Newton boundary of the normal form of f, which classifies the singularity type (given as type string)@*
2670
+ [4]: a ring that contains a polynomial "normalform" that is the normalform of f (given as type poly)@*
2671
+ [5]: a ring that contains a polynomial "eh" that is the exceptional hypersurfaceof the normalform in L[4]@*
2672
+ [5]: a ring that contains a polynomial "nondegeneratepart" that is the nondegenerate part of the normalform of f (given as type poly)@*
2673
+ [6]: a list of the monomials corresponding to the moduli terms in normalform (given as a list with entries of type poly)@*
2674
+ [7]: the modality of the singularity defined by f (given as type int)@*
2675
+ [8]: the Milnor number of f (given as type int)@*
2676
+ [9]: the Delta invariant of f (given as type int)@*
2677
+ [10]: the number of branches of f (given as type int)@*
2678
+ [11]: a determinacy bound for f (given as type int),@*
2679
+ an ERROR message otherwise
2680
+ EXAMPLE: example determineNormalFormWithEHList, shows an example"
2681
+ {
2682
+ def R = basering;
2683
+ Poly F = makePoly(f);
2684
+ NormalForm N;
2685
+ N = determineNormalForm(F);
2686
+ N= determineExceptionalHypersurface(N);
2687
+ Poly P = N.normalForm;
2688
+ list L;
2689
+ L[1] = N.numbervars;
2690
+ L[2] = N.corank;
2691
+ L[3] = N.singularityType;
2692
+ Poly NormalF = N.normalForm;
2693
+ def RR = NormalF.in;
2694
+ setring RR;
2695
+ poly normalformpoly = NormalF.value;
2696
+ export normalformpoly;
2697
+ setring R;
2698
+ L[4] = RR;
2699
+ Poly EH = N.exceptionalHypersurface;
2700
+ def VV = EH.in;
2701
+ setring VV;
2702
+ poly eh = EH.value;
2703
+ export eh;
2704
+ setring R;
2705
+ L[5] = VV;
2706
+ Poly NGP=N.nondegeneratePart;
2707
+ def S = NGP.in;
2708
+ setring S;
2709
+ poly nondegeneratepart = NGP.value;
2710
+ export nondegeneratepart;
2711
+ setring R;
2712
+ L[6] = N.parameters;
2713
+ L[7] = S;
2714
+ L[8] = N.modality;
2715
+ L[9] = N.milnorNumber;
2716
+ L[10] = N.delta;
2717
+ L[11] = N.numberOfBranches;
2718
+ L[12] = N.determinacy;
2719
+ return(L);
2720
+ }
2721
+ example
2722
+ {
2723
+ "EXAMPLE:"; echo=2;
2724
+ ring R = 0,(x,y,z),ds;
2725
+ poly f = (x^2+y^2)^2+5*x^(10)+y^(11)+z^2;
2726
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
2727
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
2728
+ poly phiz = z+2x+x^2+y^4*x;
2729
+ map phi = R,phix,phiy,phiz;
2730
+ f = phi(f);
2731
+ list L = determineNormalFormWithEHList(f);
2732
+ L[1]; //Embedding dimension
2733
+ L[2]; //Corank of singularity
2734
+ L[3]; //Normalform of type
2735
+ def RR = L[4];
2736
+ setring RR;
2737
+ normalformpoly; //Normalform
2738
+ setring R;
2739
+ def VV =L[5];
2740
+ setring VV;
2741
+ eh; //exceptional hypersurface
2742
+ setring R;
2743
+ L[6]; //Momomials corresponding to moduli terms
2744
+ def TT = L[7];
2745
+ setring TT;
2746
+ nondegeneratepart; //Nondegenerate part
2747
+ setring R;
2748
+ L[8]; //Modality
2749
+ L[9]; //Milnor number
2750
+ L[10]; //Delta invariant
2751
+ L[11]; //Number of branches
2752
+ L[12]; //Determinacy
2753
+ }
2754
+
2755
+ proc determineNormalFormWithEqAndEHList(poly f)
2756
+ "USAGE: determineNormalFormWithEqAndEHList(f); f poly
2757
+ RETURN: if f is right equivalent to a germ with a nondegenerate Newton boundary a list with entries:@*
2758
+ [1]: the embedding dimension (given as type int)@*
2759
+ [2]: the corank of the singularity defined by f (given as type int)@*
2760
+ [3]: the corner points of the Newton boundary of the normal form of f, which classifies the singularity type (given as type string)@*
2761
+ [4]: a ring that contains a polynomial "normalform" that is the normalform of f (given as type poly)@*
2762
+ [5]: a ring that contains a polynomial "eh" that is the exceptional hypersurfaceof the normalform in L[4]@*
2763
+ [5]: a ring that contains a polynomial "nondegeneratepart" that is the nondegenerate part of the normalform of f (given as type poly)@*
2764
+ [6]: a list of the monomials corresponding to the moduli terms in normalform (given as a list with entries of type poly)@*
2765
+ [7]: a ring containing a normalform equation "normalformequation" of f in the normalform "normalform" (given as a poly), @*
2766
+ as well as polynomials "extension1" and "extension2" (given as poly's) that defines the parameters, given as variables, in the given normalform equation @*
2767
+ [8]: the modality of the singularity defined by f (given as type int)@*
2768
+ [9]: the Milnor number of f (given as type int)@*
2769
+ [10]: the Delta invariant of f (given as type int)@*
2770
+ [11]: the number of branches of f (given as type int)@*
2771
+ [12]: a determinacy bound for f (given as type int),@*
2772
+ an ERROR message otherwise
2773
+ EXAMPLE: example determineNormalFormWithEqAndEHList, shows an example"
2774
+ {
2775
+ def R = basering;
2776
+ Poly F = makePoly(f);
2777
+ NormalForm N;
2778
+ N = determineNormalForm(F);
2779
+ N= determineNormalFormEquation(N);
2780
+ N= determineExceptionalHypersurface(N);
2781
+ Poly P = N.normalForm;
2782
+ list L;
2783
+ L[1] = N.numbervars;
2784
+ L[2] = N.corank;
2785
+ L[3] = N.singularityType;
2786
+ Poly NormalF = N.normalForm;
2787
+ def RR = NormalF.in;
2788
+ setring RR;
2789
+ poly normalformpoly = NormalF.value;
2790
+ export normalformpoly;
2791
+ setring R;
2792
+ L[4] = RR;
2793
+ Poly EH = N.exceptionalHypersurface;
2794
+ def VV = EH.in;
2795
+ setring VV;
2796
+ poly eh = EH.value;
2797
+ export eh;
2798
+ setring R;
2799
+ L[5] = VV;
2800
+ Poly NGP=N.nondegeneratePart;
2801
+ def S = NGP.in;
2802
+ setring S;
2803
+ poly nondegeneratepart = NGP.value;
2804
+ export nondegeneratepart;
2805
+ setring R;
2806
+ L[6] = N.parameters;
2807
+ L[7] = S;
2808
+ Poly normalFE = N.normalFormEquation;
2809
+ def SS = normalFE.in;
2810
+ setring SS;
2811
+ poly normalformequation = normalFE.value;
2812
+ normalformequation;
2813
+ export normalformequation;
2814
+ Poly Ext1=N.extension1;
2815
+ poly extension1=Ext1.value;
2816
+ extension1;
2817
+ Poly Ext2=N.extension2;
2818
+ poly extension2=Ext2.value;
2819
+ export extension1;
2820
+ export extension2;
2821
+ setring R;
2822
+ L[8]=SS;
2823
+ L[9] = N.modality;
2824
+ L[10] = N.milnorNumber;
2825
+ L[11] = N.delta;
2826
+ L[12] = N.numberOfBranches;
2827
+ L[13] = N.determinacy;
2828
+ return(L);
2829
+ }
2830
+ example
2831
+ {
2832
+ "EXAMPLE:"; echo=2;
2833
+ ring R = 0,(x,y,z),ds;
2834
+ poly f = (x^2+y^2)^2+5*x^(10)+y^(11)+z^2;
2835
+ poly phix = x+y^2+x^2+x*y+x^2*y+x*y^3;
2836
+ poly phiy = y+y^2+2*x^2+x*y+y*x^2+y^2*x+x*y^4;
2837
+ poly phiz = z+2*x+x^2+y^4*x;
2838
+ map phi = R,phix,phiy,phiz;
2839
+ f = phi(f);
2840
+ list L = determineNormalFormWithEqAndEHList(f);
2841
+ L[1]; //Embedding dimension
2842
+ L[2]; //Corank of singularity
2843
+ L[3]; //Normalform of type
2844
+ def RR = L[4];
2845
+ setring RR;
2846
+ normalformpoly; //Normalform
2847
+ setring R;
2848
+ def VV =L[5];
2849
+ setring VV;
2850
+ eh; //exceptional hypersurface
2851
+ setring R;
2852
+ L[6]; //Momomials corresponding to moduli terms
2853
+ def TT = L[7];
2854
+ setring TT;
2855
+ nondegeneratepart; //Nondegenerate part
2856
+ def SS = L[8];
2857
+ setring SS;
2858
+ normalformequation; //Normalform equation
2859
+ minpoly; //minpoly defining the parameter in the underlying ring
2860
+ extension1; //poly defining a parameter, given as a variable, in the ring
2861
+ extension2; //poly defining a parameter, given as a varible, in the ring
2862
+ setring R;
2863
+ L[9]; //Modality
2864
+ L[10]; //Milnor number
2865
+ L[11]; //Delta invariant
2866
+ L[12]; //Number of branches
2867
+ L[13]; //Determinacy
2868
+ }
2869
+
2870
+
2871
+
2872
+ static proc addTransformation(RightEquivalenceChainWithPrecision Tr, poly fx,poly fy,poly gx, poly gy)
2873
+ {
2874
+ PolynomialRightEquivalence RE;
2875
+ RE.in=basering;
2876
+ Poly Fx = makePoly(fx);
2877
+ Poly Fy = makePoly(fy);
2878
+ Poly Gx= makePoly(gx);
2879
+ Poly Gy = makePoly(gy);
2880
+ RE.images = list(Fx,Fy);
2881
+ RE.imagesInverse = list(Gx,Gy);
2882
+ Tr.transformations[size(Tr.transformations)+1]=RE;
2883
+ return(Tr);
2884
+ }
2885
+
2886
+ proc regularBasis(Poly F, int a)
2887
+ "USAGE: regularBasis(F,a); F Poly, a int
2888
+ RETURN: a list that contains a regular basis of F.value with respect to the piecewiseweight defined by the Newton polygon of F.value. If a=1, the only the elements of the
2889
+ regular basis that lie above or on the Newton polygon defined by F.value is given.
2890
+ EXAMPLE: example regularBasis, shows an example"
2891
+ {
2892
+ ring baseRing = basering;
2893
+ int p = 33000;
2894
+ p = prime(p);
2895
+ ring R = F.in;
2896
+ setring R;
2897
+ int md = modalityNB(F);
2898
+ poly f = F.value;
2899
+ while(0==0)
2900
+ {
2901
+ list l = ringlist(R);
2902
+ l[1] = p;
2903
+ list NP = newtonPolygon(f);
2904
+ list V =verticesOfNP(NP);
2905
+ list Vm = latticeToMonomials(V);
2906
+ def Rl=ring(l);
2907
+ setring Rl;
2908
+ list rBasis;
2909
+ list Vm = fetch(R,Vm);
2910
+ poly f = fetch(R,f);
2911
+ poly g;
2912
+ list B;
2913
+ for(int i=1;i<=size(Vm);i++)
2914
+ {
2915
+ g=g+Vm[i];
2916
+ }
2917
+ ideal J = std(jacob(g));
2918
+ int h = deg(highcorner(J));
2919
+ if(h<>-1)
2920
+ {
2921
+ int d=V[1][1]+V[1][2];
2922
+ for(int i=2;i<=size(V);i++)
2923
+ {
2924
+ if(V[i][1]+V[i][2]<d)
2925
+ {
2926
+ d=V[i][1]+V[i][2];
2927
+ }
2928
+ }
2929
+ list wt = piecewiseWeightOfPolygon(NP);
2930
+ if(a==1)
2931
+ {
2932
+ int t = d-1;
2933
+ int mind = piecewisedegree(Vm[1],wt);
2934
+ }
2935
+ else
2936
+ {
2937
+ int t = 0;
2938
+ int mind = piecewisedegree(Vm[1],wt);
2939
+ }
2940
+ for(int i=t;i<= h;i++)
2941
+ {
2942
+ for(int j = 0;j<=i;j++)
2943
+ {
2944
+ poly mon = var(1)^(i-j)*var(2)^(j);
2945
+ if(reduce(mon,J)<>0)
2946
+ {
2947
+ B[size(B)+1]=mon;
2948
+ }
2949
+ }
2950
+ }
2951
+ int maxd=0;
2952
+ for(int i=1;i<=size(NP);i++)
2953
+ {
2954
+ for(int j = 1;j<=2;j++)
2955
+ {
2956
+ if(wt[i][j]>maxd)
2957
+ {
2958
+ maxd = wt[i][j];
2959
+ }
2960
+ }
2961
+ }
2962
+ maxd = maxd*h;
2963
+ maxd=0;
2964
+ for(int k=1;k<=size(B);k++)
2965
+ {
2966
+ int wd = piecewisedegree(B[k],wt);
2967
+ if(defined(L(wd))==0)
2968
+ {
2969
+ list L(wd);
2970
+ }
2971
+ L(wd)[size(L(wd))+1]=B[k];
2972
+ if(size(L(wd))>0 && maxd<wd)
2973
+ {
2974
+ maxd=wd;
2975
+ }
2976
+ }
2977
+ if(a==1)
2978
+ {
2979
+ for(int i=1;i<=(maxd-mind+1);i++)
2980
+ {
2981
+ if(defined(L(maxd-i+1))<>0)
2982
+ {
2983
+ for(int k=1;k<=size(L(maxd-i+1));k++)
2984
+ {
2985
+ poly mon = L(maxd-i+1)[k];
2986
+ if(i==(maxd-mind+1) && deg(mon)<h && (leadexp(mon)[1]==0 || leadexp(mon)[2]==0 ||leadexp(mon)[1]==1 || leadexp(mon)[2]==1))
2987
+ {
2988
+ }
2989
+ else
2990
+ {
2991
+ if(reduce(mon,J)!=0)
2992
+ {
2993
+ J=std(J+ideal(mon));
2994
+ rBasis[size(rBasis)+1]= mon;
2995
+ }
2996
+ }
2997
+ }
2998
+ }
2999
+ }
3000
+ }
3001
+ else
3002
+ {
3003
+ for(int i=1;i<=maxd;i++)
3004
+ {
3005
+ if(defined(L(maxd-i+1))<>0)
3006
+ {
3007
+ for(int k=1;k<=size(L(maxd-i+1));k++)
3008
+ {
3009
+ poly mon = L(maxd-i+1)[k];
3010
+ if(i==(maxd-mind+1) && deg(mon)<h && (leadexp(mon)[1]==0 || leadexp(mon)[2]==0 ||leadexp(mon)[1]==1 || leadexp(mon)[2]==1))
3011
+ {
3012
+ }
3013
+ else
3014
+ {
3015
+ if(reduce(mon,J)!=0)
3016
+ {
3017
+ J=std(J+ideal(mon));
3018
+ rBasis[size(rBasis)+1]= mon;
3019
+ }
3020
+ }
3021
+ }
3022
+ }
3023
+ }
3024
+ }
3025
+ int srBasis = size(rBasis);
3026
+ if(srBasis==md && a==1)
3027
+ {
3028
+ setring baseRing;
3029
+ if(srBasis==0){list rBasis;}
3030
+ if((baseRing!=Rl) && (srBasis<>0))
3031
+ {
3032
+ list rBasis = fetch(Rl,rBasis);
3033
+ }
3034
+ return(rBasis)
3035
+ }
3036
+ else
3037
+ {
3038
+ if(a<>1)
3039
+ {
3040
+ setring R;
3041
+ list rBasis = fetch(Rl,rBasis);
3042
+ return(rBasis)
3043
+ }
3044
+ setring R;
3045
+ p=prime(p-1);
3046
+ }
3047
+ }
3048
+ else
3049
+ {
3050
+ setring R;
3051
+ p=prime(p-1);
3052
+ }
3053
+ }
3054
+ }
3055
+ example
3056
+ {
3057
+ "EXAMPLE:"; echo=2;
3058
+ ring R = 0,(x,y),ds;
3059
+ poly f = x^9+x^2*y^4+y^2*x^4+y^8;
3060
+ Poly F = makePoly(f);
3061
+ regularBasis(F,0);
3062
+ regularBasis(F,1);
3063
+ }
3064
+
3065
+ static proc maximumFiltration(poly f){
3066
+ return(ord(f));
3067
+ }
3068
+
3069
+ static proc setintersection(list A, list B)
3070
+ {
3071
+ list L;
3072
+ if ((size(A)==0) or (size(B)==0))
3073
+ {
3074
+ return(L);
3075
+ }
3076
+ int i,j,l;
3077
+ l=1;
3078
+ for (i=1;i<=size(A);i++)
3079
+ {
3080
+ for (j=1;j<=size(B);j++)
3081
+ {
3082
+ if (B[j]==A[i])
3083
+ {
3084
+ L[l]=A[i];l=l+1;
3085
+ }
3086
+ }
3087
+ }
3088
+ return(L);
3089
+ }
3090
+
3091
+ static proc exponentvector(poly f)
3092
+ {
3093
+ return(leadexp(f));
3094
+ }
3095
+
3096
+
3097
+ static proc innerVertices(NP)
3098
+ {
3099
+ list L;
3100
+ int j,jj;
3101
+ intvec co;
3102
+ for (j=1;j<=size(NP)-1;j++)
3103
+ {
3104
+ L[j]=NP[j][2][2];
3105
+ }
3106
+ return(L);
3107
+ }
3108
+
3109
+ static proc dofaceelimination(poly f,intvec si)
3110
+ {
3111
+ f = truncateAtHighestCorner(f);
3112
+ poly fnew=faceelimination(f,si);
3113
+ if (fnew==f)
3114
+ {
3115
+ return(f);
3116
+ }
3117
+ else
3118
+ {
3119
+ return(dofaceelimination(fnew, si));
3120
+ }
3121
+ }
3122
+
3123
+ static proc faceelimination(poly f,intvec co)
3124
+ {
3125
+ int mu=milnor(f);
3126
+ list NP=newtonPolygon(f);
3127
+ list L=latticePoints(NP);
3128
+ list L1;
3129
+ int l=1;
3130
+ for (int j=1;j<=size(L);j++)
3131
+ {
3132
+ if ((L[j][1]==co[1]-1) or (L[j][2]==co[2]-1))
3133
+ {
3134
+ L1[l]=L[j];
3135
+ l=l+1;
3136
+ }
3137
+ }
3138
+ poly f0=termsOnPolygon(f,NP);
3139
+ poly f1=f;
3140
+ intvec co1;
3141
+ number c1;
3142
+ poly mon;
3143
+ list wt;
3144
+ list NPadj=adjacentFacesOfNewtonPolygon(NP,co);
3145
+ for (j=1;j<=size(L1);j++)
3146
+ {
3147
+ co1=L1[j];
3148
+ mon=x^co1[1]*y^co1[2];
3149
+ c1=coeff(f0,mon);
3150
+ mon=c1*x^co1[1]*y^co1[2];
3151
+ if (c1<>0)
3152
+ {
3153
+ wt=weightsOfNewtonPolygon(NPadj);
3154
+ f1=removeMon(f,f0,wt[1],wt[2],mon);
3155
+ }
3156
+ }
3157
+ return(f1);
3158
+ }
3159
+
3160
+ static proc adjacentFacesOfNewtonPolygon(list NP,intvec co)
3161
+ {
3162
+ list NP1;
3163
+ for (int i=1;i<=size(NP);i++)
3164
+ {
3165
+ if (isVertexOfFace(NP[i][2],co))
3166
+ {
3167
+ NP1[size(NP1)+1]=NP[i];
3168
+ }
3169
+ }
3170
+ return(NP1);
3171
+ }
3172
+
3173
+ static proc isVertexOfFace(list F,intvec co)
3174
+ {
3175
+ if ((F[1]==co) or (F[2]==co)){return(1);}
3176
+ return(0);
3177
+ }
3178
+
3179
+ static proc isOnPolygon(intvec v,list NP)
3180
+ {
3181
+ int tst;
3182
+ cone c1,c2;
3183
+ v[size(v)+1]=1;
3184
+ int j;
3185
+ intvec w;
3186
+ for (int i=1;i<=size(NP);i++)
3187
+ {
3188
+ list L;
3189
+ for (j=1;j<=size(NP[i][2]);j++)
3190
+ {
3191
+ w=NP[i][2][j];
3192
+ w[size(w)+1]=1;
3193
+ L[j]=w;
3194
+ }
3195
+ c1=poshull(L);
3196
+ L[size(L)+1]=v;
3197
+ c2=poshull(L);
3198
+ if (c1==c2){return(1);}
3199
+ kill L;
3200
+ }
3201
+ return(0);
3202
+ }
3203
+
3204
+ static proc weightsOfNewtonPolygon(list NP)
3205
+ {
3206
+ list wt;
3207
+ for (int i =1;i<=size(NP);i++)
3208
+ {
3209
+ wt[i]=NP[i][1];
3210
+ }
3211
+ return(wt);
3212
+ }
3213
+
3214
+ static proc truncateAtHighestCorner(RightEquivalenceChainWithPrecision Tr,list #)
3215
+ {
3216
+ def S = basering;
3217
+ if(size(#) > 0) // read optional parameter
3218
+ {
3219
+ if(size(#) > 1 || typeof(#[1]) != "int")
3220
+ {
3221
+ ERROR("Wrong optional parameters.");
3222
+ }
3223
+ else
3224
+ {
3225
+ int b = #[1];
3226
+ }
3227
+ }
3228
+ else
3229
+ {
3230
+ int b=-1;
3231
+ }
3232
+ Poly F = Tr.targetgerm;
3233
+ def R =F.in;
3234
+ setring R;
3235
+ poly f = F.value;
3236
+ int i=0;
3237
+ if(b<0)
3238
+ {
3239
+ int p = 33000;
3240
+ while(b<0)
3241
+ {
3242
+ i=i+1;
3243
+ if(i==3)
3244
+ {
3245
+ setring R;
3246
+ list L=factorize(f);
3247
+ for(int j = 1;j<=size(L[2]);j++)
3248
+ {
3249
+ if(L[2][j]>1)
3250
+ {
3251
+ Tr.precision=-1;
3252
+ return(Tr);
3253
+ }
3254
+ }
3255
+ }
3256
+ p = prime(p-1);
3257
+ list l = ringlist(R);
3258
+ l[1] = p;
3259
+ ring R1 = ring(l);
3260
+ setring R1;
3261
+ poly f = fetch(R,f);
3262
+ ideal I = jacob(f);
3263
+ I = std(I);
3264
+ if(dim(I)<>0)
3265
+ {
3266
+ b=-1;
3267
+ }
3268
+ else
3269
+ {
3270
+ int hc;
3271
+ b = deg(highcorner(I));
3272
+ Tr.HC=b+1;
3273
+ b = b+2;
3274
+ int j;
3275
+ for(j = 1; j < 3; j++)
3276
+ {
3277
+ hc = deg(highcorner(std(maxideal(j)*I)));
3278
+ hc = hc+2-j;
3279
+ if(hc < b)
3280
+ {
3281
+ b = hc;
3282
+ }
3283
+ }
3284
+ }
3285
+ }
3286
+ }
3287
+ setring R;
3288
+ Tr.precision = b;
3289
+ F.value = jet(F.value,b);
3290
+ Tr.targetgerm = F;
3291
+ setring S;
3292
+ return(Tr);
3293
+ }
3294
+
3295
+
3296
+ static proc lowestJet(poly f, intvec w)
3297
+ {
3298
+ if (f==0){return(f);}
3299
+ list mon = terms(f);
3300
+ int wt;
3301
+ int mindg = weighteddeg(mon[1],w);
3302
+ for (int i=2;i<=size(mon);i++)
3303
+ {
3304
+ wt = weighteddeg(mon[i],w);
3305
+ if (wt<mindg){mindg=wt;}
3306
+ }
3307
+ return(jet(f,mindg,w));
3308
+ }
3309
+
3310
+ static proc setminus(list A, list B)
3311
+ {
3312
+ list L;
3313
+ if (size(A)==0||size(B)==0){return(A);}
3314
+ int i,j,l;
3315
+ l=1;
3316
+ int tst;
3317
+ for (i=1;i<=size(A);i++)
3318
+ {
3319
+ tst=0;
3320
+ for (j=1;j<=size(B);j++)
3321
+ {
3322
+ if(B[j]==A[i]){tst=1;break;}
3323
+ }
3324
+ if(tst==0){L[size(L)+1]=A[i];}
3325
+ }
3326
+ return(L);
3327
+ }
3328
+
3329
+ static proc setminusList(list A, list B)
3330
+ {
3331
+ list L;
3332
+ if (size(A)==0||size(B)==0){return(A);}
3333
+ int i,j,l;
3334
+ l=1;
3335
+ int tst;
3336
+ for (i=1;i<=size(A);i++)
3337
+ {
3338
+ tst=0;
3339
+ for (j=1;j<=size(B);j++)
3340
+ {
3341
+ if(B[j][1]==A[i][1] & B[j][2]==A[i][2]){tst=1;break;}
3342
+ }
3343
+ if(tst==0){L[size(L)+1]=A[i];}
3344
+ }
3345
+ return(L);
3346
+ }
3347
+
3348
+ static proc weighteddeg(poly f,intvec w)
3349
+ {
3350
+ return(deg(f,w));
3351
+ }
3352
+
3353
+ static proc doLinearTransformation(RightEquivalenceChainWithPrecision Tr)
3354
+ {
3355
+ Poly F = Tr.targetgerm;
3356
+ setring(F.in);
3357
+ poly f = F.value;
3358
+ int m = maximumFiltration(f);
3359
+ poly g= jet(f,m);
3360
+ def R= basering;
3361
+ def S=absFactorize(g);
3362
+ setring S;
3363
+ list L = absolute_factors;
3364
+ intvec Sort = sort(L[2])[2];
3365
+ number mp;
3366
+ mp = leadcoef(L[3][Sort[size(Sort)]]);
3367
+ if(mp<>a)
3368
+ {
3369
+ minpoly = mp;
3370
+ }
3371
+ poly g = fetch(R,g);
3372
+ poly f = fetch(R,f);
3373
+ list L = factorize(g);
3374
+ Sort = sort(L[2])[2];
3375
+ if(L[2][Sort[size(Sort)]]>1)
3376
+ {
3377
+ poly fx = L[1][Sort[size(Sort)]];
3378
+ }
3379
+ else
3380
+ {
3381
+ poly fx = var(1);
3382
+ }
3383
+ if(L[2][Sort[size(Sort)-1]]>1)
3384
+ {
3385
+ poly fy = L[1][Sort[size(Sort)-1]];
3386
+ }
3387
+ else
3388
+ {
3389
+ if(fx == var(2))
3390
+ {
3391
+ poly fy=var(1);
3392
+ }
3393
+ else
3394
+ {
3395
+ poly fy = var(2);
3396
+ }
3397
+ }
3398
+ poly ff = lintrafo(f,ideal(fx,fy));
3399
+ poly recordx = lintrafo(var(1),ideal(fx,fy));
3400
+ poly recordy = lintrafo(var(2),ideal(fx,fy));
3401
+
3402
+ int j = L[2][Sort[size(Sort)]];
3403
+ int k = L[2][Sort[size(Sort)-1]];
3404
+ if(j==1){j = 0;}
3405
+ if(k==1){k=0;}
3406
+ poly f0 = jet(ff,maximumFiltration(ff));
3407
+ poly ff0 = f0/(var(1)^j*var(2)^k);
3408
+ if(milnor(ff0)<0 && deg(ff0)!=0)
3409
+ {
3410
+ ERROR("The Normal for does not have a nondegenerate Newton Boundary");
3411
+ }
3412
+ if(k==0 && deg(ff0)!=0)
3413
+ {
3414
+ int max = maximumFiltration(ff);
3415
+ number a1=coeff(ff,var(1)^(j+1)*var(2)^(max-j-1));
3416
+ number a2=coeff(ff,var(1)^j*var(2)^(max-j));
3417
+ ff=lintrafo(ff,ideal(var(1),var(2)+a1/((max-j)*a2)*x));
3418
+ recordx = lintrafo(recordx,ideal(var(1),var(2)+a1/((max-j)*a2)*x));
3419
+ recordy = lintrafo(recordy,ideal(var(1),var(2)+a1/((max-j)*a2)*x));
3420
+ }
3421
+ Poly FF=makePoly(ff);
3422
+ PolynomialRightEquivalence Lin;
3423
+ Lin.in = basering;
3424
+ Poly Recordx = makePoly(recordx);
3425
+ Poly Recordy = makePoly(recordy);
3426
+ Lin.images = list(recordx,recordy);
3427
+ Lin.imagesInverse = list(fx,fy);
3428
+ Tr.transformations = list(Lin);
3429
+ Tr.targetgerm = FF;
3430
+ return(Tr);
3431
+ }
3432
+
3433
+ static proc setunion(list A, list B)
3434
+ {
3435
+ list L=A;
3436
+ int i,j,l;
3437
+ l=1;
3438
+ int tst;
3439
+ for (i=1;i<=size(B);i++)
3440
+ {
3441
+ tst=0;
3442
+ for (j=1;j<=size(L);j++)
3443
+ {
3444
+ if (L[j]==B[i]){tst=1;}
3445
+ }
3446
+ if (tst==0){L[size(L)+1]=B[i];}
3447
+ }
3448
+ return(L);
3449
+ }
3450
+
3451
+ static proc lintrafo(poly f, ideal T)
3452
+ {
3453
+ def R=basering;
3454
+ list L=ringlist(R);
3455
+ L[2]=L[2]+list("xx","yy");
3456
+ L[3][1][2]=intvec(1,1,1,1);
3457
+ L[3][1][1]="lp";
3458
+ def RR=ring(L);
3459
+ setring RR;
3460
+ ideal T=fetch(R,T);
3461
+ ideal I = xx-T[1],yy-T[2];
3462
+ option(redSB);
3463
+ ideal Is = std(I);
3464
+ poly fx = -subst(Is[2],x,0)/(coeff(Is[2],x));
3465
+ poly fy = -subst(Is[1],y,0)/(coeff(Is[1],y));
3466
+ poly ff = subst(fetch(R,f),x,fx,y,fy);
3467
+ list L=ringlist(RR);
3468
+ L[2]=list("xx","yy");
3469
+ L[3][1][2]=intvec(1,1);
3470
+ def R1=ring(L);
3471
+ setring R1;
3472
+ poly ff = imap(RR,ff);
3473
+ setring R;
3474
+ return(fetch(R1,ff));
3475
+ }
3476
+
3477
+ static proc doWeightedLinearTransformationExt(poly f1,list NF1,RightEquivalenceChainWithPrecision Tr)
3478
+ {
3479
+ ring R = basering;
3480
+ int d = Tr.precision;
3481
+ Poly F = Tr.targetgerm;
3482
+ setring F.in;
3483
+ poly fvalue = F.value;
3484
+ list NPfvalue = newtonPolygon(fvalue);
3485
+ List Fac=factorWeightedLowestJetExt(fvalue,NF1);
3486
+ def S = Fac.in;
3487
+ setring S;
3488
+ if(S<>R)
3489
+ {
3490
+ poly f1 = fetch(R,f1);
3491
+ }
3492
+ list fac = Fac.values;
3493
+ poly n = Fac.newFromOld;
3494
+ int s;
3495
+ for(int i = 1;i<=size(fac);i++)
3496
+ {
3497
+ if(deg(fac[i][1])>1 && ord(fac[i][1])==1)
3498
+ {
3499
+ s=i;
3500
+ }
3501
+ }
3502
+ poly g=1;
3503
+ if(n<>0)
3504
+ {
3505
+ f1 = subst(f1,a,n);
3506
+ }
3507
+ list NP = newtonPolygon(f1);
3508
+ if(NP[1][1][1]>NP[1][1][2])
3509
+ {
3510
+ if(deg(subst(fac[s][1],var(2),0))>1){return(Tr,0);}
3511
+ for(i=1;i<=size(fac);i++)
3512
+ {
3513
+ if(i!=s)
3514
+ {
3515
+ poly h = (fac[i][1])^(fac[i][2]);
3516
+ g=g*h;
3517
+ }
3518
+ }
3519
+ g = sat_with_exp(ideal(g),ideal(var(1)*var(2)))[1][1];
3520
+ if(milnor(g)==-1 && g!=1)
3521
+ {
3522
+ return(Tr,0);
3523
+ }
3524
+ if(R<>S)
3525
+ {
3526
+ poly fvalue = fetch(R,fvalue);
3527
+ }
3528
+ if(n<>0)
3529
+ {
3530
+ fvalue = subst(fvalue,a,n);
3531
+ }
3532
+ poly rs=subst(fac[1][1],var(1),0);
3533
+ fvalue=subst(fvalue,var(1),var(1)-rs);
3534
+ PolynomialRightEquivalence RE;
3535
+ RE.in=basering;
3536
+ RE.images = list(makePoly(var(1)-rs),makePoly(var(2)));
3537
+ RE.imagesInverse = list(makePoly(var(1)+rs),makePoly(var(2)));
3538
+ Tr.transformations[size(Tr.transformations)+1]=RE;
3539
+ Tr.targetgerm.in = basering;
3540
+ Tr.targetgerm.value=fvalue;
3541
+ }
3542
+ else
3543
+ {
3544
+ if(deg(subst(fac[s][1],var(1),0))>1){"return";return(Tr,0);}
3545
+ for(int i=1;i<=size(fac);i++)
3546
+ {
3547
+ if(i!=s)
3548
+ {
3549
+ poly h = (fac[i][1])^(fac[i][2]);
3550
+ g=g*h;
3551
+ }
3552
+ }
3553
+ g = sat_with_exp(ideal(g),ideal(var(1)*var(2)))[1][1];
3554
+ if((milnor(g)==-1) && (g!=1))
3555
+ {
3556
+ return(Tr,0);
3557
+ }
3558
+ if(S<>R)
3559
+ {
3560
+ poly fvalue = fetch(R,fvalue);
3561
+ }
3562
+ if(n<>0)
3563
+ {
3564
+ fvalue = subst(fvalue,a,n);
3565
+ }
3566
+ poly rs=subst(fac[1][1],var(2),0);
3567
+ fvalue=subst(fvalue,var(2),var(2)-rs);
3568
+ PolynomialRightEquivalence RE;
3569
+ RE.in=basering;
3570
+ RE.images = list(makePoly(var(1)),makePoly(var(2)-rs));
3571
+ RE.imagesInverse = list(makePoly(var(1)),makePoly(var(2)+rs));
3572
+ Tr.transformations[size(Tr.transformations)+1]=RE;
3573
+ Tr.targetgerm.in = basering;
3574
+ Tr.targetgerm.value=fvalue;
3575
+ }
3576
+ Tr=truncateAtHighestCorner(Tr,Tr.precision);
3577
+ return(Tr,1);
3578
+ }
3579
+
3580
+ static proc doWeightedLinearTransformation(poly f1,list NF1,RightEquivalenceChainWithPrecision Tr)
3581
+ {
3582
+ ring R = basering;
3583
+ int d = Tr.precision;
3584
+ Poly F = Tr.targetgerm;
3585
+ poly fvalue = F.value;
3586
+ list NPfvalue = newtonPolygon(fvalue);
3587
+ list fac=factorWeightedLowestJet(fvalue,NF1);
3588
+ int s;
3589
+ for(int i = 1;i<=size(fac);i++)
3590
+ {
3591
+ if(deg(fac[i][1])>1 && ord(fac[i][1])==1)
3592
+ {
3593
+ s=i;
3594
+ }
3595
+ }
3596
+ poly g=1;
3597
+ list NP = newtonPolygon(f1);
3598
+ if(NP[1][1][1]>NP[1][1][2])
3599
+ {
3600
+ if(deg(subst(fac[s][1],var(2),0))>1){return(Tr,0);}
3601
+ for(i=1;i<=size(fac);i++)
3602
+ {
3603
+ if(i!=s)
3604
+ {
3605
+ poly h = (fac[i][1])^(fac[i][2]);
3606
+ g=g*h;
3607
+ }
3608
+ }
3609
+ g = sat_with_exp(ideal(g),ideal(var(1)*var(2)))[1][1];
3610
+ if(milnor(g)==-1 && g!=1)
3611
+ {
3612
+ return(Tr,0);
3613
+ }
3614
+ number c = coeff(fac[1][1],var(1));
3615
+ poly rs=(1/c)*subst(fac[1][1],var(1),0);
3616
+ fvalue=subst(fvalue,var(1),var(1)-rs);
3617
+ PolynomialRightEquivalence RE;
3618
+ RE.in=basering;
3619
+ RE.images = list(makePoly(var(1)-rs),makePoly(var(2)));
3620
+ RE.imagesInverse = list(makePoly(var(1)+rs),makePoly(var(2)));
3621
+ Tr.transformations[size(Tr.transformations)+1]=RE;
3622
+ Tr.targetgerm.in = basering;
3623
+ Tr.targetgerm.value=fvalue;
3624
+ }
3625
+ else
3626
+ {
3627
+ if(deg(subst(fac[s][1],var(1),0))>1){return(Tr,0);}
3628
+ for(i=1; i<=size(fac);i++)
3629
+ {
3630
+ if(i!=s)
3631
+ {
3632
+ poly h = (fac[i][1])^(fac[i][2]);
3633
+ g=g*h;
3634
+ }
3635
+ }
3636
+ ideal I =g;
3637
+ g = sat_with_exp(ideal(g),ideal(var(1)*var(2)))[1][1];
3638
+ if(milnor(g)==-1 && g!=1)
3639
+ {
3640
+ return(Tr,0);
3641
+ }
3642
+ number c = coeff(fac[1][1],var(2));
3643
+ poly rs=(1/c)*subst(fac[1][1],var(2),0);
3644
+ fvalue=subst(fvalue,var(2),var(2)-rs);
3645
+ PolynomialRightEquivalence RE;
3646
+ RE.in=basering;
3647
+ RE.images = list(makePoly(var(1)),makePoly(var(2)-rs));
3648
+ RE.imagesInverse = list(makePoly(var(1)),makePoly(var(2)+rs));
3649
+ Tr.transformations[size(Tr.transformations)+1]=RE;
3650
+ Tr.targetgerm.in = basering;
3651
+ Tr.targetgerm.value=fvalue;
3652
+ }
3653
+ Tr=truncateAtHighestCorner(Tr,Tr.precision);
3654
+ return(Tr,1);
3655
+ }
3656
+
3657
+ static proc twofaceelimination(poly f,intvec co){
3658
+ int mu=milnor(f);
3659
+ list NP=newtonPolygon(f);
3660
+ list L=latticePoints(NP);
3661
+ list L1;
3662
+ int l=1;
3663
+ for (int j=1;j<=size(L);j++){
3664
+ if ((L[j][1]==co[1]-1) or (L[j][2]==co[2]-1)) {
3665
+ L1[l]=L[j];
3666
+ l=l+1;
3667
+ }
3668
+ }
3669
+ poly f0=termsOnPolygon(f,NP);
3670
+ poly f1=f;
3671
+ intvec co1;
3672
+ number c1;
3673
+ poly mon;
3674
+ list wt;
3675
+ list NPadj=adjacentFacesOfNewtonPolygon(NP,co);
3676
+ for (j=1;j<=size(L1);j++){
3677
+ co1=L1[j];
3678
+ mon=x^co1[1]*y^co1[2];
3679
+ c1=coeff(f0,mon);
3680
+ mon=c1*x^co1[1]*y^co1[2];
3681
+ if (c1<>0){
3682
+ wt=weightsOfNewtonPolygon(NPadj);
3683
+ f1=removeMon(f,f0,wt[1],wt[2],mon);
3684
+ }
3685
+ }
3686
+ return(f1);
3687
+ }
3688
+
3689
+ static proc findFaces(poly f,list NP,list S0)
3690
+ {
3691
+ if (printlevel>0){"S0 = "+string(S0);}
3692
+ list facescontainingS0;
3693
+ list mNPi;
3694
+ for (int i=1;i<=size(NP);i++)
3695
+ {
3696
+ mNPi=monomials(termsOnPolygon(f,list(NP[i])));
3697
+ if (printlevel>0){
3698
+ "monomials on face "+string(mNPi);
3699
+ "intersection "+string(setintersection(mNPi,S0));
3700
+ }
3701
+ if (size(S0)==size(setintersection(mNPi,S0)))
3702
+ {facescontainingS0[size(facescontainingS0)+1]=NP[i];}
3703
+ }
3704
+ return(facescontainingS0);}
3705
+
3706
+ static proc factorWeightedLowestJetExt(poly f,list F){
3707
+ def R = basering;
3708
+ list RL = ringlist(R);
3709
+ poly g= termsOnPolygon(f,list(F));
3710
+ List SLLL;
3711
+ SLLL.newFromOld =number(0);
3712
+ list L = factorize(g);
3713
+ int k=0;
3714
+ for(int i = 2;i<=size(L[1]);i++)
3715
+ {
3716
+ int gcdf = gcd(deg(L[1][i]),ord(L[1][i]));
3717
+ if(gcdf>1)
3718
+ {
3719
+ poly h = L[1][i];
3720
+ poly h1 = subst(h,var(1),1);
3721
+ poly h2 = subst(h,var(2),1);
3722
+ if(deg(h1)<deg(h2))
3723
+ {
3724
+ poly g1 = subst(h1,var(2),var(1));
3725
+ }
3726
+ else
3727
+ {
3728
+ poly g1 = h2;
3729
+ }
3730
+ list H;
3731
+ if(minpoly==0)
3732
+ {
3733
+ def S= ring(RL);
3734
+ setring S;
3735
+ poly g1=fetch(R,g1);
3736
+ minpoly = number(subst(g1,var(1),a));
3737
+ poly g = fetch(R,g);
3738
+ list L = factorize(g);
3739
+ }
3740
+ else
3741
+ {
3742
+ k=1;
3743
+ splitring(g1,a);
3744
+ def K(i) = splitring(g1,a);
3745
+ setring K(i);
3746
+ SLLL.in = K(i);
3747
+ poly h = fetch(R,h);
3748
+ h = subst(h,a,erg[1]);
3749
+ list L = factorize(h);
3750
+ SLLL.newFromOld = number(erg[1]);
3751
+ }
3752
+ }
3753
+ }
3754
+ intvec fii=sort(L[2])[2];
3755
+ list LL;
3756
+ for (int i=1;i<=size(fii);i++){
3757
+ LL[size(fii)-i+1]=list(L[1][fii[i]],L[2][fii[i]]);
3758
+ }
3759
+ list LLL=LL[1..size(LL)-1];
3760
+ if (size(LL)==2){
3761
+ SLLL.in = basering;
3762
+ SLLL.values=list(LL[1]);
3763
+ if(k==1){setring R;}
3764
+ return(SLLL);
3765
+ }
3766
+ if(LLL[1][1]==var(1) || LLL[1][1]==var(2))
3767
+ {
3768
+ SLLL.values=list(LLL[2]);
3769
+ SLLL.in=basering;
3770
+ if(k==1){setring R;}
3771
+ return(SLLL);
3772
+ }
3773
+ SLLL.values=LLL;
3774
+ SLLL.in = basering;
3775
+ if(k==1){setring R;}
3776
+ return(SLLL);}
3777
+
3778
+ static proc factorWeightedLowestJet(poly f,list F){
3779
+ def R = basering;
3780
+ list RL = ringlist(R);
3781
+ poly g= termsOnPolygon(f,list(F));
3782
+ list L=factorize(g);
3783
+ intvec fii=sort(L[2])[2];
3784
+ list LL;
3785
+ for (int i=1;i<=size(fii);i++){
3786
+ LL[size(fii)-i+1]=list(L[1][fii[i]],L[2][fii[i]]);
3787
+ }
3788
+ list LLL=LL[1..size(LL)-1];
3789
+ if(size(LL)==2){
3790
+ return(list(LL[1]));
3791
+ }
3792
+ if(LLL[1][1]==var(1) || LLL[1][1]==var(2))
3793
+ {
3794
+ return(list(LLL[2]));
3795
+ }
3796
+ return(LLL);}
3797
+
3798
+ static proc deltaInvariant(Poly F,mu)
3799
+ {
3800
+ ring R = F.in;
3801
+ setring R;
3802
+ poly f = F.value;
3803
+ list NP = newtonPolygon(f);
3804
+ list V =verticesOfNP(NP);
3805
+ poly mon(1) = latticeToMonomials(V[1])[1];
3806
+ poly g = mon(1);
3807
+ int numberBranches=0;
3808
+ for(int i = 2;i<=size(V);i++)
3809
+ {
3810
+ poly mon(i) = latticeToMonomials(V[i])[1];
3811
+ g=g+mon(i);
3812
+ poly gs = sat_with_exp(ideal(g),ideal(var(1)*var(2)))[1][1];
3813
+ map phix = R,var(1),0;
3814
+ map phiy = R,0,var(2);
3815
+ poly gsx = phix(gs);
3816
+ poly gsy = phiy(gs);
3817
+ int ix =exponentvector(gsx)[1];
3818
+ int iy = exponentvector(gsy)[2];
3819
+ numberBranches =numberBranches +gcd(ix,iy);
3820
+ g=g-mon(i-1);
3821
+ }
3822
+ int delta = int((mu+numberBranches-1) div 2);
3823
+ setring R;
3824
+ return(list(delta, numberBranches))
3825
+ }
3826
+
3827
+
3828
+ static proc CutOff(poly g, poly h, int d, list w)
3829
+ {
3830
+ g = piecewiseJet(g,w,d);
3831
+ h = piecewiseJet(h,w,d);
3832
+ list Mon = monomials(g);
3833
+ poly g1;
3834
+ int o;
3835
+ for(int i = 1;i<=size(Mon);i++)
3836
+ {
3837
+ poly h1 = Mon[i]*h;
3838
+ o=piecewiseOrd(h1,w);
3839
+ if(o<d)
3840
+ {
3841
+ g1 = g1+coeff(g,Mon[i])*Mon[i];
3842
+ }
3843
+ }
3844
+ return(g1);
3845
+ }
3846
+
3847
+ proc idealOfHigherWeightedDeg(poly f, int d, list w, int dt;)
3848
+ {
3849
+ for(int i =1;i<=size(w);i++)
3850
+ {
3851
+ int gcdw(i)=gcd(w[i][1],w[i][2]);
3852
+ intvec wo(i) = w[i][1] div gcdw(i),w[i][2] div gcdw(i);
3853
+ int dg(i) = d div (gcdw(i));
3854
+ }
3855
+ ideal I;
3856
+ while(1==1)
3857
+ {
3858
+ poly tst=0;
3859
+ for(int i=1;i<=size(w);i++)
3860
+ {
3861
+ int di=d div gcdw(i);
3862
+ poly m;
3863
+ if(d mod gcdw(i) ==0)
3864
+ {
3865
+ int wsx = di div wo(i)[1];
3866
+ int l=0;
3867
+ for(int j=0;j<=wsx;j++)
3868
+ {
3869
+ int wsy = (di-(j*wo(i)[1])) div wo(i)[2];
3870
+ if((((di-(j*wo(i)[1])) mod wo(i)[2])<>0) && (piecewisedegree(var(1)^(j)*var(2)^(wsy+1),w)>d))
3871
+ {
3872
+ tst = tst+var(1)^(j)*var(2)^(wsy);
3873
+ }
3874
+ if(j*wo(i)[1]+wsy*wo(i)[2]==di)
3875
+ {
3876
+ m = var(1)^(j)*var(2)^(wsy);
3877
+ int dm=piecewisedegree(m,w);
3878
+ if(dm==d){l=1;}
3879
+ if(l==1)
3880
+ {
3881
+ tst=tst+m;
3882
+ I=I,m;
3883
+ l=0;
3884
+ }
3885
+ }
3886
+ }
3887
+ }
3888
+ }
3889
+ if(ord(tst)>dt){break;}
3890
+ d=d+1;
3891
+ }
3892
+ for(int i =0;i<=dt+1;i++)
3893
+ {
3894
+ I=I,var(1)^i*var(2)^(dt+1-i);
3895
+ }
3896
+ return(I);
3897
+ }
3898
+
3899
+
3900
+ static proc modalityNB(Poly F) //wrapper
3901
+ {
3902
+ ring R = F.in;
3903
+ setring R;
3904
+ poly f = F.value;
3905
+ int k,d,b,i,j,c;
3906
+ intvec v;
3907
+ list m,l,t;
3908
+ if (nvars(R)!=2)
3909
+ {
3910
+ return("check the number of variables");
3911
+ }
3912
+ l=newtonpoly(f);
3913
+ k=2;
3914
+ if (l[k][1]==2)
3915
+ {
3916
+ v=l[k][2]-l[k+1][2], l[k+1][1]-l[k][1];
3917
+ }
3918
+ else
3919
+ {
3920
+ v=l[k-1][2]-l[k][2], l[k][1]-l[k-1][1];
3921
+ }
3922
+ d=v[1]*l[k][1]+v[2]*l[k][2];
3923
+ b=(d-2*v[1]) div v[2];
3924
+ for (i=0;i<=b;i++)
3925
+ {
3926
+ j=0;
3927
+ while ((2+j)<=l[k][1])
3928
+ {
3929
+ c=(2+j)*v[1]+(2+i)*v[2];
3930
+ if (c<=d)
3931
+ {
3932
+ m=m+list(c);
3933
+ }
3934
+ j++;
3935
+ }
3936
+ }
3937
+ if (size(l)==2)
3938
+ {
3939
+ return(size(m));
3940
+ }
3941
+ else
3942
+ {
3943
+ for (k=2;k<=size(l)-1;k++)
3944
+ {
3945
+ intvec u=l[k][2]-l[k+1][2], l[k+1][1]-l[k][1];
3946
+ int e=u[1]*l[k][1]+u[2]*l[k][2];
3947
+ int a=(e-l[k][1]*u[1]) div u[2];
3948
+ for (i=0;i<=a;i++)
3949
+ {
3950
+ j=1;
3951
+ while ((l[k][1]+j)<=l[k+1][1])
3952
+ {
3953
+ int s=(l[k][1]+j)*u[1]+(2+i)*u[2];
3954
+ if (s<=e)
3955
+ {
3956
+ t=t+list(s);
3957
+ }
3958
+ j++;
3959
+ }
3960
+ }
3961
+ }
3962
+ return(size(m)+size(t));
3963
+ }
3964
+ }
3965
+
3966
+ static proc testNormalisationCondition(poly f)
3967
+ {
3968
+ poly g = sat_with_exp(ideal(f),ideal(var(1)*var(2)))[1][1];
3969
+ if(milnornumber(g)>-1)
3970
+ {
3971
+ int satx =sat_with_exp(ideal(f),ideal(var(1)))[2];
3972
+ int saty =sat_with_exp(ideal(f),ideal(var(2)))[2];
3973
+ if(satx==0 || saty==0)
3974
+ {
3975
+ list fact=factorize(g);
3976
+ for(int i=1;i<=size(fact[1]);i++)
3977
+ {
3978
+ int o=2;
3979
+ int d=1;
3980
+ if(ord(fact[1][i])>0)
3981
+ {
3982
+ o=ord(fact[1][i]);
3983
+ d=deg(fact[1][i]);
3984
+ }
3985
+ if(satx>1)
3986
+ {
3987
+ if(reduce(jet(fact[1][i],o),var(1))==0)
3988
+ {
3989
+ return(1);
3990
+ }
3991
+ }
3992
+ if(saty>1)
3993
+ {
3994
+ if(reduce(jet(fact[1][i],o),var(2))==0)
3995
+ {
3996
+ return(1);
3997
+ }
3998
+ }
3999
+ if(o>=1)
4000
+ {
4001
+ if(o>1)
4002
+ {
4003
+ int gcdf =gcd(deg(fact[1][i]),ord(fact[1][i]));
4004
+ if(gcdf==o)
4005
+ {
4006
+ return(0);
4007
+ }
4008
+ }
4009
+ if(o==1)
4010
+ {
4011
+ if(d<>1)
4012
+ {
4013
+ return(0);
4014
+ }
4015
+ }
4016
+ }
4017
+ }
4018
+ return(1);
4019
+ }
4020
+ else
4021
+ {
4022
+ return(1);
4023
+ }
4024
+ }
4025
+ return(0);
4026
+ }
4027
+
4028
+
4029
+ static proc cutCoordinateAxes(poly f)
4030
+ {
4031
+ int cx;
4032
+ int cy;
4033
+ list NP = newtonPolygon(f);
4034
+ list iv = verticesOfNP(NP);
4035
+ list wt = piecewiseWeightOfPolygon(NP);
4036
+ int d = wt[1][1]*iv[1][1]+wt[1][2]*iv[1][2];
4037
+ f=piecewiseJet(f,wt,d);
4038
+ ring R = basering;
4039
+ map phiy = R,0,y;
4040
+ map phix = R,x,0;
4041
+ if(phiy(f)<>0)
4042
+ {
4043
+ cy=exponentvector(phiy(f))[2];
4044
+ }
4045
+ else
4046
+ {
4047
+ if(NP[1][2][1][1]==1)
4048
+ {
4049
+ int cy = int(NP[1][2][1][2]+(NP[1][1][1] div NP[1][1][2]));
4050
+ }
4051
+ if(NP[1][2][2][1]==1)
4052
+ {
4053
+ int cy = int(NP[1][2][2][2]+(NP[2][1][1] div NP[2][1][2]));
4054
+ }
4055
+ if(NP[1][2][1][1]>1)
4056
+ {
4057
+ int cy = -1;
4058
+ }
4059
+ }
4060
+ if(phix(f)<>0)
4061
+ {
4062
+ cx=exponentvector(phix(f))[1];
4063
+ }
4064
+ else
4065
+ {
4066
+ if(NP[size(NP)][2][2][2]==1)
4067
+ {
4068
+ cx = int(NP[size(NP)][2][2][1]+(NP[size(NP)][1][1][2] div NP[size(NP)][1][1][1]));
4069
+ }
4070
+ if(NP[size(NP)][2][1][2]==1)
4071
+ {
4072
+ cx = int(NP[size(NP)][2][1][2]+(NP[size(NP)-1][1][1][2] div NP[size(NP)-1][1][1][1]));
4073
+ }
4074
+ }
4075
+ if(NP[size(NP)][2][2][2]>1)
4076
+ {
4077
+ int cx=-1;
4078
+ }
4079
+ if(cx==-1 || cy==-1)
4080
+ {int c==-1;}else{
4081
+ int c = max(cx,cy);}
4082
+ return(list(cx,cy,c))
4083
+ }
4084
+
4085
+ static proc morsesplitarnold(RightEquivalenceChainWithPrecision Tr, int k)
4086
+ {
4087
+ ring R = basering;
4088
+ Poly F = Tr.sourcegerm;
4089
+ setring F.in;
4090
+ poly f = F.value;
4091
+ int n = nvars(basering);
4092
+ /* get jet(f, 2) right */
4093
+ matrix H = concat(jet(jacob(jacob(f)), 0)/2, unitmat(n));
4094
+ H = sym_reduce(H);
4095
+ intvec perm_zero;
4096
+ intvec perm_neg;
4097
+ intvec perm_pos;
4098
+ int c;
4099
+ int lambda;
4100
+ int i;
4101
+ for(i = 1; i <= n; i++)
4102
+ {
4103
+ if(H[i, i] == 0)
4104
+ {
4105
+ perm_zero = perm_zero, i;
4106
+ c++;
4107
+ }
4108
+ if(H[i, i] < 0)
4109
+ {
4110
+ perm_neg = perm_neg, i;
4111
+ lambda++;
4112
+ }
4113
+ if(H[i, i] > 0)
4114
+ {
4115
+ perm_pos = perm_pos, i;
4116
+ }
4117
+ }
4118
+ intvec perm;
4119
+ if(size(perm_zero) > 1)
4120
+ {
4121
+ perm = perm, perm_zero[2..size(perm_zero)];
4122
+ }
4123
+ if(size(perm_neg) > 1)
4124
+ {
4125
+ perm = perm, perm_neg[2..size(perm_neg)];
4126
+ }
4127
+ if(size(perm_pos) > 1)
4128
+ {
4129
+ perm = perm, perm_pos[2..size(perm_pos)];
4130
+ }
4131
+ perm = perm[2..size(perm)];
4132
+ matrix T[n][n];
4133
+ matrix D[1][n];
4134
+ for(i = 1; i <= n; i++)
4135
+ {
4136
+ T[1..n, i] = H[perm[i], (n+1)..(2*n)];
4137
+ D[1, i] = H[perm[i], perm[i]];
4138
+ }
4139
+ matrix N[1][n] = matrix(maxideal(1))*transpose(T);
4140
+ f=transWithPrecision(f,N,k);
4141
+ PolynomialRightEquivalence RE;
4142
+ RE.in=basering;
4143
+ list L;
4144
+ for(int r=1;r<=n;r++)
4145
+ {
4146
+ L[r]=makePoly(N[1,r]);
4147
+ }
4148
+ RE.images = L;
4149
+ Tr.transformations[size(Tr.transformations)+1]=RE;
4150
+
4151
+ f = jet(f, k);
4152
+
4153
+ /* separate the variables */
4154
+ N=matrix(maxideal(1));
4155
+ matrix corank_part[1][n]=matrix(maxideal(1));
4156
+ for(i = c+1; i <= n; i++)
4157
+ {
4158
+ corank_part[1,i] = 0;
4159
+ }
4160
+ poly cpf = transWithPrecision(f,corank_part,k);
4161
+ poly h = f-jet(f, 2)-cpf;
4162
+ poly hi;
4163
+ while(h != 0)
4164
+ {
4165
+ for(i = c+1; i <= n; i++)
4166
+ {
4167
+ hi = h/var(i);
4168
+ N[1,i] = var(i)-hi/(2*D[1, i]);
4169
+ h = h-hi*var(i);
4170
+ }
4171
+ f=transWithPrecision(f,N,k);
4172
+ f = jet(f, k);
4173
+ RE.in=basering;
4174
+ for(int r=1;r<=n;r++)
4175
+ {
4176
+ L[r]=makePoly(N[1,r]);
4177
+ }
4178
+ RE.images = L;
4179
+ Tr.transformations[size(Tr.transformations)+1]=RE;
4180
+ poly cpf = transWithPrecision(f,corank_part,k);
4181
+ h = f-jet(f,2)-cpf;
4182
+ h=jet(h,k);
4183
+ }
4184
+ poly g = f-jet(f, 2);
4185
+ list M = monomials(jet(f,2));
4186
+ poly h;
4187
+ for(int j = 1;j<=size(M);j++)
4188
+ {
4189
+ h=h+M[j];
4190
+ }
4191
+ Poly P = makePoly(h);
4192
+ Poly F = makePoly(g);
4193
+ Tr.targetgerm = F;
4194
+ return(list(c,Tr,P));
4195
+ }
4196
+
4197
+ static proc sym_reduce(matrix A)//shifted
4198
+ {
4199
+ int r = nrows(A);
4200
+ int c = ncols(A);
4201
+ int n = r;
4202
+ if(n > c)
4203
+ {
4204
+ n = c;
4205
+ }
4206
+ poly q;
4207
+ int i, j;
4208
+ for(i = 1; i <= n; i++)
4209
+ {
4210
+ for(j = i+1; j <= n; j++)
4211
+ {
4212
+ if(A[i, j] != 0)
4213
+ {
4214
+ while(A[i, i] == 0)
4215
+ {
4216
+ A[1..r, i] = A[1..r, i]+A[1..r, j];
4217
+ A[i, 1..c] = A[i, 1..c]+A[j, 1..c];
4218
+ }
4219
+ q = A[i, j]/A[i, i];
4220
+ A[1..r, j] = A[1..r, j]-q*A[1..r, i];
4221
+ A[j, 1..c] = A[j, 1..c]-q*A[i, 1..c];
4222
+ }
4223
+ }
4224
+ }
4225
+ return(A);
4226
+ }
4227
+
4228
+
4229
+ static proc classifyNB(RightEquivalenceChainWithPrecision Tr, int flag, int flag2, int flag3)
4230
+ {
4231
+ def R=basering;
4232
+ /* Apply the Splitting Lemma */
4233
+ Tr.precision=-1;
4234
+ Poly F =Tr.targetgerm;
4235
+ def SS=F.in;
4236
+ setring SS;
4237
+ int nv = nvars(F.in);
4238
+ list L;
4239
+ L[1]=nv;
4240
+ Tr = truncateAtHighestCorner(Tr);
4241
+ Poly H;
4242
+ RightEquivalenceChainWithPrecision TrMorse;
4243
+ if(Tr.precision==-1){return(list(-1,Tr,nv,H,TrMorse,0));}
4244
+ if(Tr.precision==-1){return(list(-1,Tr,nv,H,TrMorse,0));}
4245
+ if(maximumFiltration(F.value)<3)
4246
+ {
4247
+ list L = morsesplitarnold(Tr,Tr.precision);
4248
+ H = L[3];
4249
+ TrMorse = L[2];
4250
+ Poly F = TrMorse.targetgerm;
4251
+ poly f = F.value;
4252
+ nv=L[1];
4253
+ if(nv<2){ if(nv==0){f=var(1)^2;}
4254
+ ring RR = 0,(var(1)),ds;
4255
+ setring RR;
4256
+ poly f = fetch(SS,f);
4257
+ int mu=milnor(f);
4258
+ Poly F = makePoly(f);
4259
+ Tr.targetgerm = F;
4260
+ Tr.sourcegerm =F;
4261
+ setring R;
4262
+ return(list(mu,Tr,nv,H,TrMorse,0));
4263
+ }
4264
+ list Rl = ringlist(SS);
4265
+ while(size(Rl[2])>nv)
4266
+ {
4267
+ Rl[2]=delete(Rl[2],nv+1);
4268
+ }
4269
+ def RR = ring(Rl);
4270
+ setring RR;
4271
+ poly f = fetch(SS,f);
4272
+ Poly F = makePoly(f);
4273
+ Tr.targetgerm =F;
4274
+ Tr.sourcegerm = F;
4275
+ }
4276
+ else
4277
+ {
4278
+ poly h = 0;
4279
+ Poly H=makePoly(h);
4280
+ }
4281
+ /* Case where corank(f)<=1*/
4282
+
4283
+ /*Transform the jet of maximal filtration*/
4284
+ if(flag2==0)
4285
+ {
4286
+ Tr = doLinearTransformation(Tr);
4287
+ }
4288
+
4289
+ /*Setring*/
4290
+ def RR = Tr.targetgerm.in;
4291
+ setring RR;
4292
+
4293
+ F = Tr.targetgerm;
4294
+
4295
+ /*Prelimanary Definitions*/
4296
+
4297
+ poly g = F.value;
4298
+ list NP,mf0,iv,el;
4299
+ poly f1,ff;
4300
+ list si,T;
4301
+ list delta;
4302
+ list ef0;
4303
+ list Gamma0;
4304
+ list deltalist;
4305
+ int foundcorner;
4306
+ list si0,si1,si2;
4307
+ int j;
4308
+ list fact;
4309
+ map phi1;
4310
+ map phi2;
4311
+ poly f1;
4312
+ int mu1;
4313
+ int i;
4314
+ int n;
4315
+ int d2;
4316
+ list monsi;
4317
+ list Delta;
4318
+ list elementS0;
4319
+ list chooseFace;
4320
+ poly termsOnChooseFace;
4321
+ poly satTermsOnChooseFace;
4322
+ ideal termsOnDelta;
4323
+ poly PolyTermsOnDelta;
4324
+ poly f0 = jet(g,maximumFiltration(g));
4325
+ NP=newtonPolygon(F.value);
4326
+ iv=verticesOfNP(NP);
4327
+ iv = latticeToMonomials(iv);
4328
+
4329
+ /*Define S0*/
4330
+ list S0 = setintersection(monomials(f0),iv);
4331
+ n = size(S0);
4332
+ while(1==1)
4333
+ {
4334
+ Tr = truncateAtHighestCorner(Tr,Tr.precision);
4335
+ F = Tr.targetgerm;
4336
+ /* Make sure f is convenient*/
4337
+
4338
+ phi1 = RR,0,var(2);
4339
+ phi2 = RR,var(1),0;
4340
+ g = F.value;
4341
+ if(phi1(g)==0)
4342
+ {
4343
+ NP=newtonPolygon(F.value);
4344
+ f1 = termsOnPolygon(F.value,NP);
4345
+ int mu = milnor(f1);
4346
+ if(mu<>-1){d2=mu;}else{d2=Tr.precision;}
4347
+ F.value=F.value+var(2)^(d2+1);
4348
+ Tr.targetgerm = F;
4349
+ }
4350
+ if(phi2(g)==0)
4351
+ {
4352
+ NP=newtonPolygon(F.value);
4353
+ f1 = termsOnPolygon(F.value,NP);
4354
+ int mu = milnor(f1);
4355
+ if(mu<>-1){d2=mu;}else{d2=Tr.precision;}
4356
+ F.value=F.value+var(1)^(d2+1);
4357
+ Tr.targetgerm=F;
4358
+ }
4359
+ si=el;
4360
+ si2=el;
4361
+ if(phi1(g)<>0 && phi2(g)<>0)
4362
+ {
4363
+ NP=newtonPolygon(F.value);
4364
+ f1 = termsOnPolygon(F.value,NP);
4365
+ }
4366
+ int mu = 0;
4367
+ j = size(NP);
4368
+ /*Test whether the milnor number of jet(F.value,Delta_i) is finite for all the faces Delta_i of NP*/
4369
+ for(i=1;i<=j;i++)
4370
+ {
4371
+ Delta[1]=NP[i];
4372
+ termsOnDelta = termsOnPolygon(f1,Delta);
4373
+ PolyTermsOnDelta=sat_with_exp(termsOnDelta,ideal(var(1)*var(2)))[1][1];
4374
+ mu1 = milnornumber(PolyTermsOnDelta);
4375
+ if(mu1<mu)
4376
+ {
4377
+ mu=mu1;
4378
+ }
4379
+ }
4380
+ if(mu==0)
4381
+ {
4382
+ if(flag==1)
4383
+ {
4384
+ mu =milnor(f1);
4385
+ setring R;
4386
+ return(list(mu,Tr,nv,H,TrMorse,1));
4387
+ }
4388
+ /* Test conditions of Definition 17*/
4389
+ i=1;
4390
+ while(i<=j)
4391
+ {
4392
+ if(basering<>RR)
4393
+ {
4394
+ poly f1 = fetch(RR,f1);
4395
+ ideal termsOnDelta;
4396
+ poly PolyTermsOnDelta;
4397
+ poly satTermsOnChooseFace;
4398
+ }
4399
+ Delta[1]=NP[i];
4400
+ termsOnDelta = termsOnPolygon(f1,list(Delta[1]));
4401
+ PolyTermsOnDelta=sat_with_exp(termsOnDelta,ideal(var(1)*var(2)))[1][1];
4402
+ if(testNormalisationCondition(termsOnDelta[1])==0)
4403
+ {
4404
+ satTermsOnChooseFace = sat_with_exp(ideal(termsOnDelta),ideal(x*y))[1][1];
4405
+ Tr=doWeightedLinearTransformationExt(satTermsOnChooseFace,Delta[1],Tr);
4406
+ Tr = truncateAtHighestCorner(Tr,Tr.precision);
4407
+ F = Tr.targetgerm;
4408
+ def S = F.in;
4409
+ setring S;
4410
+ }
4411
+ if(j==1){break;}
4412
+ i=i+(j-1);
4413
+ }
4414
+ poly g = F.value;
4415
+ NP=newtonPolygon(F.value);
4416
+ if(flag3==1)
4417
+ {
4418
+ poly f1 = termsOnPolygon(F.value,NP);
4419
+ list K = monomials(f1);
4420
+ for(int i = 1;i<=size(K);i++)
4421
+ {
4422
+ intvec v = leadexp(K[i]);
4423
+ if(v[1]==1)
4424
+ {
4425
+ poly gs=subst(g,var(1),0);
4426
+ intvec w = leadexp(gs);
4427
+ while(gs<>0)
4428
+ {
4429
+ number c1=coeff(f1,K[i]);
4430
+ number c2=coeff(gs,leadmonom(gs));
4431
+ poly rs=(c2/c1)*var(2)^(w[2]-v[2]);
4432
+ matrix N[1][2] = var(1)-rs,var(2);
4433
+ int d = Tr.precision;
4434
+ g=transWithPrecision(g,N,d);
4435
+ PolynomialRightEquivalence RE;
4436
+ RE.in=basering;
4437
+ RE.images = list(makePoly(var(1)-rs),makePoly(var(2)));
4438
+ RE.imagesInverse = list(makePoly(var(1)+rs),makePoly(var(2)));
4439
+ Tr.transformations[size(Tr.transformations)+1]=RE;
4440
+ Tr.targetgerm.in = basering;
4441
+ Tr.targetgerm.value=g;
4442
+ Tr = truncateAtHighestCorner(Tr,Tr.precision);
4443
+ F = Tr.targetgerm;
4444
+ g=F.value;
4445
+ gs=subst(g,var(1),0);
4446
+ intvec w = leadexp(gs);
4447
+ }
4448
+ }
4449
+ if(v[2]==1)
4450
+ {
4451
+ poly gs=subst(g,var(2),0);
4452
+ intvec w = leadexp(gs);
4453
+ while(gs<>0)
4454
+ {
4455
+ number c1=coeff(f1,K[i]);
4456
+ number c2=coeff(gs,leadmonom(gs));
4457
+ poly rs=(c2/c1)*var(1)^(w[1]-v[1]);
4458
+ matrix N[1][2] = var(1),var(2)-rs;
4459
+ int d = Tr.precision;
4460
+ g=transWithPrecision(g,N,d);
4461
+ PolynomialRightEquivalence RE;
4462
+ RE.in=basering;
4463
+ RE.images = list(var(1),var(2)-rs);
4464
+ RE.imagesInverse = list(var(1),var(2)+rs);
4465
+ Tr.transformations[size(Tr.transformations)+1]=RE;
4466
+ Tr.targetgerm.in = basering;
4467
+ Tr.targetgerm.value=g;
4468
+ Tr = truncateAtHighestCorner(Tr,Tr.precision);
4469
+ F = Tr.targetgerm;
4470
+ g=F.value;
4471
+ gs=subst(g,var(2),0);
4472
+ intvec w = leadexp(gs);
4473
+ }
4474
+ }
4475
+ }
4476
+ }
4477
+ NP=newtonPolygon(F.value);
4478
+ poly f1 = termsOnPolygon(F.value,NP);
4479
+ int mu = milnor(f1);
4480
+ if(mu<>-1){d2=mu;}else{d2=Tr.precision;}
4481
+ if(subst(g,var(1),0)==0)
4482
+ {
4483
+ F.value=F.value+var(2)^(d2+1);
4484
+ Tr.targetgerm = F;
4485
+ }
4486
+ if(subst(g,var(2),0)==0)
4487
+ {
4488
+ F.value=F.value+var(1)^(d2+1);
4489
+ Tr.targetgerm=F;
4490
+ }
4491
+ setring R;
4492
+ return(list(mu,Tr,nv,H,TrMorse,0));
4493
+ }
4494
+ /* Write monomials in S0 in terms of their exponent vectors */
4495
+
4496
+ for (i=1;i<=size(S0);i++)
4497
+ {
4498
+ ef0[i]=exponentvector(S0[i]);
4499
+ }
4500
+
4501
+ /* Determine the vertices of NP that is contained in S0 */
4502
+
4503
+ iv=verticesOfNP(NP);
4504
+ si=setintersection(ef0,iv);
4505
+
4506
+ monsi = latticeToMonomials(si);
4507
+
4508
+ /* Choose one of the elements of S0*/
4509
+
4510
+ elementS0[1] = monsi[1];
4511
+ poly s01 = elementS0[1];
4512
+ /* Find adjacent faces*/
4513
+ list adjacentFacesElementS0 = findFaces(F.value,NP,elementS0[1]);
4514
+ int k = size(adjacentFacesElementS0);
4515
+ for(int i = 1;i<=k;i++)
4516
+ {
4517
+ chooseFace = adjacentFacesElementS0[i];
4518
+ termsOnChooseFace = termsOnPolygon(F.value,list(chooseFace));
4519
+ satTermsOnChooseFace = sat_with_exp(ideal(termsOnChooseFace),ideal(x*y))[1][1];
4520
+ // while satTermsOnChooseFace is degenerate and the conditions in Rmk 17 are not satisfied do the required weighted transformation
4521
+ while(milnornumber(satTermsOnChooseFace)==-1)
4522
+ {
4523
+ poly ff = F.value;
4524
+ Tr=doWeightedLinearTransformation(satTermsOnChooseFace,chooseFace,Tr);
4525
+ Tr = truncateAtHighestCorner(Tr,Tr.precision);
4526
+ F = Tr.targetgerm;
4527
+ poly ff=F.value;
4528
+ if(ff==0)
4529
+ {
4530
+ ERROR("the input polynomial is not equivalent to a germ with a nondegenerate Newton Boundary.")
4531
+ }
4532
+ NP = newtonPolygon(F.value);
4533
+ adjacentFacesElementS0 = findFaces(F.value,NP,s01);
4534
+ chooseFace = adjacentFacesElementS0[i];
4535
+ poly termsOnChooseFace=termsOnPolygon(F.value,list(chooseFace));
4536
+ poly satTermsOnChooseFace = sat_with_exp(ideal(termsOnChooseFace),ideal(var(1)*var(2)))[1][1];
4537
+ }
4538
+ }
4539
+ NP = newtonPolygon(F.value);
4540
+ list NPadj=adjacentFacesOfNewtonPolygon(NP,si[1]);
4541
+ poly f2 = termsOnPolygon(F.value,NPadj);
4542
+ T[size(T)+1]=monsi[1];
4543
+ list L = setminus(monomials(f2),T);
4544
+ S0 = setunion(S0,L);
4545
+ S0=setminus(S0,T);
4546
+ list iv=verticesOfNP(NP);
4547
+ iv = latticeToMonomials(iv);
4548
+ S0 = setintersection(S0,iv);
4549
+ }
4550
+
4551
+
4552
+ }
4553
+