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 8.535e-6 seconds 3 6 9 o6 = 1 - 3T + 3T - T o6 : ZZ[T] |
i7 : time gens gb I; -- registering gb 2 at 0x3dcb1c0 -- [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 = 4181 -- #reduction steps = 50 -- #spairs done = 12 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.0183366 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 0x4c5a960 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 3 at 0x3dcb000 -- [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 0x27f8e00 -- [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.00741814 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 0x4c5a870 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 7 3 1 2 2 2 5 3 7 2 7 2 2 2 1 o12 = ideal (-a + -a b + -a*b + -b + -a c + -a*b*c + -b c + 6a d + -a*b*d 2 3 3 9 9 3 5 2 ----------------------------------------------------------------------- 1 2 2 1 2 1 2 2 2 3 2 + -b d + a*c + -b*c + 8a*c*d + -b*c*d + -a*d + 10b*d + 10c + 3c d 3 3 3 3 ----------------------------------------------------------------------- 9 2 3 2 3 2 7 2 7 3 2 5 5 2 1 2 + -c*d + 3d , -a + 10a b + -a*b + --b + 3a c + -a*b*c + -b c + -a d 2 9 4 10 6 3 7 ----------------------------------------------------------------------- 1 2 2 1 2 7 9 2 2 1 2 + 7a*b*d + -b d + 2a*c + -b*c + --a*c*d + -b*c*d + -a*d + -b*d + 5 9 10 2 3 7 ----------------------------------------------------------------------- 1 3 1 2 2 3 3 3 3 6 2 2 2 1 3 2 4 -c + -c d + 3c*d + -d , -a + -a b + -a*b + -b + a c + -a*b*c + 8 3 2 7 5 5 2 5 ----------------------------------------------------------------------- 5 2 3 2 5 2 4 2 3 2 4 1 2 -b c + -a d + 9a*b*d + -b d + -a*c + -b*c + -a*c*d + b*c*d + -a*d + 3 8 4 9 4 9 8 ----------------------------------------------------------------------- 9 2 9 3 1 2 5 2 8 3 -b*d + --c + -c d + -c*d + -d ) 4 10 4 4 9 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 5 at 0x27f8c40 -- [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 --removing gb 0 at 0x3dcb380 {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 -- #reduction steps = 284 -- #spairs done = 53 -- ncalls = 46 -- nloop = 54 -- nsaved = 0 -- -- used 0.102562 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 143670128008802850418371891202241291502493925027858700685720458684617 ----------------------------------------------------------------------- 25959552909211600000c27+ ----------------------------------------------------------------------- 85843758699106038031566861774277756350793964165667769735751558276755706 ----------------------------------------------------------------------- 602105133401200000c26d+ ----------------------------------------------------------------------- 92277084551384731272962856001411682249703540845819813058843360717226879 ----------------------------------------------------------------------- 4866838115686040000c25d2+ ----------------------------------------------------------------------- 86908571574670606047777499577929924751244437521454525998584823064635313 ----------------------------------------------------------------------- 96743343200347180000c24d3+ ----------------------------------------------------------------------- 36624813080952656061168351251022815967132729129195735517176509708885948 ----------------------------------------------------------------------- 134145790017142210000c23d4+ ----------------------------------------------------------------------- 16555392463794690748659652795010744210268941114433075391162261052641851 ----------------------------------------------------------------------- 3453233917525593232800c22d5+ ----------------------------------------------------------------------- 45168101637297360748968218072769550539051123133102451488784731785045094 ----------------------------------------------------------------------- 5202082781881109836600c21d6+ ----------------------------------------------------------------------- 86018324129013340232709346236579627547719855147681843891477069293055828 ----------------------------------------------------------------------- 8053944590550793089224c20d7+ ----------------------------------------------------------------------- 13760350647593042808140298750036765771952884906789175045800575574854623 ----------------------------------------------------------------------- 66714595594051942417520c19d8+ ----------------------------------------------------------------------- 14714493595540204483734749793773237446692734774441870744181611080248528 ----------------------------------------------------------------------- 13461806672497163835925c18d9+ ----------------------------------------------------------------------- 15067576815702963414137838232352980071443812602527687534135046550723063 ----------------------------------------------------------------------- 10011378382070259085740c17d10+ ----------------------------------------------------------------------- 70650712196892735182765953961719136348744886200112374158943759078379793 ----------------------------------------------------------------------- 0796174953522246416150c16d11+ ----------------------------------------------------------------------- 11130346797508320047066356253165172450059418635379389861730895149471072 ----------------------------------------------------------------------- 64313162356049028971750c15d12+ ----------------------------------------------------------------------- 72099776513531663227792087869121595334479654809232299026309137271496143 ----------------------------------------------------------------------- 9480352958315729541650c14d13+ ----------------------------------------------------------------------- 16978287127249753277686499550468062769900084461578697488776674327855050 ----------------------------------------------------------------------- 04312701028086011618000c13d14+ ----------------------------------------------------------------------- 16188370143446851178839274285822707014810881764530483563646956360643270 ----------------------------------------------------------------------- 24285795672411652683000c12d15+ ----------------------------------------------------------------------- 11067150361015143744699453602563999809259553957180494524871823624053511 ----------------------------------------------------------------------- 89473522220318232232000c11d16- ----------------------------------------------------------------------- 14399687568718197173538643067304418089163846134170708585358588263670379 ----------------------------------------------------------------------- 1034663326122296937500c10d17- ----------------------------------------------------------------------- 13505596644756725766516817989934871761617487772464801872441238617984381 ----------------------------------------------------------------------- 54086406214184902590000c9d18- ----------------------------------------------------------------------- 13671761622767266537232621794391457087308679801407180209002703741392082 ----------------------------------------------------------------------- 23797568828386648280000c8d19- ----------------------------------------------------------------------- 61322180205378488194766156802948629363227830947136264256217880024734486 ----------------------------------------------------------------------- 1050245034812259287500c7d20+ ----------------------------------------------------------------------- 14826257918290600009368779703528157010425297100585134662953986943948876 ----------------------------------------------------------------------- 5711922501548377675000c6d21+ ----------------------------------------------------------------------- 35383488626356822317276950260550646140117799580605999074144512673588064 ----------------------------------------------------------------------- 1361288418842486700000c5d22+ ----------------------------------------------------------------------- 15483340239291266026395631243602480771490355944961145385610669988172860 ----------------------------------------------------------------------- 2538943864524541125000c4d23- ----------------------------------------------------------------------- 22154949434262350284269293813343286213198701941109772961700044777195726 ----------------------------------------------------------------------- 893879795399755000000c3d24- ----------------------------------------------------------------------- 36036593893989276912599013558526318521722230045631475669741061919959012 ----------------------------------------------------------------------- 457601370895325000000c2d25- ----------------------------------------------------------------------- 56951951006615106149044279680914113102393004070936743521628658283354792 ----------------------------------------------------------------------- 46431179183000000000cd26+ ----------------------------------------------------------------------- 85077087335452822060682458658638143236375671903685674757629816036893153 ----------------------------------------------------------------------- 4554043656250000000d27 | 1 1 o16 : Matrix S <--- S |