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.000011241 seconds
3 6 9
o6 = 1 - 3T + 3T - T
o6 : ZZ[T]
|
i7 : time gens gb I;
-- registering gb 2 at 0x7f5c7bce3700
-- [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 = 38
-- #spairs done = 11
-- ncalls = 10
-- nloop = 29
-- nsaved = 0
-- -- used 0.0256009 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 0x7f5c7d3e8700 |
i9 : I = ideal random(R^1, R^{3:-3});
-- registering gb 3 at 0x7f5c7bce3540
-- [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 0x7f5c7bce3380
-- [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.0329722 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 0x7f5c7d3e8600 o11 = S o11 : PolynomialRing |
i12 : J = substitute(I,S)
2 3 4 2 2 5 3 5 2 3 2 5 2 1 2 2 5 2 1 1 9 2
o12 = ideal (-a + -a b + 2a*b + -b + -a c + -a*b*c + b c + -a d + -a*b*d + 2b d + a*c + -b*c + -a*c*d + -b*c*d + -a*d +
5 9 2 3 2 6 7 3 9 2 7
---------------------------------------------------------------------------------------------------------------------------
2 8 3 4 2 3 2 3 3 3 6 2 5 2 1 3 6 2 1 2 6 2 3 2 2 2
3b*d + -c + -c d + -c*d + -d , a + -a b + -a*b + -b + -a c + 6a*b*c + -b c + -a d + a*b*d + --b d + a*c + b*c +
7 3 5 2 5 2 4 5 3 7 10
---------------------------------------------------------------------------------------------------------------------------
3 3 9 2 1 2 1 3 1 2 2 8 3 5 3 3 2 1 2 3 3 2 1 2 5 2 6
--a*c*d + -b*c*d + -a*d + -b*d + -c + -c d + 2c*d + -d , -a + -a b + -a*b + -b + 7a c + a*b*c + -b c + -a d + -a*b*d
10 8 4 2 3 2 7 7 2 3 2 5 3 5
---------------------------------------------------------------------------------------------------------------------------
5 2 1 2 1 2 3 2 1 2 7 3 8 2 7 2 3
+ -b d + -a*c + -b*c + 2a*c*d + -b*c*d + a*d + --b*d + -c + -c d + -c*d + d )
4 2 8 2 10 5 5 8
o12 : Ideal of S
|
i13 : installHilbertFunction(J, hf) |
i14 : gbTrace=3 o14 = 3 |
i15 : time gens gb J;
-- registering gb 5 at 0x7f5c7d8bfe00
-- [gb]{3}(3,3)mmm{4}(2,2)mm{5}(3,3)mmm{6}(3,7)mmm{7}(3,8)mmm{8}(3,9)m
--removing gb 0 at 0x7f5c7bce38c0
mm{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
-- #reduction steps = 284
-- #spairs done = 53
-- ncalls = 46
-- nloop = 54
-- nsaved = 0
-- -- used 0.130317 seconds
1 39
o15 : Matrix S <--- S
|
i16 : selectInSubring(1,gens gb J)
o16 = | 2438730598904145153674597264182194728018810212800166384604347807182781440000c27+
---------------------------------------------------------------------------------------------------------------------------
6804734300969879711467026281705415529716594102968605000644198659321541120000c26d+
---------------------------------------------------------------------------------------------------------------------------
11597364228740720976813725657514406124738091415081708788717896930979185664000c25d2+
---------------------------------------------------------------------------------------------------------------------------
23593854948820747270541718485240316584065850799950623007351199460826287616000c24d3+
---------------------------------------------------------------------------------------------------------------------------
32743644647016475216170069528641722426835477775253543592889918133322668441600c23d4+
---------------------------------------------------------------------------------------------------------------------------
33158095190154155829221377356630179888238312515669425233096064578894340119040c22d5+
---------------------------------------------------------------------------------------------------------------------------
150285952872227936386716437911644844880286661708211294844640913474618113410688c21d6-
---------------------------------------------------------------------------------------------------------------------------
21512804869970961505730654467974378533992989635620845013046053149115691376640c20d7+
---------------------------------------------------------------------------------------------------------------------------
284319805141560202000158620912610607836083627117791839019309806045574261823520c19d8+
---------------------------------------------------------------------------------------------------------------------------
16650730381353978595863327607516214447500495532056234936672555655369716831120c18d9+
---------------------------------------------------------------------------------------------------------------------------
87968827795245198558720802391460287994055816649663973831801513286446550410048c17d10+
---------------------------------------------------------------------------------------------------------------------------
229599596925037903736507975959799288520243288950718666073535712799867536198896c16d11-
---------------------------------------------------------------------------------------------------------------------------
186238464624475812059215969192404399881338554287087040105246208136582238056824c15d12+
---------------------------------------------------------------------------------------------------------------------------
245489206760146406509817293255872324248553371878627136582406763512498395829972c14d13-
---------------------------------------------------------------------------------------------------------------------------
141132193544414336210863578442532364572117789942199579134726132062555878780658c13d14+
---------------------------------------------------------------------------------------------------------------------------
80520443561444628031196207946045746850357450872252370351009550385550378086681c12d15-
---------------------------------------------------------------------------------------------------------------------------
22782332476017203735457208275734689590130672819674771435927358914316617821352c11d16+
---------------------------------------------------------------------------------------------------------------------------
12315466375513693509230290342016673656670249832613715660807956483127262733880c10d17+
---------------------------------------------------------------------------------------------------------------------------
4719437472003410614922275085496115471668279624745540404962433899525703062436c9d18+
---------------------------------------------------------------------------------------------------------------------------
7449795892359870604215899166835070840596789426988672302114493464558061374608c8d19+
---------------------------------------------------------------------------------------------------------------------------
3347286767473203151542760567494037696638193496400694184869139937175077192912c7d20+
---------------------------------------------------------------------------------------------------------------------------
2106534096122290217776886174919161239203477897917158167686354319461999466336c6d21+
---------------------------------------------------------------------------------------------------------------------------
460169690294469967722067306742501183432585936590630379782470474034257115680c5d22+
---------------------------------------------------------------------------------------------------------------------------
154284877778120046168267259862119443234917725886530407167266434720712424352c4d23+
---------------------------------------------------------------------------------------------------------------------------
20976619547088486240643622854528325181058801845290850471734381682038429280c3d24+
---------------------------------------------------------------------------------------------------------------------------
702216375780103511380727761738360556579187967063035341047101043498531200c2d25+
---------------------------------------------------------------------------------------------------------------------------
9531871659255442565995582182062188830769684462513069209840585989184000cd26+
---------------------------------------------------------------------------------------------------------------------------
12703717553559620292797047679770889440091660309005709905878142251744000d27 |
1 1
o16 : Matrix S <--- S
|