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 7.367e-6 seconds 3 6 9 o6 = 1 - 3T + 3T - T o6 : ZZ[T] |
i7 : time gens gb I; -- registering gb 2 at 0xbcf44c0 -- [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 -- #reduction steps = 37 -- #spairs done = 11 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.0185979 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 0xbd0caa0 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 3 at 0xbcf4000 -- [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 0xbeace40 -- [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.00961344 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 0xbe86198 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 3 7 2 10 2 3 3 5 2 5 1 2 9 2 o12 = ideal (10a + -a b + --a*b + -b + -a c + -a*b*c + -b c + -a d + 3 9 5 6 4 5 5 ----------------------------------------------------------------------- 1 3 2 2 2 5 1 3 2 7 2 1 3 -a*b*d + -b d + 7a*c + 3b*c + -a*c*d + -b*c*d + -a*d + -b*d + -c + 2 7 4 5 2 4 8 ----------------------------------------------------------------------- 1 2 9 2 1 3 10 3 2 3 2 3 2 3 1 2 -c d + -c*d + -d , --a + a b + -a*b + 6b + 2a c + -a*b*c + -b c + 2 8 5 9 4 2 6 ----------------------------------------------------------------------- 2 7 2 7 2 3 2 1 2 2 2a d + -a*b*d + b d + -a*c + --b*c + -a*c*d + 5b*c*d + 5a*d + 2b*d 2 6 10 2 ----------------------------------------------------------------------- 1 3 10 2 2 3 1 3 2 2 1 2 3 3 2 2 3 + -c + --c d + c*d + 3d , -a + -a b + -a*b + -b + -a c + -a*b*c + 3 7 2 5 7 7 3 2 ----------------------------------------------------------------------- 2 7 2 2 7 2 7 2 1 5 8 2 2b c + --a d + 4a*b*d + 5b d + -a*c + -b*c + -a*c*d + -b*c*d + -a*d 10 3 2 3 7 3 ----------------------------------------------------------------------- 2 3 5 2 3 2 7 3 + 2b*d + 4c + -c d + -c*d + -d ) 4 5 4 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 5 at 0xbeacab0 -- [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) --removing gb 0 at 0xbcf4390 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.220301 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 119472932505787569845042778268557476790697223192863401306980655375446 ----------------------------------------------------------------------- 43413702252038671875c27- ----------------------------------------------------------------------- 63489632247783061195408855258121192810107265749115891566821469936649586 ----------------------------------------------------------------------- 83539503840781250c26d-7319930724628456693049023871956882918295160315565 ----------------------------------------------------------------------- 1455892548589257596994647596235573978125c25d2+ ----------------------------------------------------------------------- 85764179350938855220180212070791689517118653947229317157596194287609957 ----------------------------------------------------------------------- 339788115984567500c24d3+ ----------------------------------------------------------------------- 20513763013468018011949436664030803679407846108061797218952707829835450 ----------------------------------------------------------------------- 5948733863772806250c23d4- ----------------------------------------------------------------------- 15639536865490798807696544892140407216912418282398515441150659160850280 ----------------------------------------------------------------------- 658133001993871400c22d5+ ----------------------------------------------------------------------- 41486478810605229924098071019361628363350650359370792857867516275690993 ----------------------------------------------------------------------- 6508088027552133250c21d6+ ----------------------------------------------------------------------- 83062285938126684468108175178823563135928838716584458423831184675277462 ----------------------------------------------------------------------- 7399866285182766670c20d7+ ----------------------------------------------------------------------- 76852920294075437255412969384180645498987435080989562676557204875664243 ----------------------------------------------------------------------- 1199273961962211780c19d8+ ----------------------------------------------------------------------- 13615106295511803534429511854341544265382637646314086786884599358931132 ----------------------------------------------------------------------- 70122738605054122546c18d9+ ----------------------------------------------------------------------- 16037059792219244126665748358464352733471977527058803005120962348049062 ----------------------------------------------------------------------- 51660736546224181224c17d10+ ----------------------------------------------------------------------- 19187128196045825277361291921096319592247210250735333385104804018161753 ----------------------------------------------------------------------- 90739931677282695294c16d11+ ----------------------------------------------------------------------- 23444971611864136811924813888869751301082909027274916420562368071834256 ----------------------------------------------------------------------- 56624153904353359010c15d12+ ----------------------------------------------------------------------- 20777406244099698170342836440240657908252991346082584532407700740193068 ----------------------------------------------------------------------- 41374940333863885630c14d13+ ----------------------------------------------------------------------- 23059821822766063268599639970324100271679530569477053832751050378919208 ----------------------------------------------------------------------- 32149750687130128550c13d14+ ----------------------------------------------------------------------- 22015029913337140228677371642626044337951112188272681742765299256534885 ----------------------------------------------------------------------- 31694955702393891850c12d15+ ----------------------------------------------------------------------- 18003125793795164752672285379020545959414167106275876592151277771926982 ----------------------------------------------------------------------- 63734504334706361625c11d16+ ----------------------------------------------------------------------- 16412667610364110574138329291226367637748613327711052680614667980804179 ----------------------------------------------------------------------- 94071367392681587000c10d17+ ----------------------------------------------------------------------- 12040166554738793668910359602292346284340376110808903853562032197788420 ----------------------------------------------------------------------- 29584889036334663125c9d18+ ----------------------------------------------------------------------- 92540350758854251900635382568039423660428247897436766860100787771428264 ----------------------------------------------------------------------- 2940551719206878750c8d19+ ----------------------------------------------------------------------- 66992500494333075336402816008391515873669676174509059850214844018179583 ----------------------------------------------------------------------- 9946984037844612500c7d20+ ----------------------------------------------------------------------- 38124981471913837022233339511928634973859161469224949554806308489307463 ----------------------------------------------------------------------- 1514509160103981250c6d21+ ----------------------------------------------------------------------- 24509787825077472471043284727819962334428771183133701844328347253042184 ----------------------------------------------------------------------- 3223585172507625000c5d22+ ----------------------------------------------------------------------- 12634920887033334521762069899044797672070409184265970149967758096045522 ----------------------------------------------------------------------- 7310185530423000000c4d23+ ----------------------------------------------------------------------- 59039645533486717724263282238990856223689107708491603832615048625312606 ----------------------------------------------------------------------- 218895164910000000c3d24+ ----------------------------------------------------------------------- 25133907696625821819634648670790248746377897768455299102776237409407265 ----------------------------------------------------------------------- 711426977900000000c2d25+ ----------------------------------------------------------------------- 45611849214469898460126311027031854986890895512514124135226203592424525 ----------------------------------------------------------------------- 76234312400000000cd26+1885433129131935619359432660519698461018583995127 ----------------------------------------------------------------------- 227550639377764957855171693530400000000d27 | 1 1 o16 : Matrix S <--- S |