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.000015803 seconds 3 6 9 o6 = 1 - 3T + 3T - T o6 : ZZ[T] |
i7 : time gens gb I; -- registering gb 2 at 0xbc36390 -- [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 = 37 -- #spairs done = 11 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.0293748 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 0xbcb3aa0 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 3 at 0xbe33e40 -- [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 0xbe33d10 -- [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.0148285 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 0xbe2f198 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 3 9 2 2 2 3 2 9 5 2 1 2 3 o12 = ideal (6a + -a b + a*b + -b + 2a c + -a*b*c + -b c + -a d + -a*b*d + 5 3 5 3 2 4 ----------------------------------------------------------------------- 2 2 2 2 5 10 2 2 3 3 1 2 -b d + 3a*c + 5b*c + -a*c*d + 2b*c*d + --a*d + b*d + --c + -c d + 5 2 9 10 5 ----------------------------------------------------------------------- 1 2 1 3 1 3 7 2 9 2 4 3 2 3 2 2 -c*d + -d , -a + -a b + -a*b + -b + 4a c + 4a*b*c + -b c + a d + 6 3 9 8 8 5 7 ----------------------------------------------------------------------- 5 8 2 2 2 3 1 2 5 2 3 -a*b*d + -b d + 2a*c + 5b*c + 2a*c*d + -b*c*d + -a*d + -b*d + c + 6 5 8 3 6 ----------------------------------------------------------------------- 4 2 9 2 3 4 3 2 2 2 3 3 2 4 5 2 -c d + -c*d + 5d , -a + a b + 2a*b + -b + --a c + -a*b*c + -b c + 5 4 7 9 10 5 6 ----------------------------------------------------------------------- 9 2 3 8 2 2 9 2 2 1 2 -a d + -a*b*d + -b d + 2a*c + -b*c + 4a*c*d + 9b*c*d + 6a*d + -b*d 8 5 7 2 4 ----------------------------------------------------------------------- 7 3 10 2 2 3 + -c + --c d + 3c*d + 3d ) 6 9 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 5 at 0xbe33980 -- [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 0xbc36260 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.315458 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 474820833076288515933786551614665930022874149933278660944048771555585 ----------------------------------------------------------------------- 19406106219618304c27+79142933776216654939273554966791351786827848659353 ----------------------------------------------------------------------- 362545612110825873217151781726777344c26d+ ----------------------------------------------------------------------- 51564954168217831285436170725940063435313370961017840709098147714377250 ----------------------------------------------------------------------- 0807257660556288c25d2-1404766419811546211110123939071074875567819556786 ----------------------------------------------------------------------- 995992892302834905715403913747718077952c24d3- ----------------------------------------------------------------------- 25318591549830162607283386304301973933142233355912774015234374202570057 ----------------------------------------------------------------------- 3904765992315616c23d4-9982904502515499723708612638397031275217053059978 ----------------------------------------------------------------------- 292934487184836638977147735111454582992c22d5- ----------------------------------------------------------------------- 55051220811667216986813724786538255568558506965847251122535892740126790 ----------------------------------------------------------------------- 50439430015479136c21d6- ----------------------------------------------------------------------- 51402297978700669567508488278340586050580101322249133348747218207474324 ----------------------------------------------------------------------- 75901124308709488c20d7+ ----------------------------------------------------------------------- 40476430091934971393743159699583200181871585278871278011524626240842003 ----------------------------------------------------------------------- 20654303123125040c19d8- ----------------------------------------------------------------------- 21258219465294989994724883812820219127100557807976858462669073975306036 ----------------------------------------------------------------------- 560075317846812136c18d9- ----------------------------------------------------------------------- 11555505802567923166650687291509681537520824732980370611040877517619565 ----------------------------------------------------------------------- 2263095035944908576c17d10- ----------------------------------------------------------------------- 16064473424231742229121090211912845621171460643911068475372612626410319 ----------------------------------------------------------------------- 1058221489169235616c16d11- ----------------------------------------------------------------------- 57804966006551595782874278974422299853287142892500518518698228282936924 ----------------------------------------------------------------------- 006883618922724606c15d12+ ----------------------------------------------------------------------- 82455059106176300720314515211020514934142208036440865775486337316156666 ----------------------------------------------------------------------- 1850851690950316055c14d13+ ----------------------------------------------------------------------- 17827602549782157368861869949410330793516713968493669581811189596728831 ----------------------------------------------------------------------- 99014354004557831830c13d14+ ----------------------------------------------------------------------- 13439846522532758886375540785568017556440576858808499483526840977658529 ----------------------------------------------------------------------- 27404558617477181715c12d15+ ----------------------------------------------------------------------- 28954502851723444267505523027287003614347738498318899556358907351247902 ----------------------------------------------------------------------- 7443725182824067600c11d16+ ----------------------------------------------------------------------- 62873054054879598297935139485530161997383879724792350367743834623100098 ----------------------------------------------------------------------- 8853791622526652800c10d17+ ----------------------------------------------------------------------- 29378001864447180255553280264692420383299452735858927759707213290072725 ----------------------------------------------------------------------- 59954434912811849300c9d18+ ----------------------------------------------------------------------- 51425767218632414574428357723302545337828046345400148085006325923426409 ----------------------------------------------------------------------- 34546288690381851375c8d19+ ----------------------------------------------------------------------- 36095607258023057611257011661235073440377733517971329893459136748317961 ----------------------------------------------------------------------- 28376311176697516250c7d20+ ----------------------------------------------------------------------- 11475432853122450774122884729983449485054555249766601489315867447878930 ----------------------------------------------------------------------- 69302297180891711875c6d21+ ----------------------------------------------------------------------- 16059274968679207989344635968682669402797063558636522780038354134335726 ----------------------------------------------------------------------- 6811879973605706250c5d22+ ----------------------------------------------------------------------- 22985877905921543967211373148530730859464078848983652051504618394644507 ----------------------------------------------------------------------- 537965815161925000c4d23+ ----------------------------------------------------------------------- 32703541436747034933313100091800516943829849313629980436698200405873826 ----------------------------------------------------------------------- 9512409293250000c3d24+7113143912725276713213506848375684264132828094497 ----------------------------------------------------------------------- 4230075886569148467200444398696000000c2d25- ----------------------------------------------------------------------- 13902173685689206288489848707571021220299938717685145051025544165554155 ----------------------------------------------------------------------- 569880800000000cd26+438679571936554195210783152393822094080982220363903 ----------------------------------------------------------------------- 842774033574154675014487600000000d27 | 1 1 o16 : Matrix S <--- S |