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.569e-6 seconds 3 6 9 o6 = 1 - 3T + 3T - T o6 : ZZ[T] |
i7 : time gens gb I; -- registering gb 2 at 0xb355d10 -- [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 -- ncalls = 10 -- nloop = 29 -- nsaved = 0 -- -- used 0.0197697 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 0xa935580 |
i9 : I = ideal random(R^1, R^{3:-3}); -- registering gb 3 at 0xb355850 -- [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 0xb355720 -- [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.0116684 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 0xa935500 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S) 4 3 3 2 2 3 2 2 6 2 2 6 o12 = ideal (-a + -a b + 9a*b + 3b + -a c + -a*b*c + 2b c + a d + -a*b*d + 7 5 5 7 5 ----------------------------------------------------------------------- 1 2 9 2 1 2 5 9 2 2 5 3 9 2 -b d + --a*c + -b*c + 5a*c*d + -b*c*d + -a*d + 3b*d + -c + -c d + 3 10 2 6 4 6 7 ----------------------------------------------------------------------- 1 2 5 3 10 3 1 2 8 2 3 4 2 6 2 3 2 -c*d + -d , --a + -a b + -a*b + 5b + -a c + 5a*b*c + -b c + --a d + 5 2 7 4 5 5 5 10 ----------------------------------------------------------------------- 2 1 2 7 2 8 2 5 5 2 7 2 1 3 -a*b*d + -b d + -a*c + -b*c + -a*c*d + 2b*c*d + -a*d + --b*d + -c 3 2 8 9 3 3 10 5 ----------------------------------------------------------------------- 1 2 5 2 3 9 3 4 2 4 2 3 2 1 3 2 + -c d + -c*d + 6d , -a + -a b + -a*b + b + 2a c + --a*b*c + -b c + 6 7 2 5 3 10 4 ----------------------------------------------------------------------- 2 2 2 2 2 1 2 9 1 2 2 -a d + 9a*b*d + 2b d + -a*c + -b*c + 4a*c*d + -b*c*d + -a*d + 6b*d 7 5 4 8 4 ----------------------------------------------------------------------- 3 2 9 2 2 3 + 2c + c d + --c*d + -d ) 10 5 o12 : Ideal of S |
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J; -- registering gb 5 at 0xb355390 -- [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 0xb355be0 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.359805 seconds 1 39 o15 : Matrix S <--- S |
i16 : selectInSubring(1,gens gb J) o16 = | 633190781165873231068318639535626013222718574476544265199335280332724 ----------------------------------------------------------------------- 877056000c27+6981185510634584024543551053386643182176203217392603883635 ----------------------------------------------------------------------- 732226396795214476800c26d+ ----------------------------------------------------------------------- 28723549708393611706056559189604633413061043880381923008652466194866222 ----------------------------------------------------------------------- 186140160c25d2+55048988149560162824295117699840046837036911576879448339 ----------------------------------------------------------------------- 170817685869769663754240c24d3+ ----------------------------------------------------------------------- 78360336577986827209677723719006748025362277026102566878647557604544415 ----------------------------------------------------------------------- 002977024c23d4+11181119448229726606362452845480010277929552923625314336 ----------------------------------------------------------------------- 2242244384888319948697984c22d5- ----------------------------------------------------------------------- 83360940724527698388132197756449547034864706090539874185924157415466402 ----------------------------------------------------------------------- 579137280c21d6-29812702991681894309612974025318600243413236728964675203 ----------------------------------------------------------------------- 9495696221849075693482528c20d7+ ----------------------------------------------------------------------- 13306129014625007954635567285862501209438071517501426257155367762701990 ----------------------------------------------------------------------- 2488158496c19d8-1195417666687923245834485775430100749850995658545395412 ----------------------------------------------------------------------- 411392296571238192215033088c18d9+ ----------------------------------------------------------------------- 23562086154461967401778218077494936187430649013737276993321697110737354 ----------------------------------------------------------------------- 21612648712c17d10-15594007473854765099260096758642063432189200664903462 ----------------------------------------------------------------------- 75884446688465678971080299052c16d11+ ----------------------------------------------------------------------- 40927816578065489637014771944730145536864417604204655209267135352427961 ----------------------------------------------------------------------- 70579212816c15d12-69035572651611855330351767068279516192678776325532081 ----------------------------------------------------------------------- 53601338647131665194532895028c14d13- ----------------------------------------------------------------------- 11913396311335094409380726162534015060001364971352245423882878296614583 ----------------------------------------------------------------------- 35163730790c13d14-28110336753140665378627807436282545729655438278733395 ----------------------------------------------------------------------- 221862776489827238489352320645c12d15+ ----------------------------------------------------------------------- 34721264516521086808795996467183103522944469721822064076228368832249830 ----------------------------------------------------------------------- 904970563902c11d16-4072368845768416528910326295273708599056893162457410 ----------------------------------------------------------------------- 2216329483683704085332347114288c10d17+ ----------------------------------------------------------------------- 12105106794792521934140031180167126708405386941551705202060058704408937 ----------------------------------------------------------------------- 7796885162939c9d18-5035083170458740917147904268277491436014625078813780 ----------------------------------------------------------------------- 5704466204986015769450653217260c8d19+ ----------------------------------------------------------------------- 18619161691008906658699062285114751117585938119809658332523682887709428 ----------------------------------------------------------------------- 9962662424800c7d20-2691309090101198493748291570067838698381318307334049 ----------------------------------------------------------------------- 37465285793247592113651252573784c6d21- ----------------------------------------------------------------------- 63831243631467344694288024815914932509357375939758503193850381683028200 ----------------------------------------------------------------------- 400722093344c5d22+11183584286846521585381538560063170240605273516834462 ----------------------------------------------------------------------- 7464979971744903073769046886144c4d23- ----------------------------------------------------------------------- 39930714375313924685766312576902686429283068901487762405496411630670115 ----------------------------------------------------------------------- 7500909588480c3d24+1630442931509978962789250010415594299989806831421272 ----------------------------------------------------------------------- 39224928021548441627865049456640c2d25+ ----------------------------------------------------------------------- 82837381050094961515291386882039288709083643336401809897938597430399222 ----------------------------------------------------------------------- 7281956700160cd26-59411826924734917234728046123364400717516567628796061 ----------------------------------------------------------------------- 7486121969781486241170387763200d27 | 1 1 o16 : Matrix S <--- S |