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 0x2ce6e00 -- [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 = 4186 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.013998 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 0x24f6000 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 4 at 0x2ce6c40 -- [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 removing gb 1 at 0x2b82000 -- registering gb 5 at 0x2ce6a80 -- [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.043993 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 0x2078c00 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 2 3 6 2 2 1 3 2 8 2 3 2 5 o12 = ideal (-a + -a b + 6a*b + -b + 5a c + -a*b*c + 9b c + -a d + -a*b*d 3 7 5 5 8 2 ----------------------------------------------------------------------- 2 2 3 2 7 2 10 9 2 5 2 2 3 6 2 + -b d + -a*c + -b*c + 6a*c*d + --b*c*d + -a*d + -b*d + -c + -c d 3 8 2 9 8 7 7 7 ----------------------------------------------------------------------- 2 2 3 3 3 2 2 3 4 2 2 1 2 2 + c*d + -d , a + -a b + 4a*b + b + -a c + -a*b*c + -b c + a d + 5 5 3 5 4 ----------------------------------------------------------------------- 3 8 2 2 1 2 3 1 2 5 2 4 3 -a*b*d + -b d + a*c + -b*c + 2a*c*d + -b*c*d + -a*d + -b*d + -c + 5 5 3 5 3 6 3 ----------------------------------------------------------------------- 2 2 2 5 3 3 7 2 1 2 2 3 4 2 4 3 2 9c d + -c*d + -d , a + -a b + -a*b + -b + -a c + -a*b*c + -b c + 7 4 6 2 3 3 7 8 ----------------------------------------------------------------------- 5 2 3 7 2 9 2 10 2 6 6 2 1 2 -a d + -a*b*d + -b d + -a*c + --b*c + -a*c*d + 2b*c*d + -a*d + -b*d 4 5 9 7 7 5 7 3 ----------------------------------------------------------------------- 8 3 2 9 2 3 + -c + 5c d + -c*d + 6d ) 5 8 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 6 at 0x2ce68c0 -- [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.177973 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 633568315390036398986147947797313395612497492320430104868533900784663 ----------------------------------------------------------------------- 983979397120c27+1062805681494116451373361111734848492392879712369834162 ----------------------------------------------------------------------- 4290512726450511369609953280c26d+ ----------------------------------------------------------------------- 10696607108823744427086128464109812939505053709243353721731148063399535 ----------------------------------------------------------------------- 9414520934400c25d2+6049375308988139848428359471471241832352532056029419 ----------------------------------------------------------------------- 13336471052785443764046258570240c24d3+ ----------------------------------------------------------------------- 23880156303085702728074648359099896270941261768835381520628159592397397 ----------------------------------------------------------------------- 59693952392320c23d4+605569055060404207354362139341006330175040016495555 ----------------------------------------------------------------------- 5361858337731608582069731907908800c22d5+ ----------------------------------------------------------------------- 14354526354870827148393325227364180205910960300808655687595445374796168 ----------------------------------------------------------------------- 034113199998464c21d6+24730806544915194163616444284983454167542137092793 ----------------------------------------------------------------------- 789054725411824273334941463801296304c20d7+ ----------------------------------------------------------------------- 34949794423366697430227416375894473787935497432858974614453750503337775 ----------------------------------------------------------------------- 389151582424832c19d8-57215047382564030342881754927535755554672508370263 ----------------------------------------------------------------------- 11858444231748960049255022689949968c18d9+ ----------------------------------------------------------------------- 13375476895909138658978037526938628897297477700036498183349967107044818 ----------------------------------------------------------------------- 0114115964268896c17d10- ----------------------------------------------------------------------- 57593829401377391210721763600093962302461455769049753688703985287421368 ----------------------------------------------------------------------- 462777762451636c16d11+1009269368498177094645908388008173964300041955090 ----------------------------------------------------------------------- 41649649883633675683470442307506986592c15d12- ----------------------------------------------------------------------- 44541072445845914930772428548629782576171664704060957737421096131296498 ----------------------------------------------------------------------- 404443794595500c14d13+6086918872082387238677612234264216491401513612807 ----------------------------------------------------------------------- 777561178408736048405842861653009348c13d14+ ----------------------------------------------------------------------- 29644722754515288646272439775335300132088382927832467268119340150113819 ----------------------------------------------------------------------- 885712565608944c12d15-4176847665976881617260134718372650837197790969325 ----------------------------------------------------------------------- 289227651379563357241042367207949260c11d16- ----------------------------------------------------------------------- 10393354924582195756736042322973246331070509378065317843813896311880598 ----------------------------------------------------------------------- 93170146561905c10d17-21766657424294491539272328822622221266889916853309 ----------------------------------------------------------------------- 6215900864443615206413286113133964c9d18+ ----------------------------------------------------------------------- 34393366058964462588028741057236320539573857437701665515138258699962680 ----------------------------------------------------------------------- 037854504006c8d19+29319106798784901200620642495959341677757670755579035 ----------------------------------------------------------------------- 3203901322962058334631457680128c7d20- ----------------------------------------------------------------------- 18582274597349115838522125572614238309108726074246352238826984438864794 ----------------------------------------------------------------------- 3387738474717c6d21+1093847128410955444963124139693095220242008546539025 ----------------------------------------------------------------------- 0298474116001862857073931445244c5d22+ ----------------------------------------------------------------------- 17451241928728290731560431455023500800612471038666924443951910392594771 ----------------------------------------------------------------------- 531972222000c4d23-20790761386649501451726051327609587275993004450972966 ----------------------------------------------------------------------- 98092546766957594357682031552c3d24- ----------------------------------------------------------------------- 97197909218516206376031429730611706810931836791311232111325692087071351 ----------------------------------------------------------------------- 7427169280c2d25+9268291879955357739901958100746404423412883778003971107 ----------------------------------------------------------------------- 3703135687920844320686080cd26+ ----------------------------------------------------------------------- 23813432515425783512379722783838291419007542734242193679560812206310479 ----------------------------------------------------------------------- 358197760d27 | 1 1 o16 : Matrix S <--- S |