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 0x95f2390 -- [gb]{3}(3,3)mmm{4}(2,2)mm{5}(3,3)mm removing gb 1 at 0x95f2260 m{6}(2,6)mm{7}(1,4)m{8}(0,2) -- number of (nonminimal) gb elements = 11 -- number of monomials = 4191 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.048993 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 0x9576f30 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 4 at 0x94b2be0 -- [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 0x94b2ab0 -- [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.009998 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 0x9576ea0 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 4 3 7 2 9 2 3 3 7 2 1 2 2 2 1 o12 = ideal (-a + -a b + -a*b + -b + -a c + 5a*b*c + -b c + -a d + -a*b*d 9 6 2 4 3 5 7 5 ----------------------------------------------------------------------- 2 10 2 6 2 1 6 1 2 2 2 7 3 5 2 + 9b d + --a*c + -b*c + -a*c*d + -b*c*d + -a*d + -b*d + --c + -c d 3 7 8 5 3 3 10 4 ----------------------------------------------------------------------- 7 2 3 8 3 4 2 7 2 7 3 3 2 1 2 2 5 2 + -c*d + d , -a + -a b + --a*b + -b + -a c + --a*b*c + -b c + -a d 3 9 3 10 3 8 10 5 2 ----------------------------------------------------------------------- 1 2 9 2 2 5 1 3 2 2 + -a*b*d + 9b d + --a*c + 5b*c + -a*c*d + -b*c*d + -a*d + 2b*d + 9 10 4 5 4 ----------------------------------------------------------------------- 5 3 7 2 2 5 3 10 3 2 8 2 8 3 1 2 7 -c + -c d + 3c*d + -d , --a + 2a b + -a*b + -b + -a c + -a*b*c + 3 2 2 7 9 5 3 4 ----------------------------------------------------------------------- 1 2 2 2 3 3 2 7 2 3 2 1 2 -b c + -a d + -a*b*d + --b d + -a*c + -b*c + a*c*d + -b*c*d + 6a*d + 3 7 4 10 8 8 6 ----------------------------------------------------------------------- 1 2 10 3 2 3 2 2 3 -b*d + --c + 6c d + -c*d + -d ) 3 3 4 5 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 6 at 0x94b2720 -- [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.315952 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 153343861244801389114194781142009191020992514973140125321193909090336 ----------------------------------------------------------------------- 05029952628c27+18306580891043415819761288779055754830016129106023292949 ----------------------------------------------------------------------- 5453782367492236989700648c26d+ ----------------------------------------------------------------------- 97776272107752911812703253290634568376273049219198748871776976775368029 ----------------------------------------------------------------------- 4349908019c25d2-2282144497617010165815785419515141657941332940593516273 ----------------------------------------------------------------------- 756115917204455804021601794c24d3- ----------------------------------------------------------------------- 26325442833889751911379384877527756176503776392951672435190779935387172 ----------------------------------------------------------------------- 061295126765c23d4-75598580226149415372370148706279431365193668061572859 ----------------------------------------------------------------------- 107588482953214496774597263555c22d5+ ----------------------------------------------------------------------- 79981040728055481828297852584619774417903608378521080169798482634783729 ----------------------------------------------------------------------- 746658282452c21d6+28686110791762599371587408743017320186572228881479614 ----------------------------------------------------------------------- 4177938448498332692301822748086c20d7- ----------------------------------------------------------------------- 23154925261263615163154252176758676394731407602359764538034614931349995 ----------------------------------------------------------------------- 7260088496044c19d8-2364885764969183591241824823249826665831508510249883 ----------------------------------------------------------------------- 46405702095442928810023926075832c18d9+ ----------------------------------------------------------------------- 11817660232803292033784983926236372647706335429686965432834278242041808 ----------------------------------------------------------------------- 68078205660216c17d10+11578894866455393604268769616888658679765449005059 ----------------------------------------------------------------------- 6868982223820549309960416852133696c16d11- ----------------------------------------------------------------------- 19579048443930215596598049698064847258736138743617838898626991637316618 ----------------------------------------------------------------------- 95102497254656c15d12+91332466745108902831732017608230186207434999682654 ----------------------------------------------------------------------- 4749611330006278571790479460828704c14d13- ----------------------------------------------------------------------- 15146617262150214095562276417032455536909608772087512746479980070370967 ----------------------------------------------------------------------- 91807572878080c13d14+10507221903307309323221348283594149503633077220648 ----------------------------------------------------------------------- 15137135526735994599026765438698368c12d15- ----------------------------------------------------------------------- 31403140718995530655742121182595751566211335412684511010183317985462126 ----------------------------------------------------------------------- 0900695717504c11d16-153336564065056070405289580995328810377029176038574 ----------------------------------------------------------------------- 8618554872866536303111457062484736c10d17+ ----------------------------------------------------------------------- 18289451269086888387351293629386042902044735696469564041304832815318756 ----------------------------------------------------------------------- 185256672256c9d18-57745835943954047941550026070351980461216279816782774 ----------------------------------------------------------------------- 2537489596860978833199859056640c8d19+ ----------------------------------------------------------------------- 51578820918112500591252951876966431159585298082596178372633236071078792 ----------------------------------------------------------------------- 8310191678464c7d20-9345714876187533731089503373070099394467767520503723 ----------------------------------------------------------------------- 68627315451150844581079434641408c6d21- ----------------------------------------------------------------------- 10511506193131097291605389138636532308577236987890140402194955535790872 ----------------------------------------------------------------------- 9557760876544c5d22-2705226623810602449540757876292459538670583662890595 ----------------------------------------------------------------------- 77818426484237133229177372934144c4d23+ ----------------------------------------------------------------------- 11582795539993219162161072402050738810247679501648792625571336763023757 ----------------------------------------------------------------------- 6719656288256c3d24-9373988768599486152199037057900865831617567756678803 ----------------------------------------------------------------------- 2666836263721370703593257041920c2d25- ----------------------------------------------------------------------- 60913657042936238775835554541910218140589480728237006832153737867640250 ----------------------------------------------------------------------- 329831833600cd26-314579764200089718707717623957423443948616284855028961 ----------------------------------------------------------------------- 47070160424200229459329024000d27 | 1 1 o16 : Matrix S <--- S |