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 6.006e-6 seconds 3 6 9 o6 = 1 - 3T + 3T - T o6 : ZZ[T] |
i7 : time gens gb I; -- registering gb 2 at 0xb407d10 -- [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 = 4171 -- ncalls = 10 -- nloop = 28 -- nsaved = 0 -- -- used 0.0175907 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 0xa9e6580 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 3 at 0xb407850 -- [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 4 at 0xb407720 -- [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 -- ncalls = 10 -- nloop = 20 -- nsaved = 0 -- -- used 0.00753017 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 0xa9e6500 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 3 3 10 2 1 2 4 3 5 2 2 9 2 7 2 o12 = ideal (-a + --a b + -a*b + -b + -a c + -a*b*c + --b c + -a d + 5 3 5 3 9 3 10 3 ----------------------------------------------------------------------- 1 1 2 10 2 7 2 4 9 9 2 8 2 3 3 -a*b*d + -b d + --a*c + -b*c + -a*c*d + -b*c*d + --a*d + -b*d + -c 2 4 3 5 5 7 10 3 8 ----------------------------------------------------------------------- 5 2 1 2 3 3 3 1 2 7 2 3 3 1 2 9 2 + -c d + -c*d + d , -a + -a b + -a*b + -b + -a c + 8a*b*c + -b c + 6 6 4 3 3 2 2 4 ----------------------------------------------------------------------- 10 2 4 2 1 2 7 2 6 2 8 2 --a d + a*b*d + -b d + -a*c + --b*c + -a*c*d + b*c*d + 7a*d + -b*d 3 7 2 10 7 9 ----------------------------------------------------------------------- 3 1 2 2 3 3 1 3 1 2 4 2 7 3 1 2 + 8c + -c d + 7c*d + -d , -a + --a b + -a*b + -b + -a c + 9a*b*c + 3 4 2 10 5 3 6 ----------------------------------------------------------------------- 2 5 2 1 5 2 10 2 2 2 1 1 2 2b c + -a d + -a*b*d + -b d + --a*c + -b*c + a*c*d + -b*c*d + -a*d + 7 2 4 9 3 8 3 ----------------------------------------------------------------------- 5 2 3 2 4 2 8 3 -b*d + 5c + 2c d + -c*d + -d ) 4 7 7 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 5 at 0xb407390 -- [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 --removing gb 0 at 0xb407be0 {28}(0,2)number of (nonminimal) gb elements = 39 -- number of monomials = 1051 -- ncalls = 46 -- nloop = 54 -- nsaved = 0 -- -- used 0.227361 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 521357549177464751589063726149291012606636689620769586961370394717713 ----------------------------------------------------------------------- 0461687552000c27+771630390425268006513194313897440754530699965568800747 ----------------------------------------------------------------------- 39781585024623575375880780800c26d+ ----------------------------------------------------------------------- 48189724745659353897217521458488771173549335923481313538143260290072761 ----------------------------------------------------------------------- 2741150004480c25d2+1259692219600095182409875805010955697083264838575732 ----------------------------------------------------------------------- 546969923988096813672599940470272c24d3+ ----------------------------------------------------------------------- 30127609590592071534969774636110010847105641293401508364391329533608327 ----------------------------------------------------------------------- 97519059928832c23d4+407813655195767354733908592568781106181674588286032 ----------------------------------------------------------------------- 3139737181379387766107147505424896c22d5+ ----------------------------------------------------------------------- 43981687054259419509247861671426434546243034684133731276195763782331458 ----------------------------------------------------------------------- 32431075953216c21d6+855716689452710909178569680727022518551840940490573 ----------------------------------------------------------------------- 914598346285759122665492266308288c20d7- ----------------------------------------------------------------------- 52408641364299766777643979295898857398489962005791548398431122414220416 ----------------------------------------------------------------------- 35048425370080c19d8-102395158326752409184630487489746153020165012147110 ----------------------------------------------------------------------- 88020064618775122911082474504366528c18d9- ----------------------------------------------------------------------- 98004103825536325523769092330314514984545164463645707410105257500680093 ----------------------------------------------------------------------- 31771655775364c17d10-31447503434115477519504108357012221404679223167862 ----------------------------------------------------------------------- 1066670516399010046822181883845334c16d11+ ----------------------------------------------------------------------- 53932483855337784618825154900134485594929982501524087637285918158367075 ----------------------------------------------------------------------- 72122535365923c15d12+14851287832155100801655170341035611605602671912769 ----------------------------------------------------------------------- 699971852514422014903013889734116008c14d13- ----------------------------------------------------------------------- 47255130748592915642996610262697431428611468431020341682802453104440007 ----------------------------------------------------------------------- 8301762311840c13d14-722546219626382677031951474049730714941870429188514 ----------------------------------------------------------------------- 5138490315796225774569289695340320c12d15- ----------------------------------------------------------------------- 46432016004228975221360657121418910526514740676723071344537223273872325 ----------------------------------------------------------------------- 52997083407600c11d16-57077419337341163773958821169275999253959126788798 ----------------------------------------------------------------------- 91761925182933337985586701909092800c10d17+ ----------------------------------------------------------------------- 89226122812931244034165778623231173272563531740841738708663600641124802 ----------------------------------------------------------------------- 36857963020000c9d18+403352214847878394899869752988862181424213927219487 ----------------------------------------------------------------------- 638797879539698801042871780192000c8d19+ ----------------------------------------------------------------------- 67779623992759414597430535255822289609143317459656829184354484052657210 ----------------------------------------------------------------------- 54878301904000c7d20-160032794936432888870893805834307444759330165211261 ----------------------------------------------------------------------- 6714242680508239505475315069320000c6d21+ ----------------------------------------------------------------------- 15222059550308378327685971676192058771786284261687330359918279003013209 ----------------------------------------------------------------------- 03255345280000c5d22-112751497883560608943553596385305612556108319705901 ----------------------------------------------------------------------- 0763375500205103736096163940000000c4d23+ ----------------------------------------------------------------------- 12339674479353824676531592350918934759025033324484665639667953031159084 ----------------------------------------------------------------------- 1417804800000c3d24-2470448103523205343893993060089723919958148566193034 ----------------------------------------------------------------------- 50618826130489491503788144000000c2d25+ ----------------------------------------------------------------------- 37616606766712756544606455872793791144605707162327916420265550760310510 ----------------------------------------------------------------------- 95040000000cd26-1928760909663829306863251326541379688329238929822180648 ----------------------------------------------------------------------- 0362819200125544363200000000d27 | 1 1 o16 : Matrix S <--- S |