with(convex); |

Convex version 1.2.0, Copyright (C) 1999-2016 Matthias Franz
This package is distributed under the GNU General Public License
See http://www.math.uwo.ca/~mfranz/convex/ for more information

[*affinehull*, *ambientdim*, *arecompatible*, *boundary*, *codim*, *contains*, *containsrelint*, *convhull*, *corank*, *corners*, *crosspolytope*, *cube*, *cyclicpolytope*, *delaunay*, *dim*, *directsum*, *distance*, *domain*, *dotprod*, *draw*, *dual*, *edges*, *emptypcomplex*, *emptypolyhedron*, *emptypolytope*, *facefan*, *faces*, *facets*, *fan*, *flagf*, *flagh*, *fullcone*, *fullpolyhedron*, *furthestdelaunay*, *fvector*, *genhpolynomial*, *genhvector*, *hilbertbasis*, *homology*, *hplanes*, *hspacenos*, *hspaces*, *hvector*, *image*, *incidencematrix*, *incidentfacets*, *incidentrays*, *intersection*, *isaffine*, *isbounded*, *iscomplete*, *iscontained*, *isempty*, *isface*, *isfulldim*, *islinear*, *ispointed*, *ispolytopal*, *isquasipolytopal*, *isregular*, *issimple*, *issimplex*, *issimplicial*, *issimplicial1*, *join*, *lensspace*, *lineality*, *linearhull*, *lines*, *maximal*, *maximum*, *minimal*, *minimum*, *minkowskisum*, *modz*, *newtonpolytope*, *normalfan*, *pcomplex*, *permutahedron*, *plotdata*, *polar*, *poshull*, *posorthant*, *pred*, *preimage*, *projspace*, *proximum*, *randompolytope*, *rank*, *raynos*, *rays*, *readpoly*, *recession*, *regularpart*, *regularsubdiv*, *relint*, *simplicialsubdiv*, *skeleton*, *stdsimplex*, *stellarsubdiv*, *succ*, *support*, *surface*, *torsion*, *transversalfan*, *traverse*, *traverse2*, *vertexnos*, *vertices*, *volume*, *voronoi*, *wprojspace*, *writepoly*, *zerocone*, *zerofan*]

Let us illustrate this with an example. We start with the following polynomial:

p := (x-y*z+x^2*y)^3-(z+2*y)^4+(x*y*z)^3; |

expand(p); |

P := newtonpolytope(p, [x, y, z]); |

To know more about a polytope,
one uses some of the functions defined by the Convex package.
For instance, let us see what the vertices of
`P`
are:

vertices(P); |

[[0, 4, 0], [0, 0, 4], [6, 3, 0], [3, 3, 3], [0, 3, 3], [3, 0, 0]]

This is indeed what we have expected.
The vertex
If we are curious, we may also draw the Newton polytope:

draw(P); |

P := convhull(P, [0, 0, 0]); |

Kushnirenko's bound on the sum of the Milnor numbers is an alternating
sum over the volume of the intersection of
`P`
with all coordinate hyperplanes in the ambient space.
Here "volume" means the induced Euclidean volume in a, say,
`i`-dimensional
coordinate hyperplane, which is
`0`
if the intersection is not
`i`-dimensional.
Each such volume is scaled by
`(-1)^(n-i)*i!`,
where
`n`
is the ambient dimension of
`P`
(which is
`3`
in our example).

Hence, we need to know the volume of the intersection of
`P`
with all coordinate hyperplanes.
Since the polytope lies in the positive octant
(or "positive orthant" in general), we can equally well
intersect it with the faces of the positive orthant, considered as a
polyhedron. Let's compute these faces.

PO := posorthant(3); |

The following call converts the `CONE`
`PO`
to a `POLYHEDRON`, which is then stored in the same variable.

PO := convert(PO, affine); |

fl := faces(PO); |

Now we run through all non-empty faces of
`PO`
and sum up the volumes of their intersections with
`P`:

V := 0: # the sum of all volumes for i from 0 to 3 do Vi := 0; # the sum of the i-dimensional volumes for f in fl[i] do Q := intersection(P, convert(f, POLYHEDRON)); if dim(Q) = i then Vi := Vi+volume(maximal(Q)) fi od; V := V+(-1)^(3-i)*i!*Vi od: V; |

157

The call
kushnirenko_bound := proc(p, indets) local n, P, fl, i, V, Vi, f, Q; n := nops(indets); # = ambient dimension of Newton polytope P := convhull(newtonpolytope(p, indets), [0$n]); fl := faces(convert(posorthant(n), affine)); V := 0; for i from 0 to dim(P) do Vi := 0; for f in fl[i] do Q := intersection(P, convert(f, POLYHEDRON)); if dim(Q) = i then Vi := Vi+volume(maximal(Q)) fi od; V := V+(-1)^(n-i)*i!*Vi od; V end: |

kushnirenko_bound(p, [x, y, z]); |

157

Now in higher dimensions:
kushnirenko_bound((x+y+z+u+v+w)^3, [x, y, z, u, v, w]); |

64