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 5.525e-6 seconds 3 6 9 o6 = 1 - 3T + 3T - T o6 : ZZ[T] |
i7 : time gens gb I; -- registering gb 2 at 0x412f8c0 -- [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 = 4190 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.0122276 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 0x491fc30 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 3 at 0x412f700 -- [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 0x412f540 -- [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.0059028 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 0x44e5f00 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 3 2 2 2 5 3 2 1 2 2 3 o12 = ideal (a + -a b + 3a*b + -b + 6a c + a*b*c + -b c + 2a d + -a*b*d + 7 2 2 8 ----------------------------------------------------------------------- 6 2 2 2 2 1 2 2 4 3 5 2 -b d + 3a*c + -b*c + 4a*c*d + -b*c*d + 4a*d + b*d + -c + -c d + 5 3 2 5 7 ----------------------------------------------------------------------- 2 4 3 3 3 2 2 6 3 1 2 5 10 2 2 5c*d + -d , a + -a b + a*b + -b + -a c + -a*b*c + --b c + a d + 9 8 5 2 3 7 ----------------------------------------------------------------------- 7 4 2 1 2 3 2 9 2 1 2 3 3 -a*b*d + -b d + -a*c + -b*c + -a*c*d + b*c*d + 7a*d + -b*d + -c + 4 7 3 2 8 2 4 ----------------------------------------------------------------------- 3 2 3 2 5 3 3 2 2 7 3 2 2 7 5 2 --c d + -c*d + -d , 2a + 6a b + 9a*b + -b + -a c + -a*b*c + -b c + 10 2 6 2 9 6 9 ----------------------------------------------------------------------- 2 4 1 2 2 7 2 3 5 2 2 2a d + -a*b*d + -b d + 3a*c + -b*c + -a*c*d + 4b*c*d + -a*d + 8b*d 7 6 5 2 2 ----------------------------------------------------------------------- 4 3 4 2 8 2 3 + -c + -c d + -c*d + d ) 5 5 3 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 5 at 0x412f380 -- [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) --removing gb 0 at 0x412fa80 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.120888 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 282842165060187591375756194620502923501540255232664810538731573014534 ----------------------------------------------------------------------- 5536c27+190238981142856543356739656676161650247761047016182437253593973 ----------------------------------------------------------------------- 78975334400c26d+6217751665141634766056379133881643778921346364131481494 ----------------------------------------------------------------------- 3453090040700215296c25d2+ ----------------------------------------------------------------------- 14943213004539720359980049885664398658851982852626654275500069678106027 ----------------------------------------------------------------------- 6224c24d3+7194242603987721906246917927148530264405119898980754729734435 ----------------------------------------------------------------------- 70863892038656c23d4+403837615231928536898571473925160121830378424852559 ----------------------------------------------------------------------- 2264529463671096564140544c22d5+ ----------------------------------------------------------------------- 16829551886589110538157146348578034724468659763837143043097405417748396 ----------------------------------------------------------------------- 290496c21d6+54099307207375129908102727595553880297086521635164131193725 ----------------------------------------------------------------------- 769312102839405712c20d7+ ----------------------------------------------------------------------- 13598952058161541867945616126250435873634115288847140277546403452749173 ----------------------------------------------------------------------- 2738720c19d8+2488786252699074036593453724446223996032334773264574910461 ----------------------------------------------------------------------- 39402102308218482960c18d9+ ----------------------------------------------------------------------- 28517545661570252005124119121015030294989952589664539033062502465454174 ----------------------------------------------------------------------- 7185104c17d10+152129011375279573531289301575581318965915369327758987989 ----------------------------------------------------------------------- 258006746268661328099c16d11+ ----------------------------------------------------------------------- 28288885924824606674496439161469409689499346222577727516950278261841122 ----------------------------------------------------------------------- 8741977c15d12+210840643355579467704887654291184395652753921283768151502 ----------------------------------------------------------------------- 3521072343245790348891c14d13+ ----------------------------------------------------------------------- 73799279618621154931119515236713218221891387264855887609369085554667554 ----------------------------------------------------------------------- 67976379c13d14+16196090089943467627783853674690633366108672325459242136 ----------------------------------------------------------------------- 750381845690144348847451c12d15+ ----------------------------------------------------------------------- 25764508030238274195753711539581046402636243265772886837751603363683536 ----------------------------------------------------------------------- 807439235c11d16+3187189055476494416225531636029294141944891452605052297 ----------------------------------------------------------------------- 4013211672237306668668195c10d17+ ----------------------------------------------------------------------- 31699383535552765019752604003427099736966675841278781103288186399567186 ----------------------------------------------------------------------- 656749950c9d18+25712827415931101512406699522100757593724655755162866755 ----------------------------------------------------------------------- 678864438146270672884300c8d19+ ----------------------------------------------------------------------- 17743603945197388526365106839361066497003533716710947538600364983733010 ----------------------------------------------------------------------- 839857500c7d20+10563918534921982154355730156611087635977069021255316027 ----------------------------------------------------------------------- 070909685177095751710000c6d21+ ----------------------------------------------------------------------- 49330315436465685125674954876008502720281076082094449154363257692254872 ----------------------------------------------------------------------- 05762500c5d22+187203045274847629717227646291248960135636834410227877588 ----------------------------------------------------------------------- 0700085830369849277500c4d23+ ----------------------------------------------------------------------- 66276317818291354504003375132492858727208227511962449009806958475685954 ----------------------------------------------------------------------- 7875000c3d24+1790729505939046199149238779507167083155488542370773735710 ----------------------------------------------------------------------- 52369742553509300000c2d25+ ----------------------------------------------------------------------- 20948371823067120489229128753196768000111266124969297131953104732574202 ----------------------------------------------------------------------- 750000cd26-541832951927883763404248032186052392101608442653590807138543 ----------------------------------------------------------------------- 591587676500000d27 | 1 1 o16 : Matrix S <--- S |