An installed Hilbert function will be used by Gröbner basis computations when possible.
Sometimes you know or are very sure that you know the Hilbert function. For example, in the following example, the Hilbert function of 3 random polynomials should be the same as the Hilbert function for a complete intersection.
i1 : R = ZZ/101[a..g]; |
i2 : I = ideal random(R^1, R^{3:-3}); o2 : Ideal of R |
i3 : hf = poincare ideal(a^3,b^3,c^3) 3 6 9 o3 = 1 - 3T + 3T - T o3 : ZZ[T] |
i4 : installHilbertFunction(I, hf) |
i5 : gbTrace=3 o5 = 3 |
i6 : time poincare I -- used 0. seconds 3 6 9 o6 = 1 - 3T + 3T - T o6 : ZZ[T] |
i7 : time gens gb I; -- registering gb 3 at 0x90c8130 -- [gb]{3}(3,3)mmm{4}(2,2)mm{5}(3,3)mmm{6}(2,6)mm{7}(1,4)m{8}(0,2) -- number of (nonminimal) gb elements = 11 -- number of monomials = 4169 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.057991 seconds 1 11 o7 : Matrix R <--- R |
Another important situation is to compute a Gröbner basis using a different monomial order. In the example below
i8 : R = QQ[a..d]; -- registering polynomial ring 5 at 0x95d9e10 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 4 at 0x945eab0 -- [gb] -- number of (nonminimal) gb elements = 0 -- number of monomials = 0 -- ncalls = 0 -- nloop = 0 -- nsaved = 0 -- o9 : Ideal of R |
i10 : time hf = poincare I -- registering gb 5 at 0x945e980 -- [gb]{3}(3)mmm{4}(2)mm{5}(3)mmm{6}(6)mmoooo{7}(4)mooo{8}(2)oo -- number of (nonminimal) gb elements = 11 -- number of monomials = 267 -- ncalls = 10 -- nloop = 20 -- nsaved = 0 -- -- used 0.010998 seconds 3 6 9 o10 = 1 - 3T + 3T - T o10 : ZZ[T] |
i11 : S = QQ[a..d,MonomialOrder=>Eliminate 2] -- registering polynomial ring 6 at 0x95d9d80 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 2 3 2 2 3 2 2 7 2 4 2 2 o12 = ideal (-a + 3a b + 3a*b + 4b + -a c + -a*b*c + b c + -a d + -a*b*d + 9 3 3 3 3 ----------------------------------------------------------------------- 3 2 9 2 1 2 7 1 3 2 5 2 3 7 2 -b d + --a*c + -b*c + -a*c*d + -b*c*d + -a*d + -b*d + 2c + -c d + 7 10 4 4 2 4 4 9 ----------------------------------------------------------------------- 7 2 1 3 1 3 8 2 9 2 3 1 2 2 1 2 -c*d + -d , -a + -a b + --a*b + 5b + -a c + 2a*b*c + 3b c + -a d + 2 6 3 3 10 6 3 ----------------------------------------------------------------------- 4 2 2 9 2 2 7 1 2 2 1 3 -a*b*d + -b d + -a*c + 2b*c + -a*c*d + -b*c*d + 10a*d + b*d + -c + 3 3 4 2 8 2 ----------------------------------------------------------------------- 1 2 7 2 10 3 1 3 1 2 2 3 4 2 8 2 -c d + -c*d + --d , -a + -a b + 2a*b + b + -a c + -a*b*c + 4b c + 5 8 7 2 5 3 9 ----------------------------------------------------------------------- 1 2 1 1 2 9 2 2 1 3 2 1 2 -a d + -a*b*d + -b d + -a*c + 8b*c + 8a*c*d + -b*c*d + -a*d + -b*d 5 2 5 8 3 7 3 ----------------------------------------------------------------------- 7 3 2 2 3 + --c + c d + c*d + d ) 10 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 6 at 0x945e5f0 -- [gb]{3}(3,3)mmm{4}(2,2)mm{5}(3,3)mmm{6}(3,7)mmm{7}(3,8)mmm{8}(3,9)mmm{9}(3,9)m -- mm{10}(2,8)mm{11}(1,5)m{12}(1,3)m{13}(1,3)m{14}(1,3)m{15}(1,3)m{16}(1,3)m -- {17}(1,3)m{18}(1,3)m{19}(1,3)m{20}(1,3)m{21}(1,3)m{22}(1,3)m{23}(1,3)m{24}(1,3)m -- {25}(1,3)m{26}(1,3)m{27}(1,3)m{28}(0,2) -- number of (nonminimal) gb elements = 39 -- number of monomials = 1051 -- ncalls = 46 -- nloop = 54 -- nsaved = 0 -- -- used 0.321951 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 937816595038335914739960672951569363600425022301250014576921206470509 ----------------------------------------------------------------------- 5966400c27+553839381047611069883832714325059035263064430853026861276918 ----------------------------------------------------------------------- 51585994198521600c26d+3568802937533028338803201861775339060393703857172 ----------------------------------------------------------------------- 56952435445162347508648861200c25d2+ ----------------------------------------------------------------------- 14064051075310710832687067411824036839698233105327940426552426391538845 ----------------------------------------------------------------------- 36962400c24d3+461505069891674251881570582601610961710650546588234530724 ----------------------------------------------------------------------- 7458741872738539777940c23d4+ ----------------------------------------------------------------------- 14344859548866658392110086942767318954900385982137945168732055719449838 ----------------------------------------------------------------------- 883032800c22d5+29722663452111597904782155436606104686335295011796074414 ----------------------------------------------------------------------- 000409581467482122656415c21d6+ ----------------------------------------------------------------------- 79064286741616776597536846481992372841050662757151980310924704344103800 ----------------------------------------------------------------------- 437641926c20d7+10624342446672533130041134378813354589170227798313608446 ----------------------------------------------------------------------- 6396170722700091376346760c19d8+ ----------------------------------------------------------------------- 25482273319092867512496024305726511840690035962537792917258816761242777 ----------------------------------------------------------------------- 1164518402c18d9+2042061458215750938389280043600804255079480251584673092 ----------------------------------------------------------------------- 96827902946108425045415705c17d10+ ----------------------------------------------------------------------- 48682829908063670211009834642587817801112200448562718920526403590648736 ----------------------------------------------------------------------- 4016050376c16d11+175107682745821764901151497054237728551422965466482162 ----------------------------------------------------------------------- 971520096222484050657007470c15d12+ ----------------------------------------------------------------------- 55682567694247836002926706734878394632445074170993857835589174664876928 ----------------------------------------------------------------------- 0685207780c14d13+307362983705321950800374972665662778191209780011787888 ----------------------------------------------------------------------- 4500697063294187055143200c13d14+ ----------------------------------------------------------------------- 44472418773010860814330775474368669134288759434852403991929110707082588 ----------------------------------------------------------------------- 5866705900c12d15-225624917216466107028362243398999128533536760354225623 ----------------------------------------------------------------------- 58892541066931195103555750c11d16+ ----------------------------------------------------------------------- 36917314725684967592508141244931752521512420144553095466089864062800981 ----------------------------------------------------------------------- 5063763000c10d17+103142803290502738157913811045131875168968707020786007 ----------------------------------------------------------------------- 419559722745847544307222375c9d18+ ----------------------------------------------------------------------- 25613842566679114219607773211357557414331830873483418730665471001459179 ----------------------------------------------------------------------- 6266314750c8d19+8207196630866889547983154595776185614397901946926779066 ----------------------------------------------------------------------- 2928263877025142306467500c7d20+ ----------------------------------------------------------------------- 78553003346672469169556628716019903147301709901451151064089968129211380 ----------------------------------------------------------------------- 461071250c6d21+12317428875338578122771418899520962879623886060393791927 ----------------------------------------------------------------------- 196212185510637925140625c5d22+ ----------------------------------------------------------------------- 83789462251634979169646678986839499491389697533916567386944677574073715 ----------------------------------------------------------------------- 40725000c4d23-361080268575726119030202013276330720881212307580912362513 ----------------------------------------------------------------------- 514744019853831750000c3d24+ ----------------------------------------------------------------------- 45710521106156747708881608400792378148508456836708193647474149701883469 ----------------------------------------------------------------------- 9250000c2d25-3143804156519704436008538449353566698543468813040026646873 ----------------------------------------------------------------------- 8855794033576000000cd26+ ----------------------------------------------------------------------- 37191161638359233482286348445449190714517247733584073586467112759735104 ----------------------------------------------------------------------- 000000d27 | 1 1 o16 : Matrix S <--- S |