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 0x26cde00 -- [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 = 4189 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.014997 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 0x21b0800 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 4 at 0x26cdc40 -- [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 0x26cda80 -- [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.007999 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 0x21b0500 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 3 3 4 2 5 2 3 1 2 2 2 1 2 o12 = ideal (-a + -a b + -a*b + 10b + -a c + -a*b*c + b c + -a d + a*b*d + 2 3 2 5 3 8 ----------------------------------------------------------------------- 3 2 5 2 4 2 7 1 2 4 2 5 3 10 2 --b d + -a*c + -b*c + a*c*d + --b*c*d + -a*d + -b*d + -c + --c d + 10 3 7 10 9 5 4 9 ----------------------------------------------------------------------- 2 3 3 3 1 2 2 2 3 8 2 4 5 2 2 c*d + --d , 5a + -a b + -a*b + 2b + -a c + -a*b*c + -b c + 6a d + 10 8 3 3 9 2 ----------------------------------------------------------------------- 6 1 2 5 2 1 2 1 7 2 2 2 9 3 -a*b*d + -b d + -a*c + -b*c + -a*c*d + 2b*c*d + -a*d + -b*d + -c + 5 3 9 2 5 2 5 8 ----------------------------------------------------------------------- 3 2 6 2 2 3 1 3 4 2 2 7 3 9 2 2 -c d + -c*d + -d , -a + -a b + 2a*b + -b + -a c + a*b*c + b c + 5 5 3 2 3 3 7 ----------------------------------------------------------------------- 2 2 9 2 9 2 8 10 2 7 2 2a d + 6a*b*d + 3b d + -a*c + -b*c + -a*c*d + --b*c*d + a*d + -b*d 4 2 7 7 2 ----------------------------------------------------------------------- 3 3 2 2 2 3 + 3c + -c d + c*d + -d ) 4 3 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 6 at 0x26cd8c0 -- [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 removing gb 1 at 0x265d000 -- 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.162975 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 132667957364155255824164210172450098735668611776006945224744974776824 ----------------------------------------------------------------------- 203000000c27-1099334678798135095946175321776226914831629904643225425657 ----------------------------------------------------------------------- 83981479173008200000c26d+ ----------------------------------------------------------------------- 14644910836226690373510304075450537672502978824651267299389007895120722 ----------------------------------------------------------------------- 525000c25d2-41402751320268868738280573375267882742267809489986403742739 ----------------------------------------------------------------------- 05665352704229000c24d3- ----------------------------------------------------------------------- 55732184271927794051764450081071482252669220802186722676515493380062195 ----------------------------------------------------------------------- 2075200c23d4+5219829762379697854944791766418812561065408487504815926819 ----------------------------------------------------------------------- 38674278668893779060c22d5- ----------------------------------------------------------------------- 56822387410859439062724738886628394281176757779999204446663475225741785 ----------------------------------------------------------------------- 2924508c21d6-1304817082886252055489535799728646131556812612259367319969 ----------------------------------------------------------------------- 65729124654347041242c20d7+ ----------------------------------------------------------------------- 48004318493838871942151758330883913166489789629851829182421030289239509 ----------------------------------------------------------------------- 2531170c19d8+2134433158498758746566881497262320747125124772511755287759 ----------------------------------------------------------------------- 778846956606915837c18d9+ ----------------------------------------------------------------------- 77502167720314856960246189189152368590425829578579854969216717284031773 ----------------------------------------------------------------------- 6914766c17d10+771734848114616155418894005665595870578930132105812706848 ----------------------------------------------------------------------- 362518912263442493477c16d11+ ----------------------------------------------------------------------- 10371581483053678210433724650243414535273194727674601213085823783145197 ----------------------------------------------------------------------- 20146878c15d12+11818147083970265253144662453675261840069128445234662776 ----------------------------------------------------------------------- 06327680440532868081087c14d13+ ----------------------------------------------------------------------- 10753370306741153898687167114864413713725054511156949506135295879015533 ----------------------------------------------------------------------- 73624130c13d14+94970642678972968818066668301390831179207079080047619517 ----------------------------------------------------------------------- 9804173936791535206461c12d15+ ----------------------------------------------------------------------- 66175830045731127935638801581606353256171274149865351874512182053848243 ----------------------------------------------------------------------- 6476264c11d16+429783260995985911944193690711609299566675895081658918095 ----------------------------------------------------------------------- 277739623634388057840c10d17+ ----------------------------------------------------------------------- 23447165012258459895832735760065590980498061810913857836649754348795218 ----------------------------------------------------------------------- 4662756c9d18+1100959081298621730944535655796956239283360762608556947680 ----------------------------------------------------------------------- 34955787392890056832c8d19+ ----------------------------------------------------------------------- 42061529716105401401775768062843317143913733675517074047788048657947075 ----------------------------------------------------------------------- 803440c7d20+15246632082557528965335704255747500971930880469727217712501 ----------------------------------------------------------------------- 681574485403828420c6d21+ ----------------------------------------------------------------------- 23820611573284395189236286342544759027799664652607782771081438570400572 ----------------------------------------------------------------------- 54896c5d22+527521211571099632339171061556044276946520799213084383961536 ----------------------------------------------------------------------- 744120250317136c4d23-15774448494096412514097849054129426911481408856087 ----------------------------------------------------------------------- 352888255757156280555776c3d24- ----------------------------------------------------------------------- 10153511065778010465323137230225248233076551593779950982890122802127956 ----------------------------------------------------------------------- 4544c2d25+1177345341739492086560978785678101015721083562868924256412229 ----------------------------------------------------------------------- 8234399099392cd26+84380785445740023877627920495327249903869595858731424 ----------------------------------------------------------------------- 60940859636617000704d27 | 1 1 o16 : Matrix S <--- S |