-- PolyhedralBounds.m2 -- Abraham Martin del Campo -- 27 Abril 2016 ---------------------------- R = QQ[x,y, MonomialOrder=>Lex]; f = x^2*y + 2*x*y^2 + x*y - 1 g = x^2*y - x*y^2 - x*y + 2 I = ideal(f,g) dim I degree I -- la cota de bezout es (first degree f)* (first degree g) gens gb I -- de aqui vemos que tiene 3 soluciones A = matrix{{2,1,1,0},{1,2,1,0}} exps = entries transpose A; L = for i to 1 list( sum apply(exps, u -> random(-100,100) * x^(u_0) * y^(u_1)) ) I = ideal L degree I -- si deg I=0,entonces no tiene soluciones dim I bez = product(flatten(L/degree)) -- bezout ------------------------------- needsPackage "Polyhedra" P = convexHull A vertices P volume P P1 = newtonPolytope f vertices P1 latticePoints P1 ehrhart P ------------------------------- -- veamos cuando el numero de soluciones -- no es 3 R = QQ[x,y,a1,b1,c1,d1,a2,b2,c2,d2]; f = a1*x^2*y + b1*x*y^2 + c1*x*y + d1; g = a2*x^2*y + b2*x*y^2 + c2*x*y + d2; F = factor resultant(f,g,x) h = F#1#0 D = resultant(h,diff(y,h),y) degree D R = QQ[x,y] f=random(-100,100)*x^2 + random(-100,100)*y^2 + random(-100,100)*x*y^3 + random(-100,100)*x^2*y^2 g = random(-100,100)*x^2 + random(-100,100)*y^3 + random(-100,100)*y + random(-100,100)*x^4*y^3 + random(-100,100) Pf = newtonPolytope f vertices Pf volume Pf Pg = newtonPolytope g vertices Pg volume Pg MP = Pf+Pg vertices MP volume MP mixedVolume {Pf,Pg} --(C,L,M) = minkSummandCone MP -- apply(values L, vertices)