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 4.637e-6 seconds 3 6 9 o6 = 1 - 3T + 3T - T o6 : ZZ[T] |
i7 : time gens gb I; -- registering gb 2 at 0xc187390 -- [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 = 4187 -- #reduction steps = 38 -- #spairs done = 11 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.0150669 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 3 at 0xc203088 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 3 at 0xc385e40 -- [gb]number of (nonminimal) gb elements = 0 -- number of monomials = 0 -- #reduction steps = 0 -- #spairs done = 0 -- ncalls = 0 -- nloop = 0 -- nsaved = 0 -- o9 : Ideal of R |
i10 : time hf = poincare I -- registering gb 4 at 0xc385d10 -- [gb]{3}(3)mmm{4}(2)mm{5}(3)mmm{6}(6)mmoooo{7}(4)mooo{8}(2)oonumber of (nonminimal) gb elements = 11 -- number of monomials = 267 -- #reduction steps = 236 -- #spairs done = 30 -- ncalls = 10 -- nloop = 20 -- nsaved = 0 -- -- used 0.00653335 seconds 3 6 9 o10 = 1 - 3T + 3T - T o10 : ZZ[T] |
i11 : S = QQ[a..d,MonomialOrder=>Eliminate 2] -- registering polynomial ring 4 at 0xc3822a8 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 5 3 9 2 7 2 5 3 4 2 1 2 4 2 8 o12 = ideal (-a + -a b + -a*b + -b + -a c + -a*b*c + 3b c + -a d + -a*b*d 7 7 8 7 9 4 7 5 ----------------------------------------------------------------------- 2 10 2 9 2 1 1 2 3 2 3 3 1 2 + 8b d + --a*c + -b*c + -a*c*d + -b*c*d + 4a*d + -b*d + -c + -c d 9 5 3 2 2 5 3 ----------------------------------------------------------------------- 2 1 3 3 3 7 2 2 1 3 2 5 5 2 2 2 + c*d + --d , -a + -a b + a*b + -b + 3a c + -a*b*c + -b c + -a d + 10 7 9 5 8 2 3 ----------------------------------------------------------------------- 2 2 2 2 4 2 7 2 7 2 1 3 2a*b*d + b d + a*c + -b*c + -a*c*d + -b*c*d + -a*d + -b*d + -c + 5 3 3 8 6 5 ----------------------------------------------------------------------- 1 2 4 2 3 3 3 3 3 2 6 2 3 4 2 4 4 2 -c d + -c*d + -d , -a + -a b + -a*b + 2b + -a c + -a*b*c + -b c + 4 5 2 2 2 5 5 5 9 ----------------------------------------------------------------------- 2 4 9 2 2 1 2 2 2 7 2 a d + -a*b*d + -b d + a*c + -b*c + a*c*d + -b*c*d + a*d + -b*d + 3 8 2 5 9 ----------------------------------------------------------------------- 5 3 3 2 7 2 1 3 -c + -c d + -c*d + -d ) 9 5 4 5 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 5 at 0xc385980 -- [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 --removing gb 0 at 0xc187260 {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 -- #reduction steps = 284 -- #spairs done = 53 -- ncalls = 46 -- nloop = 54 -- nsaved = 0 -- -- used 0.183861 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 137302912952910803754391950784008814192934678252565603527101985354446 ----------------------------------------------------------------------- 313336340480c27+2466432141055537464862399181741734418706414907743996126 ----------------------------------------------------------------------- 120866487851117642416128000c26d+ ----------------------------------------------------------------------- 24297718863147225696762958387381521437086693641709745464937699312607752 ----------------------------------------------------------------------- 722021089280c25d2+16665304002988082744072826594412254042887350261000987 ----------------------------------------------------------------------- 3770884610092092691362679619584c24d3+ ----------------------------------------------------------------------- 87528200188966954670335006264623995195611639286943478005366162558247362 ----------------------------------------------------------------------- 0843439341568c23d4+3704971985846419127449764805684936010317765672228763 ----------------------------------------------------------------------- 494088789704752900579855852527616c22d5+ ----------------------------------------------------------------------- 13037637719708495412151627625803456737388517384715189178012298102811112 ----------------------------------------------------------------------- 341800279230464c21d6+38819807327145566670817017211156986850266940189155 ----------------------------------------------------------------------- 890066844701895861953471583457873920c20d7+ ----------------------------------------------------------------------- 98735808944752824506527932506623837822173963368828528790425710327839066 ----------------------------------------------------------------------- 108111504153600c19d8+21517304391447319018439315376158044265203028007786 ----------------------------------------------------------------------- 1978382108120716947728271244089689088c18d9+ ----------------------------------------------------------------------- 40061387852586244059155071018727728046135229667408221699618137114302546 ----------------------------------------------------------------------- 9326469804738944c17d10+ ----------------------------------------------------------------------- 63063324640832740041710595016011547647122605828635719763058348134245783 ----------------------------------------------------------------------- 6894981026297728c16d11+ ----------------------------------------------------------------------- 82185445825521398415807904905033152993382967300514165348951825427042752 ----------------------------------------------------------------------- 0723241750144960c15d12+ ----------------------------------------------------------------------- 84910423682629203879350115315403706091174048030799090334526403991777727 ----------------------------------------------------------------------- 4442508442470432c14d13+ ----------------------------------------------------------------------- 62741358918516821218322155628692704323608654356084717498764073455117505 ----------------------------------------------------------------------- 2750321592040560c13d14+ ----------------------------------------------------------------------- 21507597842941185650898501037286476087343438800681146899720041678272072 ----------------------------------------------------------------------- 8613913024183560c12d15- ----------------------------------------------------------------------- 17429732458243586447965595089077832359524034530254186571830582817456006 ----------------------------------------------------------------------- 3030504868941976c11d16- ----------------------------------------------------------------------- 32048072056024635487796077316827851467937286121222833596053785307582980 ----------------------------------------------------------------------- 3917673437515772c10d17- ----------------------------------------------------------------------- 19873906311749002618094747151987111809467680406869021141769850270079181 ----------------------------------------------------------------------- 1003164477106388c9d18+1713667635226944865691014985209997694401808855135 ----------------------------------------------------------------------- 750484248190149486680549920171548510c8d19+ ----------------------------------------------------------------------- 96053940541766958984610125520214133798819251495002042970789311595448584 ----------------------------------------------------------------------- 569370864739750c7d20+70866936562473689497898796291842590327257274091836 ----------------------------------------------------------------------- 607386082384030342495992542138246825c6d21+ ----------------------------------------------------------------------- 16544533990299888537721966030745628814634983924205000812359084496385273 ----------------------------------------------------------------------- 182655968830564c5d22-71059859459524407898208588182143835410390399630522 ----------------------------------------------------------------------- 88559643838366849862126278166822400c4d23- ----------------------------------------------------------------------- 58628639957729139185540581879628678030938796399943906058209411291688835 ----------------------------------------------------------------------- 60848238765190c3d24-720613469477594799722269461066210473250747256632397 ----------------------------------------------------------------------- 588786516553766861071171395766250c2d25+ ----------------------------------------------------------------------- 33908441979957319154097451032008529083038171864186068116536720398529163 ----------------------------------------------------------------------- 5660496593950cd26+12838129877663564518038275276660624832007497933759581 ----------------------------------------------------------------------- 3703251997236513547709985564025d27 | 1 1 o16 : Matrix S <--- S |