# COMPUTING MIXED MULTIPLICITIES, MIXED VOLUMES AND SECTIONAL MILNOR NUMBERS

Kriti Goel  Department of Mathematics, University of Utah, Salt Lake City, UT
84112, USA<EMAIL_ADDRESS>,  Vivek Mukundan  Department of
Mathematics, Indian Institute of Technology Delhi, New Delhi, 110016, India
<EMAIL_ADDRESS>,  Sudeshna Roy  Department of Mathematics, Chennai
Mathematical Institute, Siruseri, Kelambakkam 603103, India
<EMAIL_ADDRESS>and  J. K. Verma  Department of Mathematics, Indian
Institute of Technology Bombay, Mumbai, 400076, India<EMAIL_ADDRESS>
###### Abstract.

This is an expository version of our paper [9]. Our aim is to present recent
Macaulay2 algorithms for computation of mixed multiplicities of ideals in a
Noetherian ring which is either local or a standard graded algebra over a
ﬁeld. These algorithms are based on computation of the equations of multi-Rees
algebras of ideals that generalises a result of Cox, Lin and Sosa [5]. Using
these equations we propose efficient algorithms for computation of mixed
volumes of convex lattice polytopes and sectional Milnor numbers of
hypersurfaces with an isolated singularity.

2020 AMS Mathematics Subject Classification: Primary 13-04, 13A30, 13H15.

Key words: Multi-Rees algebras, mixed multiplicities, sectional Milnor
numbers, mixed volume

##  1\. Introduction

In this expository article we describe the Macaulay2 package MixedMultiplicity
which computes the mixed multiplicities of ideals having positive grade in a
Noetherian ring, mixed volume of a collection of convex lattice polytopes and
sectional Milnor numbers of hypersurfaces with an isolated singularity. One of
the main steps of the algorithms is the computation of the defining equations
of the multi-Rees algebra

$\mathcal{R}(I_{1},\ldots,I_{s})=R[I_{1}t_{1},\ldots,I_{s}t_{s}]=\bigoplus\limits_{a_{1},\ldots,a_{s}\geq
0}I_{1}^{a_{1}}\cdots I_{s}^{a_{s}}t_{1}^{a_{1}}\cdots t_{s}^{a_{s}}\subseteq
R[t_{1},\ldots,t_{s}]$

of ideals $I_{1},\ldots,I_{s}$ in a Noetherian ring $R$. When $R$ is a
polynomial ring of finite Krull dimension over any field $k$ and
$I_{1},\ldots,I_{s}$ are monomial ideals in $R$, D. Cox, K.-N. Lin, and G.
Sosa give an explicit formula for the defining equations of
$\mathcal{R}(I_{1},\ldots,I_{s})$ in [5]. In this article, we obtain an
analogue of their result for any set of ideals $I_{1},\ldots,I_{s}$ in a
Noetherian ring $R$ such that each $I_{i}$ has positive grade. The latter
condition is always satisfied when $R$ is a domain or for any ideal of
positive height in a reduced ring or in a Cohen-Macaulay ring. Several authors
have proposed algorithms to determine the defining equations of the multi-Rees
algebra. For example, J. Ribbe [20, Proposition 3.1, Proposition 3.4], K.-N.
Lin and C. Polini [17, Theorem 2.4], G. Sosa [21, Lemma 2.1], and B.
Jabarnejad [15, Theorem 1]. They assumed $I_{i}=\mathfrak{m}^{a_{i}}$ or
$I_{i}=I^{a_{i}}$, where $I$ is an ideal of linear type, or $I_{i}$’s are
monomial ideals. We show the following.

######  Theorem 1.1.

Let $R$ be a Noetherian ring and $I_{1},\ldots,I_{s}\subseteq R$ be ideals of
positive grade. For each $i$, consider some generating set $\\{f_{ij}\mid
j=1,\ldots,n_{i}\\}$ of $I_{i}$ which contains at least one nonzerodivisor
$f_{ij_{i}}$. We set $h=\prod_{i=1}^{s}f_{ij_{i}}$. Consider the
indeterminates $\underline{Y}=\\{Y_{ij}\mid i=1,\ldots,s,j=1,\ldots,n_{i}\\}$
and $\underline{T}=(T_{1},\ldots,T_{s}).$ Define an $R$-algebra homomorphism
$\varphi:S=R[\underline{Y}]\to\mathcal{R}(I_{1},\ldots,I_{s})\subseteq
R[\underline{T}]$ by $Y_{ij}\mapsto f_{ij}T_{i}$ for all $i=1,\ldots,s,\text{
and }j=1,\ldots,n_{i}.$ Then

$\Gamma:=\langle Y_{ij}f_{ij^{\prime}}-Y_{ij^{\prime}}f_{ij}\mid
i=1,\ldots,s\text{ and }j,j^{\prime}\in\\{1,\ldots,n_{i}\\}\mbox{ with }j\neq
j^{\prime}\rangle:h^{\infty}\subseteq R[\underline{Y}].$

is the defining ideal of $\mathcal{R}(I_{1},\ldots,I_{s})$, that is,
$\Gamma=\ker\varphi$.

Using this result, we write a function multiReesIdeal to compute the defining
ideal of a multi-Rees algebra in Macaulay2. When the ring is not a domain, the
algorithm follows an analogue of the reesIdeal function, albeit for the
multiple ideal setting.

The algorithm for computing defining equations of
$\mathcal{R}(I_{1},\ldots,I_{s})$ helps us construct algorithms to compute
_mixed multiplicities_ , _mixed volume_ and _sectional Milnor numbers_ in the
general setting. To justify importance of such an algorithm, we now recall
these invariants and their importance.

###  1.1. Mixed multiplicities of ideals

Let $I_{1},\ldots,I_{r}$ be a sequence of ideals in a local ring
$(R,\mathfrak{m})$ (or a standard graded algebra over a field and
$\mathfrak{m}$ is the maximal graded ideal) and let $I_{0}$ be an
$\mathfrak{m}$-primary ideal. In [16], the authors prove that
$\ell\left(I_{0}^{u_{0}}I_{1}^{u_{1}}\cdots
I_{r}^{u_{r}}/I_{0}^{u_{0}+1}I_{1}^{u_{1}}\cdots I_{r}^{u_{r}}\right)$ is a
polynomial $P(\underline{u})$, for $u_{i}$ large, where
$\underline{u}=(u_{0},\ldots,u_{r})$. Write this polynomial in the form

$P(\underline{u})=\sum_{\begin{subarray}{c}\alpha\in\mathbb{N}^{r+1}\\\
|\alpha|=t\end{subarray}}\frac{1}{\alpha!}e_{\alpha}(I_{0}\mid
I_{1},\ldots,I_{r})u^{\alpha}+\text{ lower degree terms, }$

where $t=\deg
P(\underline{u}),\alpha=(\alpha_{0},\ldots,\alpha_{r})\in\mathbb{N}^{r+1},\alpha!=\prod_{i=0}^{r}\alpha_{i}!$
and $|\alpha|=\sum_{i=0}^{r}\alpha_{i}.$ If $|\alpha|=t$, then
$e_{\alpha}(I_{0}\mid I_{1},\ldots,I_{r})$ are called the mixed multiplicities
of the ideals $I_{0},I_{1},\ldots,I_{r}$. In [23], the authors prove the
following result.

######  Theorem 1.2 ([23, Theorem 1.2]).

Assume that $d=\dim R/(0:I^{\infty})\geq 1$, where $I=I_{1}\cdots I_{r}$. Then
$\deg P(\underline{u})=d-1$.

We now briefly describe several applications of mixed multiplicities of
ideals. Suppose that $(R,\mathfrak{m})$ is a local ring of positive dimension
$d$ and $I_{0}\ldots,I_{r}\subseteq R$ are ideals of positive height.

(i) Let $t_{0},\ldots,t_{r}$ be indeterminates. Consider the multi-form rings

(1)
$\operatorname{gr}_{R}(I_{0},\ldots,I_{r};I_{i})=\mathcal{R}(I_{0},\ldots,I_{r})/(I_{i})\quad\text{for
}i=0,1,\ldots,r.$

Note that if $I_{0}$ is an $\mathfrak{m}$-primary ideal and
$I_{1},\ldots,I_{r}$ are ideals of positive height, then

$\ell\left(\frac{I_{0}^{u_{0}}I_{1}^{u_{1}}\cdots
I_{r}^{u_{r}}}{I_{0}^{u_{0}+1}I_{1}^{u_{1}}\cdots
I_{r}^{u_{r}}}\right)=\ell([\operatorname{gr}_{R}(I_{0},\ldots,I_{r};I_{0})]_{\underline{u}})$

is a polynomial of total degree $d-1$ for $u_{i}\gg 0$ and $i=0,1,\ldots,r$ as
we have observed above. Let us rewrite the terms in total degree $d-1$ in the
form

$\sum_{\begin{subarray}{c}\alpha\in\mathbb{N}^{r+1},\;|\alpha|=d-1\end{subarray}}\frac{1}{\alpha!}e(I_{0}^{[\alpha_{0}+1]}|I_{1}^{[\alpha_{1}]}|\cdots|I_{r}^{[\alpha_{r}]})u_{0}^{\alpha_{0}}\cdots
u_{r}^{\alpha_{r}}.$

For this case, M. Herrmann and his coauthors [12] expressed the multiplicity
of $\operatorname{gr}_{R}(I_{0},\ldots,I_{r};I_{0})$ by means of mixed
multiplicities in the following way:

$e(\operatorname{gr}_{R}(I_{0},\ldots,I_{r};I_{0}))=\sum_{\begin{subarray}{c}\alpha\in\mathbb{N}^{r+1}\\\
|\alpha|=d-1\end{subarray}}e(I_{0}^{[\alpha_{0}+1]}|I_{1}^{[\alpha_{1}]}|\cdots|I_{r}^{[\alpha_{r}]}).$

(ii) In [24], J. K. Verma proved that

$e(\mathcal{R}(I_{1}\ldots,I_{r}))=e(\operatorname{gr}_{R}(\mathfrak{m},I_{1}\ldots,I_{r};\mathfrak{m}))=\sum_{\begin{subarray}{c}\alpha\in\mathbb{N}^{r+1},\;|\alpha|=d-1\end{subarray}}e(\mathfrak{m}^{[\alpha_{0}+1]}|I_{1}^{[\alpha_{1}]}|\cdots|I_{r}^{[\alpha_{r}]}).$

(iii) In [7], C. D’Cruz showed similar result for the multi-graded extended
Rees algebra $T:=\mathcal{B}(I_{1},\ldots,I_{r})$
$=R[I_{1}t_{1},\ldots,I_{r}t_{r},t_{1}^{-1},\ldots,t_{r}^{-1}]$. She showed
that

$e(T_{N})=\frac{1}{2^{d}}\left[\sum\limits_{j=0}^{r}\sum\limits_{\begin{subarray}{c}\beta+\beta_{1}+\cdots+\beta_{j}=d-1\\\
1\leq i_{1}<\cdots<i_{j}\leq
r\end{subarray}}2^{\beta_{1}+\cdots+\beta_{j}}e(L^{[\beta+1]}|I_{i_{1}}^{[\beta_{1}]}|\cdots|I_{i_{j}}^{[\beta_{j}]})\right],$

where
$N:=\mathcal{N}(I_{1},\ldots,I_{r})=(I_{1}t_{1},\ldots,I_{r}t_{r},\mathfrak{m},t_{1}^{-1},\ldots,t_{r}^{-1})$
and $L=\mathfrak{m}^{2}+I_{1}+\cdots+I_{r}$.

In view of the above, we can easily compute multiplicities of Rees algebras,
extended Rees algebras and certain form rings, once mixed multiplicities are
known.

###  1.2. Mixed volumes of lattice polytopes.

We first recall the definition of mixed volumes. Let $P,Q$ be two polytopes
(not necessarily distinct) in $\mathbb{R}^{n}.$ Their Minkowski sum is defined
as the polytope

$P+Q:=\\{a+b\mid a\in P,b\in Q\\}.$

Let $Q_{1},\ldots,Q_{n}$ be an arbitrary collection of lattice polytopes in
$\mathbb{R}^{n}$ and $\lambda_{1},\ldots,\lambda_{n}\in\mathbb{R}_{+}$. H.
Minkowski proved that the function
$\operatorname{vol}_{n}(\lambda_{1}Q_{1}+\cdots+\lambda_{n}Q_{n})$ is a
homogeneous polynomial of degree $n$ in $\lambda_{1},\ldots,\lambda_{n}$, see
[6, Theorem 4.9, Chapter 7]. The coefficient of $\lambda_{1}\cdots\lambda_{n}$
is called the mixed volume of $Q_{1},\ldots,Q_{n}$ and denoted by
$MV_{n}(Q_{1},\ldots,Q_{n}).$ We set $[n]:=\\{1,\dots,n\\}.$ Then

$MV_{n}(Q_{1},\ldots,Q_{n}):=\sum_{\emptyset\neq
J\subseteq[n]}(-1)^{n-|J|}V_{n}\left(\sum_{j\in J}Q_{j}\right),$

see [6, Theorem 4.12 d., Chapter 7]. Here $V_{n}$ denotes the $n$-dimensional
Euclidean volume.

In [23], the authors explore the relationship between mixed multiplicities of
multigraded rings and mixed volumes.

######  Proposition 1.3 ([23, Corollary 2.5]).

Let $Q_{1},\ldots,Q_{n}$ be lattice polytopes in $\mathbb{R}^{n}$. Suppose
that $R=k[x_{0},x_{1},\ldots,x_{n}]$ is a polynomial ring and $\mathfrak{m}$
is its graded maximal ideal. Let $M_{i}$ be any set of monomials of the same
degree in $R$ such that $Q_{i}$ is the convex hull of the lattice points of
their dehomogenized monomials in $k[x_{1},\ldots,x_{n}]$. Let $I_{j}$ be the
ideal of $R$ generated by the monomials of $M_{j}$. Then

$MV_{n}(Q_{1},\ldots,Q_{n})=e_{(0,1,...,1)}(\mathfrak{m}|I_{1},\ldots,I_{n}).$

Mixed volumes of lattice polytopes have diverse applications. We describe a
few of them.

(1) In 1975, D. N. Bernstein proved that the mixed volume of the Newton
polytopes of Laurent polynomials $f_{1},\ldots,f_{n}\in k[x_{1}^{\pm
1},\ldots,x_{n}^{\pm 1}]$ is a sharp upper bound for the number of isolated
common zeros in the torus $(k^{*})^{n}$ where $k$ is an algebraically closed
field. Furthermore, this bound is attained for a generic choice of
coefficients in these $n$ polynomials if $\operatorname{char}k=0$.

(2) In 1993, W. Fulton proved that the mixed volume of the Newton polytopes of
Laurent polynomials $f_{1},\ldots,f_{n}\in k[x_{1}^{\pm 1},\ldots,x_{n}^{\pm
1}]$ is an upper bound of $\sum_{\alpha}i(\alpha)$, where
$\alpha\in(\overline{k}^{*})^{n}$ is any isolated common zero and $i(\alpha)$
denotes the intersection multiplicity at $\alpha.$

(3) Let $P$ be a lattice polytope of dimension $n$ and $|P\cap\mathbb{Z}^{n}|$
denote the number of lattice points. In 1962, E. Ehrhart proved that the
function $L(t\cdot P)=|tP\cap\mathbb{Z}^{n}|$, for all non-negative integers
$t$, is a polynomial of degree $n$ denoted by $E_{P}(t)\in\mathbb{Q}[t]$. The
polynomial $E_{P}(t)$ is called the _Ehrhart polynomial_ of $P$. For lattice
polytopes $P_{1},\ldots,P_{k}\subseteq\mathbb{R}^{n}$ in the integer lattice
$\mathbb{Z}^{n}$, we have the following mixed Ehrhart polynomial in one
variable $t$:

$ME_{P_{1},\ldots,P_{k}}(t)=\sum_{\emptyset\neq
J\subseteq[k]}(-1)^{k-|J|}L(t\cdot\sum_{j\in J}P_{j})\in\mathbb{Q}[t].$

If $\dim\left(\sum_{i=1}^{k}P_{i}\right)=n$, then by [11, Corollary 2.5], the
leading coefficient of $ME_{P_{1},\ldots,P_{k}}(t)$ is

$\sum\limits_{\begin{subarray}{c}\sum_{i=1}^{k}s_{i}=n,~{}s_{i}\geq
1\end{subarray}}\binom{n}{s_{1},\ldots,s_{k}}MV_{n}\left(P_{1}[s_{1}],\ldots,P_{k}[s_{k}]\right),$

where $\binom{n}{s_{1},\ldots,s_{k}}:=\frac{n!}{s_{1}!\cdots s_{k}!}$ and
$MV_{n}\left(P_{1}[s_{1}],\ldots,P_{k}[s_{k}]\right)$ means that the polytope
$P_{j}$ is taken $s_{j}$ times. In particular, when $k=n$,

$ME_{P_{1},\ldots,P_{n}}(t)=n!MV_{n}(P_{1},\ldots,P_{n})t^{n}.$

The coefficient of $t^{n-1}$ in $ME_{P_{1},\ldots,P_{k}}(t)$ is also described
in [11, Corollary 2.6].

###  1.3. Sectional Milnor numbers.

Suppose that the origin is an isolated singular point of a complex analytic
hypersurface $H=V(f)\subset\mathbb{C}^{n+1}.$ Let $f_{z_{i}}$ denote the
partial derivative of $f$ with respect to $z_{i}.$ Set

$\mu=\dim_{\mathbb{C}}\frac{\mathbb{C}\\{z_{0},z_{1},\dots,z_{n}\\}}{(f_{z_{0}},f_{z_{1}},\dots,f_{z_{n}})}.$

The number $\mu$ is called the Milnor number of the hypersurface $H$ at the
origin. In his Cargèse paper [22], B. Teissier refined the notion of Milnor
number by replacing it with a sequence of Milnor numbers of intersections with
general linear subspaces. Let $(X,0)$ be a germ of a hypersurface in
$\mathbb{C}^{n+1}$ with an isolated singularity. The Milnor number of $X\cap
E$, where $E$ is a general linear subspace of dimension $i$ passing through
the origin, is called the $i^{th}$-sectional Milnor number of $X$ at the
origin. It is denoted by $\mu^{(i)}(X,0).$ These are collected together in the
sequence

$\mu^{*}(X,0)=(\mu^{(n+1)}(X,0),\mu^{(n)}(X,0),\ldots,\mu^{(0)}(X,0)).$

Let $R=\mathbb{C}[x_{0},x_{1},\ldots,x_{n}]$ be a polynomial ring in $n+1$
variables, $\mathfrak{m}$ be the maximal graded ideal and $f\in R$ be any
polynomial having an isolated singularity at the origin. Recall that a point
$a\in V(f)$ is said to be _singular_ if the rank of the $1\times n$ matrix
$J(f)|_{a}$ is zero, where $J(f)=(f_{x_{0}},f_{x_{1}},\ldots,f_{x_{n}})$
denotes the _Jacobian matrix_. A polynomial $f$ is said to have an isolated
singularity at a point $a$ if $\\{a\\}$ is a (connected) component of the
variety $\operatorname{Sing}(f)=\\{a\in V(f)\mid J(f)|_{a}=0\\}$. We use the
same notation $J(f)$ to denote the _Jacobian ideal_ which is generated by the
entries of the Jacobian matrix associated to $f$. Teissier proved that the
$i^{th}$-mixed multiplicity, denoted by $e_{i}(\mathfrak{m}|J(f))$ or
$e(\mathfrak{m}^{[n+1-i]},J(f)^{[i]})$ is equal to the $i^{th}$-sectional
Milnor number of the singularity. Note that the the $(n+1)^{th}$ sectional
Milnor number of $f$ is the Minor number of $f,$ namely, $\dim_{C}R/J(f).$

Let $f\in\mathbb{C}[x_{0},x_{1},\ldots,x_{n}]$ be a homogeneous polynomial in
positive degree. Set $D(f)=\mathbb{P}^{n}\backslash V(f)$. In [13, p. 6], J.
Huh showed that the Euler Characteristic of $D(f)$ is given by

$\chi(D(f))=\sum\limits_{i=0}^{n}(-1)^{i}e_{i}(\mathfrak{m}\mid J(f)).$

We now describe the contents of the paper. In section 2, we generalize the
result of Cox, Lin and Sosa to find the defining ideal of multi-Rees algebra
of any collection of ideals having positive grade in a local ring or in a
standard graded algebra over a field. For any ideal $J$ in a Noetherian ring
$B$, we define the grade of $J$ to be the common length of the maximal
$B$-sequences in $J$ and denote it by $\operatorname{grade}(J)$. In view of
our result, we write a Macaulay2 algorithm to compute the defining ideal. The
computation time of these algorithms is compared with the computation time of
the Macaulay2 function reesIdeal in [9].

In section 3, we present a Macaulay2 algorithm which calculates mixed
multiplicities of ideals in a polynomial ring. We start with generalizing a
result of D. Katz, S. Mandal and J. K. Verma, to give a precise formula for
the Hilbert polynomial of the quotient of a multi-graded algebra over an
Artinian local ring. This result helps to calculate the mixed multiplicities
of a set of ideals $I_{0},I_{1},\ldots,I_{r}$, where $I_{0}$ is primary to the
maximal ideal and $I_{0},I_{1},\ldots,I_{r}$ are ideals in a local ring or in
a standard graded algebra over a field. The algorithm computes their mixed
multiplicities, where $\operatorname{grade}(I_{j})>0$ for all $j.$

Section 4 contains an in depth explanation of the codes which are used to
write the function mixedMultiplicity in the package MixedMultiplicity. This is
meant for the new users of Macaulay2.

In section 5, we give an algorithm which computes mixed volume of a collection
of lattice polytopes in $\mathbb{R}^{n}.$ We start with an algorithm which
outputs the homogeneous ideal corresponding to the vertices of a lattice
polytope. Given a collection of lattice polytopes in $\mathbb{R}^{n}$, N. V.
Trung and the last author proved that their mixed volume is equal to a mixed
multiplicity of a set of homogeneous ideals. The function mMixedVolume is
written based on their results to calculate the mixed volume.

In the last section, we give an algorithm to compute the sectional Milnor
numbers. We use Teissier’s observation of identifying the sectional Milnor
numbers with mixed multiplicities to achieve this task. Let $f$ be a
polynomial in the ring $k[x_{1},\ldots,x_{n}],$ where $\text{char}(k)=0$ and
$J(f)$ is $\mathfrak{m}$-primary. With an input of the polynomial $f$, the
function secMilnorNumbers outputs $e_{0}(\mathfrak{m}\mid
J(f)),\ldots,e_{n}(\mathfrak{m}\mid J(f)).$ Teissier [22] conjectured that
invariance of the Milnor number of an isolated singularity in a family of
hypersurfaces implies invariance of the sectional Milnor numbers. The
conjecture was disproved by Joël Briançon and Jean-Paul Speder. We verify
their example using our algorithm and also by explicitly calculating the mixed
multiplicities.

The algorithms written for the computation of defining ideal, mixed
multiplicities, mixed volume and sectional Milnor numbers are used in the
Macaulay2 ([10]) package MixedMultiplicity. Macaulay2 is a software system
devoted to support research in algebraic geometry and commutative algebra.

##  2\. Defining equations of multi-Rees algebras of ideals

An explicit formula for the defining ideal of the multi-Rees algebra of a
finite collection of monomial ideals in a polynomial ring was given by D. Cox,
K.-N. Lin, and G. Sosa in [5]. In this section, we generalize their result to
find the defining ideal of the multi-Rees algebra of a collection of ideals
with positive grade in a Noetherian ring. We use this result to write a
Macaulay2 algorithm to compute the defining ideal when the base ring is a
domain. We provide another algorithm for the non-domain case.

Let $R$ be a Noetherian ring and $I_{1},\ldots,I_{s}\subseteq R$ be ideals.
Suppose that $I_{i}=\langle f_{ij}\mid j=1,\ldots,n_{i}\rangle$ for all
$i=1,\dots,s$. Let $\mathcal{R}(I_{1},\ldots,I_{s})$ be the multi-Rees algebra
of ideals $I_{1},\ldots,I_{s}.$ Consider the set of indeterminates
$\underline{Y}=\\{Y_{ij}\mid i=1,\ldots,s,j=1,\ldots,n_{i}\\}$ and
$\underline{T}=(T_{1},\ldots,T_{s})$ over $R.$ Define an $R$-algebra
homomorphism
$R[\underline{Y}]\overset{\varphi}{\longrightarrow}\mathcal{R}(I_{1},\ldots,I_{s})\subseteq
R[\underline{T}]$ such that $\varphi(Y_{ij})=f_{ij}T_{i}$, for all
$i=1,\ldots,s$, $j=1,\ldots,n_{i}$ and $\varphi(r)=r$ for all $r\in R.$ Then
$\mathcal{R}(I_{1},\ldots,I_{s})\simeq R[\underline{Y}]/\ker(\varphi).$ The
ideal $\ker\varphi$ is called the defining ideal of
$\mathcal{R}(I_{1},\ldots,I_{s})$. We give an explicit description of
$\ker(\varphi).$

######  Theorem 2.1.

Let $R$ be a Noetherian ring and $I_{1},\ldots,I_{s}\subseteq R$ be ideals of
positive grade. For each $i$, consider a generating set $\\{f_{ij}\mid
j=1,\ldots,n_{i}\\}$ of $I_{i}$ which contains at least one nonzerodivisor
$f_{ij_{i}}$. We set $h=\prod_{i=1}^{s}f_{ij_{i}}$ and set

$\Gamma=\langle Y_{ij}f_{ij^{\prime}}-Y_{ij^{\prime}}f_{ij}\mid
i=1,\ldots,s\text{ and }j,j^{\prime}\in\\{1,\ldots,n_{i}\\}\mbox{ with }j\neq
j^{\prime}\rangle:h^{\infty}\subseteq R[\underline{Y}].$

Then $\Gamma\subseteq R[\underline{Y}]$ is the defining ideal of
$\mathcal{R}(I_{1},\ldots,I_{s})$.

###### Proof.

Without loss of generality, we may assume that $j_{i}=1$ for all
$i=1,\ldots,s$ and $h=\prod_{i=1}^{s}f_{i1}$. Consider the ring homomorphism
$\phi:R\to R[f_{11}^{-1},f_{21}^{-1},\ldots,f_{s1}^{-1}]\cong R[h^{-1}]$,
which induces a natural map $\widetilde{\phi}:R[\underline{Y}]\to
R[h^{-1}][\underline{Y}]\cong R[\underline{Y}]_{h}$. Note that
$\phi(I_{i})=(1,f_{i2}/f_{i1},\ldots,f_{in_{i}}/f_{i1})\subseteq R[h^{-1}]$ is
the unit ideal for $i=1,\ldots,s$. Consider the ring homomorphism

$\theta:R[h^{-1}][\underline{Y}]\to\mathcal{R}(\phi(I_{1}),\ldots,\phi(I_{s}))\subseteq
R[h^{-1}][\underline{T}]$

sending $Y_{i1}$ to $T_{i}$ and $Y_{ij}$ to $\frac{f_{ij}}{f_{i1}}T_{i}$ for
$i=1,\ldots,s$ and $j=1,\ldots,n_{i}$. Then we show that the defining ideal
$\ker\theta$ of $\mathcal{R}(\phi(I_{1}),\ldots,\phi(I_{s}))$ is
$J:=J_{1}+\cdots+J_{s}$, where
$J_{i}:=(Y_{i2}-\frac{f_{i2}}{f_{i1}}Y_{i1},\ldots,Y_{in_{i}}-\frac{f_{in_{i}}}{f_{i1}}Y_{i1})$.
Clearly, $J\subseteq\ker\theta$. On the other hand,

$\frac{R[h^{-1}][\underline{Y}]}{J}\cong R[h^{-1}][Y_{i1}\mid
i=1,\ldots,s]\cong R[h^{-1}][\underline{T}].$

This forces $\ker\theta=J$, as the last isomorphism is via $\theta$. We
further claim that $\widetilde{\phi}^{-1}(J)=\Gamma.$ For all $j\neq
j^{\prime},$ and every $i$,

$f_{ij}Y_{ij^{\prime}}-f_{ij^{\prime}}Y_{ij}=f_{ij}\left(Y_{ij^{\prime}}-\frac{f_{ij^{\prime}}}{f_{i1}}Y_{i1}\right)-f_{ij^{\prime}}\left(Y_{ij}-\frac{f_{ij}}{f_{i1}}Y_{i1}\right)$

is in $J_{i}$. So $\Gamma\subseteq\widetilde{\phi}^{-1}(J)$. Now let
$r\in\widetilde{\phi}^{-1}(J)$. Then $\widetilde{\phi}(r)\in J$, i.e.,

$\frac{r}{1}=\sum_{i=1}^{s}\sum_{j=2}^{n_{i}}\frac{a_{ij}}{h^{m_{ij}}}\left(Y_{ij}-\frac{f_{ij}}{f_{i1}}Y_{i1}\right)$

for some $a_{ij}\in R[\underline{Y}]$. Thus we have

$h^{m}r\in(f_{i1}Y_{ij}-f_{ij}Y_{i1}\mid 1\leq i\leq s\text{ and }1\leq j\leq
n_{i})\subseteq(f_{ij}Y_{ij^{\prime}}-f_{ij^{\prime}}Y_{ij}\mid 1\leq i\leq
s\text{ and }1\leq j,j^{\prime}\leq n_{i})$

for some $m\geq\max\\{m_{ij}\mid 1\leq i\leq s,1\leq j\leq n_{i}\\}+1$.
Therefore, $r\in\Gamma$ and hence the claim holds. Next, observe that $h^{t}$
is a nonzerodivisor on $R$ and hence on
$R[\underline{Y}]/\mathcal{K}\cong\mathcal{R}(I_{1},\ldots,I_{s})$ for every
$t\geq 1$. So $\mathcal{K}$ is a contracted ideal by [1, Proposition 3.11
(iii)]. Besides,
$\mathcal{R}(\phi(I_{1}),\ldots,\phi(I_{s}))\cong\mathcal{R}(I_{1},\ldots,I_{s})_{h}$.
Therefore,

$R[h^{-1}][\underline{Y}]/J\cong\mathcal{R}(I_{1},\ldots,I_{s})_{h}\cong\left(R[\underline{Y}]/\mathcal{K}\right)_{h}\cong
R[h^{-1}][\underline{Y}]/\mathcal{K}_{h}.$

As $J=\ker\theta=\mathcal{K}_{h}=\langle\widetilde{\phi}(\mathcal{K})\rangle$
and $\mathcal{K}$ is a contracted ideal so we get that
$\mathcal{K}=\widetilde{\phi}^{-1}(J)=\Gamma$. ∎

When $R$ is a domain or when a list of nonzerodivisors (one each from the list
of ideals with positive grades) is provided by the user, the function
multiReesIdeal computes the defining ideal of the multi-Rees algebra using
Theorem 2.1.

######  Algorithm (Version I: multiReesIdeal, set of ideals with positive
grade).

Let $I_{1},\ldots,I_{s}$ be ideals of a Noetherian ring $R$ with
$\operatorname{grade}I_{i}>0$ for all $i$ and let $a_{1},\ldots,a_{s}$ be a
set of nonzerodivisors, where $a_{i}$ belongs to the generating set of $I_{i}$
for all $i.$ When $R$ is a domain, the function picks $a_{i}$ to be the first
element in the generating set of $I_{i}$ for each $i$.
Input: The list $W=\\{\\{I_{1},\ldots,I_{s}\\},\\{a_{1},\ldots,a_{s}\\}\\}$,
or $W=\\{I_{1},\ldots,I_{s}\\}$ if $R$ is a domain.

  1. 1.

Define a polynomial ring $S$ by attaching $m$ indeterminates to the ring $R$,
where $m$ is the sum of the number of generators of all the ideals.

  2. 2.

For each ideal $I_{i}$, construct a matrix $M(i)$ whose first row consists of
the generators of the ideal and the second row consists of the indeterminates.

  3. 3.

Add the ideals generated by $2\times 2$ minors of these matrices to get an
ideal $L.$

  4. 4.

To get the defining ideal, saturate $L$ with the product of $a_{i}$’s.

Output: The defining ideal of the Rees algebra
$\mathcal{R}(I_{1},\ldots,I_{s}).$

The elements of the defining ideal are assigned $\mathbb{N}^{s+1}$ degree by
the function, where the first $\mathbb{N}^{s}$ coordinates point to the
component of $\mathcal{R}(I_{1},\ldots,I_{s})$ where the element lies and the
last coordinate is the degree of the element. Observe that the defining ideal
in the following example is generated in degrees $(1,0,5)$. The first two
coordinates asserts that the generator lies in $I_{1}t_{1}$, whereas the last
coordinate specifies that the element belongs to ${(I_{1})}_{5}\subseteq
R_{5}$.

######  Example 2.2.

    ΨΨΨΨi1 : R = QQ[w,x,y,z];
    ΨΨΨΨi2 : I = ideal(x^2-y*w, x^3-z*w^2);
    ΨΨΨΨi3 : J = ideal(w^2+x^2+y^2+z^2);
    ΨΨΨΨi4 : M = multiReesIdeal {I,J};
    ΨΨΨΨi5 : transpose gens M
    ΨΨΨΨo5 = {-1, 0, -5} | (x3-w2z)X_0+(-x2+wy)X_1 |
    ΨΨΨΨi6 : (first entries gens M)/degree
    ΨΨΨΨo6 : {{1, 0, 5}}
    ΨΨΨ

###  2.1. Routine for the non-domain case

In this section we present an algorithm to find the defining ideal of the Rees
algebra using the definition of Rees algebra. This method does not have any
requirements on the grade of the ideals or the domain property of the ring,
but it seems to be comparably slower than the previous method.

We can construct the Rees algebra of $I_{i}$ as the kernel of the map
$\varphi_{i}:R[Y_{i1},\dots,Y_{in_{i}}]\rightarrow R[T_{i}]$ where
$\varphi_{i}(Y_{ij})=f_{ij}T_{i}$ for $j=1,\ldots,n_{i}$. Notice that the idea
$(\ker\varphi_{i})R[\underline{Y}]\subseteq\ker\varphi$. Suppose that
$\phi_{i}$ is the presentation matrix of $I_{i}$ for $i=1,\dots,s$. Then the
symmetric algebra $\operatorname{Sym}(I_{i})$ has a presentation
$R[Y_{i1},\dots,Y_{in_{i}}]/\mathcal{L}_{i}$ where
$\mathcal{L}_{i}=I_{1}([Y_{i1},\dots,Y_{in_{i}}]\cdot\phi_{i})$. Clearly,
$\mathcal{L}_{i}\subseteq\ker\varphi_{i}\subset\ker\varphi$. So the map
$\varphi_{i}$ factors through the symmetric algebra
$\operatorname{Sym}(I_{i})$. Now
$\operatorname{Sym}(I_{1})\otimes\cdots\otimes\operatorname{Sym}(I_{s})$ has
the presentation $R[\underline{Y}]/(\mathcal{L}_{1}+\cdots+\mathcal{L}_{s})$.
Since each of $\mathcal{L}_{i}\subseteq\ker\varphi$, the map $\varphi$ also
factors through
$\operatorname{Sym}(I_{1})\otimes\cdots\otimes\operatorname{Sym}(I_{s})$. Thus
to find the defining ideal of the multi Rees algebra
$\mathcal{R}(I_{1},\dots,I_{s})$ it is enough to find the kernel of the
surjective map
$\operatorname{Sym}(I_{1})\otimes\cdots\otimes\operatorname{Sym}(I_{s})\rightarrow\mathcal{R}(I_{1},\dots,I_{s})$.

######  Algorithm (Version II: multiReesIdeal, no assumptions).

Let $I_{1},\ldots,I_{s}$ be ideals in the Noetherian ring $R$.
Input: The list $W=\\{I_{1},\ldots,I_{s}\\}.$

  1. 1.

For each $I_{i}$ compute the presentation
$F_{i}^{\prime}\xrightarrow{\phi_{i}}F_{i}\rightarrow I_{i}\rightarrow 0$,
where $\phi_{i}$ is the presentation matrix of $I_{i}$ for $i=1,\dots,s$.

  2. 2.

Now compute the source symmetric algebra
$\operatorname{Sym}(F_{1}^{\prime})\otimes\cdots\otimes\operatorname{Sym}(F_{s}^{\prime})$
and the target symmetric algebra
$\operatorname{Sym}(F_{1})\otimes\cdots\otimes\operatorname{Sym}(F_{s})$ of
the map $\phi_{1}\otimes\cdots\otimes\phi_{s}$.

  3. 3.

Compute the map between the symmetric algebra of the source and target and
return kernel of the above map.

Output: The defining ideal of the Rees algebra
$\mathcal{R}(I_{1},\ldots,I_{s}).$

In the following example the ring $U$ is not a domain and hence the algorithm
uses the above method. As expected, the computational time in the case a
nonzerodivisor is given as an optional input is faster than the case where no
optional input is given.

######  Example 2.3.

    ΨΨΨi1 : R = QQ[w,x,y,z]/ideal(w*x, y*z);
    ΨΨΨi2 : m = ideal vars R;
    ΨΨΨi3 : time multiReesIdeal m
    ΨΨΨ-- used 0.290619 seconds
    ΨΨΨo3 = ideal(y*X, z*X, z*X -x*X, y*X -x*X, w*X, z*X -w*X, y*X -w*X, x*X, X X, X X)
    ΨΨΨ              3    2    1    3    1    2    1    0    3    0    2    0  2 3  0 1
    ΨΨΨi4 : time multiReesIdeal (m, w+x);
    ΨΨΨ-- used 0.0283374 seconds
    ΨΨ

##  3\. Computation of mixed multiplicities of multi-graded algebras

In [25], D. Katz, S. Mandal and the last author, found a precise formula for
the Hilbert polynomial of the quotient of a bi-graded algebra over an Artinian
local ring. We generalize this result for quotient of a multi-graded algebra
over an Artinian local ring. This improvement helps in the calculation of the
mixed multiplicities of a set of ideals $I_{0},I_{1},\ldots,I_{r}$, where
$I_{0}$ is primary to the maximal ideal and $I_{0},I_{1},\ldots,I_{r}$ are
ideals in a local ring or in a standard graded algebra over a field. We end
the section by giving an algorithm to compute the mixed multiplicity of a
sequence of ideals $I_{0},I_{1},\ldots,I_{r}$ of a polynomial ring, where
$I_{0}$ is an primary to the maximal ideal and $\operatorname{ht}(I_{j})>0$
for all $j.$

Let $S$ be an Artinian local ring and $A=S[X_{1},\ldots,X_{r}]$ be an
$\mathbb{N}^{r}$-graded ring over $S,$ where for $1\leq i\leq r$,
$X_{i}=\\{X_{i}(0),\ldots,X_{i}(s_{i})\\}$ is a set of indeterminates of
degree $e_{i}.$ Set $\underline{u}=(u_{1},\ldots,u_{r})\in\mathbb{N}^{r}$ and
$|u|=u_{1}+\cdots+u_{r}$. Then
$A=\bigoplus_{\underline{u}\in\mathbb{N}^{r}}A_{\underline{u}}$, where
$A_{\underline{u}}$ is the $S$-module generated by monomials of the form
$P_{1}\cdots P_{r}$, where $P_{i}$ is a monomial of degree $u_{i}$ in $X_{i}$.
An element in $A_{\underline{u}}$ is called multi-homogeneous of degree
$\underline{u}$. An ideal $I\subseteq A$ generated by multi-homogeneous
elements is called a multi-homogeneous ideal. Then $R=A/I$ is an
$\mathbb{N}^{r}$-graded algebra with $\underline{u}$-graded component
$R_{\underline{u}}=A_{\underline{u}}/I_{\underline{u}}$. The Hilbert function
of $R$ is defined as $H(\underline{u})=\lambda(R_{\underline{u}}),$ where
$\lambda$ denotes the length as an $S$-module. Set
$\underline{t}^{\underline{u}}=t_{1}^{u_{1}}\cdots t_{r}^{u_{r}}$. The Hilbert
series of $R$ is given by
$HS(R,\underline{t})=\sum_{\underline{u}\in\mathbb{N}^{r}}\lambda(R_{\underline{u}})\underline{t}^{\underline{u}}$.
Then there exists a polynomial
$N(t_{1},\ldots,t_{r})\in\mathbb{Z}[t_{1},\ldots,t_{r}]$ so that

(2)
$HS(R,\underline{t})=N(t_{1},\ldots,t_{r})/\left((1-t_{1})^{s_{1}+1}\cdots(1-t_{r})^{s_{r}+1}\right).$

Note that the rational function on the right hand side need not be reduced.

######  Theorem 3.1.

Write the Hilbert polynomial of $R$ as

(3)
$P(\underline{u},R)=\sum_{\alpha=\underline{0}}^{\underline{s}}c_{\alpha}\binom{u_{1}+\alpha_{1}}{\alpha_{1}}\cdots\binom{u_{r}+\alpha_{r}}{\alpha_{r}}.$

Then

$c_{\alpha}=\frac{(-1)^{|\underline{s}-\alpha|}}{(s_{1}-\alpha_{1})!\cdots(s_{r}-\alpha_{r})!}\cdot\frac{\partial^{|\underline{s}-\alpha|}N}{\partial
t_{1}^{s_{1}-\alpha_{1}}\cdots\partial
t_{r}^{s_{r}-\alpha_{r}}}\scalebox{2.5}{$\mid$}_{(t_{1},\ldots,t_{r})=\underline{1}}.$

###### Proof.

We write

$N^{(\underline{\alpha})}=\frac{\partial^{|\alpha|}N(t_{1},\ldots,t_{r})}{\partial
t_{1}^{\alpha_{1}}\cdots\partial
t_{r}^{\alpha_{r}}}\scalebox{2.5}{$\mid$}_{(t_{1},\ldots,t_{r})=\underline{1}}.$

Then

$HS(R,\underline{t})-\sum_{\underline{\alpha}=\underline{0}}^{\underline{s}}\frac{N^{(\underline{\alpha})}(-1)^{|\alpha|}}{\alpha_{1}!\cdots\alpha_{r}!(1-t_{1})^{s_{1}+1-\alpha_{1}}\cdots(1-t_{r})^{s_{r}+1-\alpha_{r}}}=\frac{D(t_{1},\ldots,t_{r})}{(1-t_{1})^{s_{1}+1}\cdots(1-t_{r})^{s_{r}+1}}$

where

$D(t_{1},\ldots,t_{r})=N(t_{1},\ldots,t_{r})-\sum_{\underline{\alpha}=\underline{0}}^{\underline{s}}\frac{N^{\underline{\alpha}}}{\alpha_{1}!\cdots\alpha_{r}!}(t_{1}-1)^{\alpha_{1}}\cdots(t_{r}-1)^{\alpha_{r}}.$

Thus $D(t_{1},\ldots,t_{r})$ is the remainder of the Taylor series of
$N(t_{1},\ldots,t_{r})$ about the point $(1,\ldots,1)\in\mathbb{N}^{r}$ having
terms of degree $\geq s_{i}+1$ in $t_{i}-1$, for all $1\leq i\leq r$. So
$D(t_{1},\ldots,t_{r})$ is divisible by
$(1-t_{1})^{s_{1}+1}\cdots(1-t_{r})^{s_{r}+1}$. Therefore, for all large
$u_{i}$’s, $\lambda(R_{\underline{u}})$ is the coefficient of
$\underline{t}^{\underline{u}}$ in the power series expansion of

(4)
$E(t_{1},\ldots,t_{r})=\sum_{\underline{\alpha}=\underline{0}}^{\underline{s}}\frac{N^{(\underline{\alpha})}(-1)^{|\underline{\alpha}|}}{\alpha_{1}!\cdots\alpha_{r}!(1-t_{1})^{s_{1}+1-\alpha_{1}}\cdots(1-t_{r})^{s_{r}+1-\alpha_{r}}}.$

As the coefficient of $\underline{t}^{\underline{u}}$ in
$E(t_{1},\ldots,t_{r})$ is given by a polynomial for all $\underline{u}$ so

(5)
$E(t_{1},\ldots,t_{r})=\sum_{\underline{u}\in\mathbb{N}^{r}}P(\underline{u};R)\underline{t}^{\underline{u}}.$

Here we are using the fact that two polynomials in
$\mathbb{Z}[y_{1},\ldots,y_{r}]$ coinciding at $\underline{u}$, for all
$u_{i}$ large, are equal. Now expanding the rational function in (4), we get

(6)
$\begin{split}E(t_{1},\ldots,t_{r})&=\sum_{\underline{\alpha}=\underline{0}}^{\underline{s}}\frac{N^{(\underline{\alpha})}(-1)^{|\underline{\alpha}|}}{\alpha_{1}!\cdots\alpha_{r}!}\sum_{\underline{u}\in\mathbb{N}^{r}}\binom{s_{1}-\alpha_{1}+u_{1}}{u_{1}}\cdots\binom{s_{r}-\alpha_{r}+u_{r}}{u_{r}}\underline{t}^{\underline{u}}\\\
&=\sum_{\underline{u}\in\mathbb{N}^{r}}\left(\sum_{\underline{\alpha}=\underline{0}}^{\underline{s}}\frac{N^{(\underline{\alpha})}(-1)^{|\underline{\alpha}|}}{\alpha_{1}!\cdots\alpha_{r}!}\right)\binom{s_{1}-\alpha_{1}+u_{1}}{u_{1}}\cdots\binom{s_{r}-\alpha_{r}+u_{r}}{u_{r}}\underline{t}^{\underline{u}}.\end{split}$

Comparing (6) with (5), we get the result. ∎

Note that

$\binom{u_{i}+\alpha_{i}}{\alpha_{i}}=\frac{1}{\alpha_{i}!}u_{i}^{\alpha_{i}}+\text{
lower degree terms}.$

So if we write $P(\underline{u})$ as in (3), then $c_{\alpha}=e_{\alpha}$ for
all $\alpha\in\mathbb{N}^{r+1}$ with $|\alpha|=d-1$, see Theorem 1.2.
Therefore, Theorem 3.1 gives an expression for $e_{\alpha}.$

######  Remark 3.2.

Let $I^{\prime}_{0},I^{\prime}_{1},\ldots,I^{\prime}_{r}$ denote the images of
ideals $I_{0},I_{1},\ldots,I_{r}$ in $A^{\prime}:=A/(0:I^{\infty}),$ where
$I=I_{1}\cdots I_{r}.$ Following the notations in [23], we set
$R:=R(I_{0}|I_{1},\ldots,I_{r})=\mathcal{R}(I_{0},\ldots,I_{r})/(I_{0})$ and
put $R^{\prime}:=R(I^{\prime}_{0}|I^{\prime}_{1},\ldots,I^{\prime}_{r}).$
Notice $R=\operatorname{gr}_{A}(I_{0},I_{1},\ldots,I_{r};I_{0})$, defined in
(1). Then for $\underline{u}$ large,
$P_{R}(\underline{u})=P_{R^{\prime}}(\underline{u})$ (see [23, Theorem 1.2]
for details). Therefore, in case $\operatorname{grade}I_{i}=0$ for some $i$,
the user needs to work in the quotient ring $A^{\prime}$ and input the images
of the ideals in the quotient ring.

######  Algorithm.

The algorithm for the function mixedMultiplicity uses the above ideas to
calculate the mixed multiplicity. Let $I_{0},I_{1},\ldots,I_{r}$ be a set of
ideals of a Noetherian ring $R$ of dimension $d\geq 1$, where $I_{0}$ is
primary to the maximal ideal and $\operatorname{grade}(I_{i})>0$ for all $i$;
$\underline{a}=(a_{0},a_{1},\ldots,a_{r})\in\mathbb{N}^{r+1}$ with
$|\underline{a}|=d-1.$
Input: The sequence
$W=((I_{0},I_{1},\ldots,I_{r}),(a_{0},a_{1},\ldots,a_{r}))$.

  1. 1.

Compute the defining ideal of the multi-Rees algebra using the function
multiReesIdeal and use it to find the Hilbert series of $R(I_{0}\mid
I_{1},\ldots,I_{r}).$

  2. 2.

Extract the powers of $(1-T_{i})$ in the denominator of the Hilbert series.

  3. 3.

Calculate $e_{\underline{a}}$ using the formula given in Theorem 3.1.

Output: The mixed multiplicity $e_{\underline{a}}(I_{0}\mid
I_{1},\ldots,I_{r})$.

######  Example 3.3.

    ΨΨΨΨi1 : R = QQ[w,x,y,z];
    ΨΨΨΨi2 : I = ideal(x^2-y*w, x^3-z*w^2);
    ΨΨΨΨi3 : m = ideal vars R;
    ΨΨΨΨi4 : mixedMultiplicity((m,I),(3,0))
    ΨΨΨΨo4 = 1
    ΨΨΨΨi5 : mixedMultiplicity((m,I),(2,1))
    ΨΨΨΨo5 = 2
    ΨΨΨ

When some ideal has grade zero, the following example explains how to compute
the mixed multiplicity.

######  Example 3.4.

Let $R=\mathbb{Q}[w,x,y,z]/(wx,yz)$, $\mathfrak{m}=(w,x,y,z)$, and $I=(w,y).$
Notice that $\operatorname{grade}I=0$, since $I\in\operatorname{Ass}R$.

    ΨΨΨi1 : R = QQ[w,x,y,z]/ideal(w*x, y*z);
    ΨΨΨi2 : I = ideal(w,y);
    ΨΨΨi3 : m = ideal vars S;
    ΨΨΨi4 : L = saturate(sub(ideal 0, R), I);
    ΨΨΨi5 : T = S/L;
    ΨΨΨi6 : J = substitute(I, T);
    ΨΨΨi7 : n = substitute(m, T);
    ΨΨΨi8 : dim T
    ΨΨΨo8 = 2
    ΨΨΨi9 : mixedMultiplicity ((n,J),(1,0))
    ΨΨΨo9 = 3
    ΨΨΨ

To calculate mixed multiplicities, the function mixedMultiplicity computes the
Hilbert polynomial of the graded ring $\bigoplus
I_{0}^{u_{0}}I_{1}^{u_{1}}\cdots
I_{r}^{u_{r}}/I_{0}^{u_{0}+1}I_{1}^{u_{1}}\cdots I_{r}^{u_{r}}$ . In
particular, if $I_{1},\ldots,I_{r}$ are also $\mathfrak{m}$-primary ideals,
then $e_{(a_{0},a_{1},\ldots,a_{r})}(I_{0}\mid
I_{1},\ldots,I_{r})=e(I_{0}^{[a_{0}+1]},I_{1}^{[a_{1}]},\ldots,I_{r}^{[a_{r}]})$
(see [14, Definition 17.4.3]). Therefore, to compute the
$(a_{0}+1,a_{1},\ldots,a_{r})$-th mixed multiplicity of
$I_{0},I_{1},\ldots,I_{r}$, one needs to enter the sequence
$(a_{0},a_{1},\ldots,a_{r})$ in the function. The same is illustrated in the
following example.

######  Example 3.5.

Let $R=\mathbb{Q}[w,x,y,z]$ and $\mathfrak{m}$ be the maximal homogeneous
ideal of $R.$ Let $I=(x^{2}-yw,x^{3}-zw^{2})$ and $J=\mathfrak{m}^{4}+I.$ We
calculate the mixed multiplicities
$e(\mathfrak{m})=e(\mathfrak{m}^{[4]},J^{[0]})$ and
$e(\mathfrak{m}^{[3]},J^{[1]}).$

    ΨΨΨΨi1 : R = QQ[w,x,y,z];
    ΨΨΨΨi2 : m = ideal vars R;
    ΨΨΨΨi3 : I = ideal(x^2-y*w, x^3-z*w^2);
    ΨΨΨΨi4 : J = m^4 + I;
    ΨΨΨΨi5 : mixedMultiplicity ((m,J),(3,0))
    ΨΨΨΨo5 = 1
    ΨΨΨΨi6 : mixedMultiplicity ((m,J),(2,1))
    ΨΨΨΨo6 = 2
    ΨΨΨ

##  4\. Writing the function mixedMultiplicity in Macaulay2

In this section, we illustrate a detailed overview of the function
mixedMultiplicity based on the algorithm discussed in the previous section.
One can refer to the package MixedMultiplicity for the Macaulay2 code of this
function.

We start with two sequences W1=$(I_{0},I_{1},\ldots,I_{r})$ and
W2=$(a_{0},a_{1},\ldots,a_{r})$. Then the command W1#i returns the $i$-th
element of W1, that is, $I_{i}$. All ideals are expected to be in the same
ring. To capture the ambient of these ideals we use ring W1#0. We now check
that the ambient ring has dimension at least one, the two sequences W1, W2
have same length, W1 consists of ideals of positive grade with same ambient
ring, and W2 is a sequence of natural numbers. Now we set ‘$n$’ to be the
cardinality of W1, that is, $n=r+1$. The defining ideal of the multi-Rees
algebra $\mathcal{R}(I_{0},\ldots,I_{r})$ is computed using the function
multiReesIdeal and named as L1. For $i=1,\ldots,n$, V(i) gives us the unit
vector $(0,..,0,1,0,..,0)\in\mathbb{N}^{n}$, where $1$ is at the $i^{th}$
place. Next, Q is a list of V(i)’s where V(i) occurs as many times as the
number of generators of W1#i (i.e., $I_{i}$) for $i=0,\ldots,r$. We use
compress gens to remove zero entries, if any, from the input generating set of
ideals. As we use compress gens in the function multiReesIdeal too so it is
compatible. Since gens gives us the generators of an ideal as a matrix, we
could also use #(first entries compress gens W1#i). The command first entries
extracts the first row of a matrix in the form of a list. Other possible
commands are numgens trim W1#i and rank source mingens W1#i.

Then we define a ring S, which is the same ring as the ambient ring of L1, but
is now multigraded with degrees given by Q. By sub(W1#0, S), we view the ideal
W1#0 as an ideal in S and call it p. Next, we view L1 as an ideal in S/p and
call it L2. Recall that W1#0$=I_{0}$ is primary to the maximal ideal in its
ambient ring. hilbertSeries computes the Hilbert series of L2 and reduce it
using the command reduceHilbert. Thus we get an expression H as in (2). To use
Theorem 3.1, we extract the numerator B0 and denominator B1 of H. Factoring
out B1, we capture the powers. For instance, if B1
$=T_{0}T_{1}^{2}-2T_{0}T_{1}-T_{1}^{2}+T_{0}+2T_{1}-1$, then facB1 = factor B1
$=(T_{1}-1)^{2}(T_{0}-1)$, and facB1#0 $=(T_{1}-1)^{2}.$ The command facB1#0
executes because factor outputs an expression of the class Product, which is a
type of a basic list. Since Power is also a type of a basic list, we get
facB1#0#1= $2.$ We now extract $a_{i}$’s with the command W2#i and verify that
$a_{i}\leq\mbox{ power of }(1-T_{i}).$ At this stage the function has the
value of all the variables in the expression given in Theorem 3.1. So we just
compute the value.

##  5\. Mixed volume of lattice polytopes

Given a collection of lattice polytopes in $\mathbb{R}^{n}$, Trung and the
last author proved that their mixed volume is equal to a mixed multiplicity of
a set of homogeneous ideals, see Proposition 1.3. We use this result to
construct an algorithm which calculates the mixed volume of a collection of
lattice polytopes. We also give an algorithm which outputs the homogeneous
ideal corresponding to the vertices of a lattice polytope.

Let $Q$ be a lattice polytope in $\mathbb{R}^{n}$ with the set of vertices
$\\{p_{1},\ldots,p_{r}\\}\subseteq\mathbb{N}^{n}$. We first compute the
corresponding homogeneous ideal $I$ in the polynomial ring
$R=k[x_{1},\ldots,x_{n+1}]$ such that $Q$ is the convex hull of the lattice
points of the dehomogenization of a monomial generating set of $I$ in
$k[x_{1},\ldots,x_{n}]$. For this purpose, we write a function
homIdealPolytope which requires as an input the list of vertices of $Q$.

######  Algorithm.

Suppose that $p_{1},\ldots,p_{r}\subseteq\mathbb{N}^{n}$ are vertices of a
polytope $Q$.
Input: The list $W=\\{p_{1},p_{2},\ldots,p_{r}\\}$.

  1. 1.

Define a polynomial ring $R$ in $(n+1)$-variables over $\mathbb{Q}$, where the
vertices are in $\mathbb{R}^{n}$.

  2. 2.

For each vertex $p_{i}$, associate a monomial in the first $n$-variables,
where the $j$-th component of $p_{i}$ is the power of the $j$-th variable and
add them up.

  3. 3.

Add the monomials and homogenize it with respect to the last variable.

  4. 4.

Define an ideal generated by the terms of the homogeneous element.

Output: The corresponding homogeneous ideal in
$\mathbb{Q}[x_{1},\ldots,x_{n+1}]$.

We now write a function mMixedVolume to calculate the mixed volume of a
collection of $n$ lattice polytopes in $\mathbb{R}^{n}.$ Let
$Q_{1},\ldots,Q_{n}$ be an arbitrary collection of lattice polytopes in
$\mathbb{R}^{n}$. Let $I_{i}$ be the homogeneous ideal of
$R=k[x_{1},\ldots,x_{n+1}]$ associated to $Q_{i}$ for $i=1,\ldots,n$. The
function mMixedVolume takes the list $\\{I_{1},\ldots,I_{n}\\}$ as an input
and produces the mixed volume of $Q_{1},\ldots,Q_{n}$ as an output. The
function can also take the list of lists of vertices of the polytope as an
input to compute their mixed volume. Since calculating the mixed volume is
same as calculating a mixed multiplicity, the algorithm of the function
mMixedVolume is similar to that of mixedMultiplicity.

######  Example 5.1.

Let $Q_{1},Q_{2},Q_{3}$ be the same tetrahedron with vertices
$(1,1,0),(2,1,0),(1,3,0)$ and $(1,1,3)$. Using the formula, the mixed volume
can be calculated as follows:

$\displaystyle MV_{3}(Q_{1},Q_{2},Q_{3})=$ $\displaystyle
V_{3}(Q_{1}+Q_{2}+Q_{3})-V_{3}(Q_{1}+Q_{2})-V_{3}(Q_{2}+Q_{3})-V_{3}(Q_{3}+Q_{1})$
$\displaystyle\qquad+V_{3}(Q_{1})+V_{3}(Q_{2})+V_{3}(Q_{3}),$

where $V_{3}$ denotes the $3$-dimensional Euclidean volume. One can check that
$V_{3}(Q_{i})=1$, for all $i=1,2,3$; $V_{3}(Q_{i}+Q_{j})=8$, for all $i\neq j$
and $V_{3}(Q_{1}+Q_{2}+Q_{3})=27$. Hence
$MV_{3}(Q_{1},Q_{2},Q_{3})=27-(3\times 8)+(3\times 1)=6.$ The following
Macaulay2 working verifies this calculation.

    ΨΨi1 : A = {(1,1,0),(2,1,0),(1,3,0),(1,1,3)};
    ΨΨi2 : mMixedVolume{A,A,A}
    ΨΨo2 = 6
    Ψ

######  Example 5.2.

Consider a generic vertical parabola $f_{1}$ and a generic horizontal parabola
$f_{2}$ given by

$\displaystyle f_{1}$
$\displaystyle=c_{1,(0,0)}+c_{1,(1,0)}x+c_{1,(2,0)}x^{2}+c_{1,(0,1)}y,$
$\displaystyle f_{2}$
$\displaystyle=c_{2,(0,0)}+c_{2,(1,0)}x+c_{2,(0,1)}y+c_{2,(0,2)}y^{2}.$

We compute the mixed volume of the Newton polytopes associated to the supports
$Q_{1},Q_{2}$ of $f_{1}$, and $f_{2}$ respectively.

    ΨΨΨΨi1 : Q1 = {(0,0),(1,0),(2,0),(0,1)};
    ΨΨΨΨi2 : Q2 = {(0,0),(1,0),(0,1),(0,2)};
    ΨΨΨΨi3 : mMixedVolume {Q1, Q2}
    ΨΨΨΨo3 = 4
    ΨΨΨ

This computation verifies [2, Example 1.2] and also gives a bound for the
number of common zeros (in the complex torus) of $f_{1}$ and $f_{2}$ (see
Bernstein’s theorem in subsection 1.2).

######  Example 5.3.

We compute and verify the mixed volumes of the two pairs of convex polytopes,
which appeared in [4, Example 1.1] and [4, Section 2] (take $\lambda=1$),
respectively.

    ΨΨΨi1 : Q1 = {(1, 1),(3, 0),(4, 0),(4, 1),(3, 3),(1, 4),(0, 4),(0, 3)};
    ΨΨ

    ΨΨΨi2 : Q2 = {(0, 1),(0, 0),(3, 0),(4, 1),(4, 4),(3, 4)};
    ΨΨΨi3 : mMixedVolume {Q1, Q2}
    ΨΨΨo3 = 32
    ΨΨΨi4 : P1 = {(0, 0),(0, 2),(2, 0),(2, 2)};
    ΨΨΨi5 : P2 = {(0, 0),(1, 2),(2, 1)};
    ΨΨΨi6 : mMixedVolume {P1, P2}
    ΨΨΨo6 = 8
    Ψ

$x$$y$$Q1$$Q2$

##  6\. Sectional Milnor number

In this section, we give an algorithm to compute the sectional Milnor numbers.
We use Teissier’s observation of identifying the sectional Milnor numbers with
mixed multiplicities to achieve this task. Teissier ([22]) conjectured that
invariance of Milnor number implies invariance of the sectional Milnor
numbers. The conjecture was disproved by Joël Briançon and Jean-Paul Speder.
We verify their example using our algorithm and also by explicitly calculating
the mixed multiplicities.

Let $R=\mathbb{C}[x_{1},\ldots,x_{n}]$ be a polynomial ring in $n$ variables,
$\mathfrak{m}$ be the maximal graded ideal and $f\in R$ be any polynomial with
an isolated singularity at the origin. Using Theorem 3.1, one can now
calculate the mixed multiplicities of $\mathfrak{m}$ and $J(f)$. We use the
ideas in the previous section to write a function secMilnorNumbers for
computing the first $n-1$ sectional Milnor numbers. With a polynomial $f$
given as an input, the algorithm calculates the Jacobian ideal of $f$ and then
using the function multiReesIdeal, it finds the defining ideal of
$\mathcal{R}(\mathfrak{m},J(f))$. This helps to compute the Hilbert series of
the special fiber
$\mathcal{F}(\mathfrak{m},J(f))=\mathcal{R}(\mathfrak{m},J(f))\otimes_{R}R/\mathfrak{m}$.
Using the formula given in Theorem 3.1, it then calculates the mixed
multiplicities. Note that the $n^{th}$-sectional Milnor number is the Milnor
number of the hypersurface $f$ at the origin. So under the extra assumption
that the ideal $J(f)$ is $\mathfrak{m}$-primary, we have
$\mu^{(n)}(X,0)=\dim_{\mathbb{C}}R/J(f)$. Together, the function
secMilnorNumbers outputs
$\left(\mu^{(0)}(X,0),\mu^{(1)}(X,0),\ldots,\mu^{(n)}(X,0)\right)$.

######  Example 6.1.

Let $R=\mathbb{Q}[x,y,z]$ and $f=x^{4}+y^{4}+z^{4}$ be a polynomial in the
ring.

    ΨΨΨi1 : R = QQ[x,y,z];
    ΨΨΨi2 : f = x^4+y^4+z^4;
    ΨΨΨi3 : secMilnorNumbers f
    ΨΨΨo3 = HashTable{0 => 1, 1 => 3, 2 => 9, 3 => 27}
    ΨΨΨ

######  Remarks 6.2.

  1. (1)

We set $I:=(f,J(f))$. If $f$ has an isolated singularity at the origin, then
by definition $IR_{\mathfrak{m}}$ is an $\mathfrak{m}R_{\mathfrak{m}}$-primary
ideal. In view of [14, Theorem 7.1.5, Proposition 1.6.2],
$f/1\in\overline{J(f)R_{\mathfrak{m}}}$ and hence $J(f)R_{\mathfrak{m}}\subset
IR_{\mathfrak{m}}$ is a reduction. Thus

$IR_{\mathfrak{m}}\subset\overline{IR_{\mathfrak{m}}}=\overline{J(f)R_{\mathfrak{m}}}\subseteq\sqrt{J(f)R_{\mathfrak{m}}}\subset\sqrt{IR_{\mathfrak{m}}},$

see [14, Remark 1.1.3 (3)]. So
$\sqrt{J(f)R_{\mathfrak{m}}}=\sqrt{IR_{\mathfrak{m}}}=\mathfrak{m}R_{\mathfrak{m}}$.
Therefore, $J(f)R_{\mathfrak{m}}$ is $\mathfrak{m}R_{\mathfrak{m}}$-primary.
The example in $(2)$ says that $J(f)$ need not be $\mathfrak{m}$-primary even
when $I$ is $\mathfrak{m}$-primary. However, if $f$ is homogeneous, then by
the _classical Euler formula_ $(\deg f)\cdot f=$
$\sum_{i=1}^{n}x_{i}\cdot\partial f/\partial x_{i}\in J(f)$. Hence $J(f)=I$.
Consequently, $J(f)$ is $\mathfrak{m}$-primary if $I$ is so.

  2. (2)

If $J(f)$ is not $\mathfrak{m}$-primary, then the Milnor number is
$\dim_{\mathbb{C}}\frac{R_{\mathfrak{m}}}{J(f)R_{\mathfrak{m}}}$, the
multiplicity of $R/J(f)$ at $\mathfrak{m}$. It can be computed using Macaulay2
by means of the $R$-module isomorphism

(7)
$\frac{R_{\mathfrak{m}}}{J(f)R_{\mathfrak{m}}}\overset{\overline{\varphi}}{\cong}\frac{R}{\varphi^{-1}\big{(}J(f)R_{\mathfrak{m}}\big{)}}=\frac{R}{(J(f):(J(f):\mathfrak{m}^{\infty}))}$

induced from the natural inclusion $\varphi:R\to R_{\mathfrak{m}}$, see [8,
Page 61]. Since
$\varphi^{-1}\big{(}J(f)R_{\mathfrak{m}}\big{)}R_{\mathfrak{m}}=J(f)R_{\mathfrak{m}}$
by [1, Proposition 1.17], $\overline{\varphi}_{\mathfrak{m}}$ is an
isomorphism. So from [1, Proposition 3.9] it follows that $\overline{\varphi}$
is an isomorphism. It is now enough to show

$\varphi^{-1}\left(J(f)R_{\mathfrak{m}}\right)=(J(f):(J(f):\mathfrak{m}^{\infty})).$

Suppose that $J(f)=\left(\cap_{i=1}^{r}Q_{i}\right)\cap Q$ is a minimal
primary decomposition, where $\sqrt{Q}=\mathfrak{m}$ and
$\sqrt{Q_{i}}=P_{i}\neq\mathfrak{m}$ for $i=1,\ldots,r$. Since
$J(f)R_{\mathfrak{m}}$ is $\mathfrak{m}R_{\mathfrak{m}}$-primary,
$\mathfrak{m}$ is a minimal prime of $J(f)$ and $P_{i}\nsubseteq\mathfrak{m}$
for $i=1,\ldots,r$. By [1, Theorem 4.10], the $\mathfrak{m}$-primary component
of $J(f)$ is unique. We now show that

$\varphi^{-1}\left(J(f)R_{\mathfrak{m}}\right)=Q=(J(f):(J(f):\mathfrak{m}^{\infty})).$

By [1, Proposition 4.9], $J(f)R_{\mathfrak{m}}=QR_{\mathfrak{m}}$ and
$\varphi^{-1}(J(f)R_{\mathfrak{m}})=Q$. On the other hand,
$\widetilde{J(f)}:=(J(f):\mathfrak{m}^{\infty})=\cap_{i=1}^{r}Q_{i}$, the
intersection of all non $\mathfrak{m}$-primary components of $J(f)$. Due to
[1, Proposition 1.11], we can pick
$x\in\left(\cap_{i=1}^{r}Q_{i}\right)\backslash\mathfrak{m}$. Then

$(J(f):\widetilde{J(f)})\subseteq(J(f):x)=\left(\cap_{i=1}^{r}(Q_{i}:x)\right)\cap(Q:x)=Q,$

by [1, Lemma 4.4]. Besides, as $\widetilde{J(f)},Q$ are co-maximal so
$Q\cdot\widetilde{J(f)}=Q\cap\widetilde{J(f)}=J(f)$. Therefore,
$Q\subseteq(J(f):\widetilde{J(f)})$ and hence $(J(f):\widetilde{J(f)})=Q$.
Note that the ideal $J(f)$ is $\mathfrak{m}$-primary if and only if
$J(f):\mathfrak{m}^{\infty}=R$.

  3. (3)

If $J(f)$ is not $\mathfrak{m}$-primary, then one can use the isomorphism in
(7) to compute the Milnor number of $f$. However, computing ‘saturation’ is
time-consuming. Besides, the Macaulay2 commands for working in a local ring
are not fully developed. So we decided not to use either of these in the
function secMilnorNumbers and restricted ourselves to the case when $J(f)$ is
$\mathfrak{m}$-primary. This assumption forces
$\mathrm{Sing}(f)=\\{\mbox{origin}\\}$, as the ideal $(f,J(f))$ is also
$\mathfrak{m}$-primary. Nevertheless, users can use the succeeding commands to
compute the Milnor number of $f$ directly, whether $J(f)$ is
$\mathfrak{m}$-primary or not. We take
$f=x^{2}+y^{2}+z^{2}+xyz\in{\mathbb{Q}}[x,y,z]$. By [18, Example 2.4], the
Milnor number of $f$ is $1$. Notice $(f,J(f))$ is an $\mathfrak{m}$-primary
ideal.

        Ψi1 : R = QQ[x,y,z];
    Ψi2 : f = x^2+y^2+z^2+x*y*z;
    Ψi3 : J = ideal jacobian f;
    Ψi4 : m= ideal vars R;
    Ψi5 : J1= saturate(J, m);
    Ψi6 : J1 == sub(ideal 1, R)
    Ψo6 : false
    Ψi7 : I= ideal f + J;
    Ψi8 : saturate(I, m) == sub(ideal 1, R)
    Ψo8 : true
    Ψi9 : J2 = J : J1;
    Ψi10 : degree J2
    Ψo10 : 1
    Ψ-- the Milnor number of f
    Ψ

Let $h$ be a non-constant homogeneous polynomial in
$\mathbb{C}[z_{0},\ldots,z_{n}]$ and let $\Delta_{h}\subseteq\mathbb{R}^{n}$
be the convex hull of exponents of dehomogenized monomials in
$\mathbb{C}[z_{1},\ldots,z_{n}]$ appearing in one of the partial derivatives
of $h.$ Note that such $h$ need not have an isolated singularity at the
origin. We set $\mathfrak{m}=(z_{0},\ldots,z_{n})$. In [13], June Huh extended
the notion of sectional Milnor numbers and defined a sequence
$\\{\mu^{i}(h)\\}_{i=0}^{n}$ by setting $\mu^{i}(h)=e_{i}(\mathfrak{m},J(h))$
for $i=0,\ldots,n$. We want to remark that once can compute $\mu^{i}(h)$ using
the command mixedMultiplicity. Huh compared $\mu^{i}(h)$ with the mixed volume
of standard $n$-dimensional simplex $\Delta$ and $\Delta_{h}$ in
$\mathbb{R}^{n}.$

######  Theorem 6.3 ([13, Theorem 15]).

Suppose that $h$ is a non-constant homogeneous polynomial in
$\mathbb{C}[z_{0},\ldots,z_{n}]$. For $i=0,\ldots,n$, we have

$\mu^{(i)}(h)\leq
MV_{n}(\underbrace{\Delta,\ldots,\Delta}_{n-i},\underbrace{\Delta_{h},\ldots,\Delta_{h}}_{i}).$

We use our algorithms to verify the above result through examples.

######  Example 6.4.

Let
$h=z_{0}^{3}+z_{1}^{3}+z_{2}^{3}+z_{0}z_{1}z_{2}\in\mathbb{Q}[z_{0},z_{1},z_{2}]$.
Then the Jacobian ideal $J(h)=(h_{z_{0}},h_{z_{1}},h_{z_{2}})$ is
$(3z_{0}^{2}+z_{1}z_{2},3z_{1}^{2}+z_{0}z_{2},3z_{2}^{2}+z_{0}z_{1})$. We set
$\mathfrak{m}=(z_{0},z_{1},z_{3})$. Using Macaulay2, we verify that
$\operatorname{ht}J(h)=3$. This ensures that $J(h)$ is an
$\mathfrak{m}$-primary ideal, since $J(h)$ is homogeneous. Consequently, $h$
has an isolated singularity at the origin. Notice that the vertices of
$\Delta_{h}$ are $\\{(0,0),(1,1),(2,0),(0,1),(1,0),(0,2)\\}$. The following
session in Macaulay2 supports Theorem 6.3. In fact, we get equality for all
$i$.

    ΨΨΨi1 : R = QQ[z_0..z_2];
    ΨΨΨi2 : h = z_0^3+z_1^3+z_2^3+z_0*z_1*z_2;
    ΨΨΨi3 : J = ideal jacobian ideal h;
    ΨΨΨi4 : codim J
    ΨΨΨo4 : 3
    ΨΨΨi5 : I = homIdealPolytope
    ΨΨΨ    {(0,0),(1,1),(2,0),(0,1),(1,0),(0,2)};
    ΨΨΨi6 : W = ring I;
    ΨΨΨi7 : n = ideal vars W;
    ΨΨΨi8 : mMixedVolume {n,n}
    ΨΨΨo8 : 1
    ΨΨΨi9 : mMixedVolume {n,I}
    ΨΨΨo9 : 2
    ΨΨΨi10 : mMixedVolume {I,I}
    ΨΨΨo10 : 4
    ΨΨΨi11 : secMilnorNumbers(h)
    ΨΨΨo11 : HashTable{0=>1, 1=>2, 2=>4, 3=>8}
    ΨΨ

In [13, Example 17], J. Huh produced an example of a polynomial $h$ which
gives a strict inequality for some $i$. Although, this $h$ does not have
isolated singularity at the origin. The following Macaulay2 session verifies
the example.

    ΨΨΨi1 : R = QQ[z_0..z_2];
    ΨΨΨi2 : h = z_1*(z_0*z_1 - z_2^2);
    ΨΨΨi3 : J = ideal jacobian ideal h;
    ΨΨΨi4 : codim J
    ΨΨΨo4 : 2
    ΨΨΨi5 : m = ideal vars R;ΨΨ
    ΨΨΨi6 : mixedMultiplicity ((m,J),(2,0))
    ΨΨΨo6 : 1
    ΨΨΨi7 : mixedMultiplicity ((m,J),(1,1))
    ΨΨΨo7 : 2
    ΨΨΨi8 : mixedMultiplicity ((m,J),(0,2))
    ΨΨΨo8 : 1
    ΨΨΨi9 : I = homIdealPolytope
    ΨΨΨ         {(2,0),(1,0),(0,2),(1,1)};
    ΨΨΨi10 : W = ring I;
    ΨΨΨi11 : n = ideal vars W;
    ΨΨΨi12 : mMixedVolume {n,n}
    ΨΨΨo12 : 1
    ΨΨΨi13 : mMixedVolume {n,I}
    ΨΨΨo13 : 2
    ΨΨΨi14 : mMixedVolume {I,I}
    ΨΨΨo14 : 2
    ΨΨ

Note that for $i=2$, we are getting the inequality $1<2$ as it was claimed by
Huh. One can also consider the homogeneous polynomial
$h=z_{0}^{2}z_{1}+z_{0}^{2}z_{2}+z_{1}^{2}z_{2}+z_{1}z_{2}^{2}\in\mathbb{Q}[z_{0},z_{1},z_{2}]$.
Running a similar session as above, we get that $\mu^{(2)}(h)=2$ whereas
$MV_{2}(\Delta_{h},\Delta_{h})=4.$

###  6.1. Verifying example of Joël Briançon and Jean-Paul Speder

We first recall Teissier’s conjecture which claims that the invariance of
Milnor number implies invariance of sectional Milnor numbers.

Teissier’s Conjecture. [22] If $(X,x)$ and $(Y,y)$ have same topological type,
then

$\mu^{*}(X,x)=\mu^{*}(Y,y).$

In [3], Joël Briançon and Jean-Paul Speder disproved the conjecture by giving
a counter-example. They considered the family of hypersurfaces ${\bf
X}_{t}\in\mathbb{C}^{3}$ defined by

$F_{t}(x,y,z)=z^{5}+ty^{6}z+xy^{7}+x^{15}=0.$

This family ${\bf X}_{t}$ provides a counter example to Teissier’s conjecture.
We verify the example by using Teissier’s observation of identifying the
sectional Milnor numbers with mixed multiplicities of ideals.

Consider the ideals $\mathfrak{m}=(x,y,z)$ and $J(F_{t})=(\partial
F_{t}/\partial x,\partial F_{t}/\partial y,\partial F_{t}/\partial z)$ in
$\mathbb{C}[x,y,z]$, where

$\frac{\partial F_{t}}{\partial x}=y^{7}+15x^{14},\quad\frac{\partial
F_{t}}{\partial y}=6ty^{5}z+7xy^{6}\quad\text{ and }\quad\frac{\partial
F_{t}}{\partial z}=5z^{4}+ty^{6}.$

We show that while $e(J(F_{t}))$ in independent of $t$,
$e_{2}(\mathfrak{m}\mid J(F_{t}))$ depends on $t$. Recall that

$e_{3}(\mathfrak{m}\mid
J(F_{t}))=e(J(F_{t}))=\ell\left(\frac{\mathbb{C}[x,y,z]}{J(F_{t})}\right).$

Let $t=0.$ Since $J(F_{0})$ is generated by a system of parameters,

$\displaystyle e(J(F_{0}))=e(y^{7}+15x^{14},xy^{6},z^{4})$
$\displaystyle=4e(y^{7}+15x^{14},xy^{6},z)$
$\displaystyle=4e(y^{7}+15x^{14},x,z)+4e(y^{7}+15x^{14},y^{6},z)$
$\displaystyle=28+24e(x^{14},y,z)=28+336=364.$

Here, we use a fact that in a Cohen-Macaulay ring, if $(a,b,c)$ and $(a,b,d)$
are ideals generated by system of parameters such that $c$ and $d$ are co-
prime and $a,b,cd$ is a system of parameter, then
$e(a,b,cd)=e(a,b,c)+e(a,b,d).$ Now let $t\neq 0$. Using the above observation
and [19, Theorem 14.11], we get

$\displaystyle e(J(F_{t}))$
$\displaystyle=e(y^{7}+15x^{14},y^{5}(6tz+7xy),5z^{4}+ty^{6})$
$\displaystyle=5e(y^{7}+15x^{14},y,5z^{4}+ty^{6})+e(y^{7}+15x^{14},6tz+7xy,5z^{4}+ty^{6})$
$\displaystyle=5e(x^{14},y,z^{4})+e(y^{7}+15x^{14},5x^{4}y^{4}\alpha^{4}+ty^{6})\quad(\text{by
putting $z=xy\alpha$ where $\alpha=-\frac{7}{6t}$})$
$\displaystyle=280+e(y^{7}+15x^{14},y^{4}(5x^{4}\alpha^{4}+ty^{2}))$
$\displaystyle=280+4e(y^{7}+15x^{14},y)+e(y^{7}+15x^{14},5(\alpha
x)^{4}+ty^{2})$
$\displaystyle=280+56+e(y^{7}+15x^{14},\sqrt{5}\alpha^{2}x^{2}+i\sqrt{t}y)+e(y^{7}+15x^{14},\sqrt{5}\alpha^{2}x^{2}-i\sqrt{t}y)$
$\displaystyle=336+14+14=364.$

Hence $e(J(F_{t}))=364$ and is independent of $t$. We now calculate
$e_{2}(\mathfrak{m}\mid J(F_{t}))$.

In order to calculate $e_{2}(\mathfrak{m}\mid J(F_{t})),$ we find a joint
reduction of $(\mathfrak{m},J(F_{t}),J(F_{t})).$ Let $t=0.$ Consider the set
of elements $\\{x,\partial F_{0}/\partial x,\partial F_{0}/\partial z\\}.$
Using Macaulay2, we could check that

$\mathfrak{m}^{10}J^{2}=(x)\mathfrak{m}^{9}J^{2}+(\partial F_{0}/\partial
x,\partial F_{0}/\partial z)\mathfrak{m}^{10}J$

in $\mathbb{Q}[x,y,z].$ This implies $\\{x,\partial F_{0}/\partial x,\partial
F_{0}/\partial z\\}$ is a joint reduction of
$(\mathfrak{m},J(F_{0}),J(F_{0}))$ and hence

$e_{2}(\mathfrak{m}\mid J(F_{0}))=e(x,\partial F_{0}/\partial x,\partial
F_{0}/\partial z)=e(x,y^{7}+15x^{14},z^{4})=e(x,y^{7},z^{4})=28.$

If $t\neq 0,$ we consider the set of elements $\\{x,\partial F_{t}/\partial
y,\partial F_{t}/\partial z\\}.$ Using Macaulay2, we could check that

$\mathfrak{m}^{11}J^{2}=(x)\mathfrak{m}^{10}J^{2}+(\partial F_{t}/\partial
y,\partial F_{t}/\partial z)\mathfrak{m}^{11}J$

in the ring $\mathbb{Q}(t)[x,y,z].$ So $\\{x,\partial F_{t}/\partial
y,\partial F_{t}/\partial z\\}$ is a joint reduction of
$(\mathfrak{m},J(F_{t}),J(F_{t}))$ and hence

$\displaystyle e_{2}(\mathfrak{m}\mid J(F_{t}))=e(x,\partial F_{t}/\partial
y,\partial F_{t}/\partial z)$
$\displaystyle=e(x,6ty^{5}z+7xy^{6},5z^{4}+ty^{6})$
$\displaystyle=e(x,y^{5}z,5z^{4}+ty^{6})$
$\displaystyle=e(x,y^{5},z^{4})+e(x,z,y^{6})=20+6=26.$

This proves that the mixed multiplicities are dependent on $t$, verifying the
example given by Briançon and Speder. The following displays the working in
Macaulay2.

    ΨΨi1 : k = frac(QQ[t]);
    ΨΨi2 : R = k[x,y,z];
    ΨΨi3 : f = z^5 + t*y^6*z + x*y^7 + x^15;
    ΨΨi4 : secMilnorNumbers (f)
    ΨΨo4 = HashTable{0=> 1, 1=> 4, 2=> 26, 3=> 364}
    ΨΨi5 : g = z^5 + x*y^7 + x^15;
    ΨΨi6 : secMilnorNumbers (g)
    ΨΨo6 = HashTable{0=> 1, 1=> 4, 2=> 28, 3=> 364}
    ΨΨ

## References

  * [1] Michael F. Atiyah and Ian G. MacDonald.  Introduction To Commutative Algebra.  Addison-Wesley series in mathematics. Avalon Publishing, 1994.
  * [2] Gennadiy Averkov, Christopher Borger, and Ivan Soprunov.  Classification of triples of lattice polytopes with a given mixed volume.  Discrete & Computational Geometry, 66:165–202, 2021.
  * [3] Joël Briançon and Jean-Paul Speder.  La trivialité topologique n’implique pas les conditions de Whitney.  C. R. Acad. Sci. Paris Sér. A-B, 280(6):Aiii, A365–A367, 1975\.
  * [4] Tianran Chen.  Unmixing the mixed volume computation.  Discrete & Computational Geometry, 62:55–86, 2019.
  * [5] David A. Cox, Kuei-Nuan Lin, and Gabriel Sosa.  Multi-Rees algebras and toric dynamical systems.  Proc. Amer. Math. Soc., 147(11):4605–4616, 2019.
  * [6] David A. Cox, John Little, and Donal O’Shea.  Using algebraic geometry, volume 185 of Graduate Texts in Mathematics.  Springer, New York, second edition, 2005.
  * [7] Clare D’Cruz.  A formula for the multiplicity of the multi-graded extended Rees algebra.  Commun. Algebra, 31(6):2573–2585, 2003.
  * [8] David Eisenbud, Daniel R Grayson, Mike Stillman, and Bernd Sturmfels.  Computations in algebraic geometry with Macaulay 2, volume 8.  Springer Science & Business Media, 2001.
  * [9] Kriti Goel, Vivek Mukundan, Sudeshna Roy, and Jugal K. Verma.  Algorithms for computing mixed multiplicities, mixed volumes and sectional milnor numbers.  To appear in the Journal of Software for Algebra and Geometry, 2023.  arXiv preprint: arXiv:1902.07384.
  * [10] Daniel R. Grayson and Michael E. Stillman.  Macaulay2, a software system for research in algebraic geometry.  Available at http://www.math.uiuc.edu/Macaulay2/.
  * [11] Christian Haase, Martina Juhnke-Kubitzke, Raman Sanyal, and Thorsten Theobald.  Mixed Ehrhart polynomials.  Electron. J. Combin., 24(1):Paper No. 1.10, 14, 2017.
  * [12] Manfred Herrmann, Eero Hyry, Jürgen Ribbe, and Zhongming Tang.  Reduction numbers and multiplicities of multigraded structures.  J. Algebra, 197(2):311–341, 1997.
  * [13] June Huh.  Milnor numbers of projective hypersurfaces and the chromatic polynomial of graphs.  J. Amer. Math. Soc., 25(3):907–927, 2012.
  * [14] Craig Huneke and Irena Swanson.  Integral closure of ideals, rings, and modules, volume 336 of London Mathematical Society Lecture Note Series.  Cambridge University Press, Cambridge, 2006.
  * [15] Babak Jabarnejad.  Equations defining the multi-Rees algebras of powers of an ideal.  J. Pure Appl. Algebra, 222(7):1906–1910, 2018.
  * [16] Daniel Katz and Jugal K. Verma.  Extended Rees algebras and mixed multiplicities.  Math. Z., 202(1):111–128, 1989.
  * [17] Kuei-Nuan Lin and Claudia Polini.  Rees algebras of truncations of complete intersections.  J. Algebra, 410:36–52, 2014.
  * [18] Yongqiang Liu.  Milnor and tjurina numbers for a hypersurface germ with isolated singularity.  Comptes Rendus Mathematique, 356(9):963–966, 2018.
  * [19] Hideyuki Matsumura.  Commutative ring theory, volume 8 of Cambridge Studies in Advanced Mathematics.  Cambridge University Press, Cambridge, second edition, 1989.  Translated from the Japanese by M. Reid.
  * [20] Jürgen Ribbe.  On the defining equations of multi-graded rings.  Comm. Algebra, 27(3):1393–1402, 1999.
  * [21] Gabriel Sosa.  On the Koszulness of multi-Rees algebras of certain strongly stable ideals.  2014\.  arXiv preprint: arXiv:1406.2188v1.
  * [22] Bernard Teissier.  Cycles évanescents, sections planes et conditions de Whitney.  In Singularités à Cargèse (Rencontre Singularités Géom. Anal., Inst. Études Sci., Cargèse, 1972), pages 285–362. Astérisque, Nos. 7 et 8. Soc. Math. France, Paris, 1973.
  * [23] Ngo Viet Trung and Jugal K. Verma.  Mixed multiplicities of ideals versus mixed volumes of polytopes.  Trans. Amer. Math. Soc., 359(10):4711–4727, 2007.
  * [24] Jugal K. Verma.  Multigraded Rees algebras and mixed multiplicities.  Journal of Pure and Applied Algebra, 77(2):219 – 228, 1992.
  * [25] Jugal K. Verma, Daniel Katz, and Satya Mandal.  Hilbert functions of bigraded algebras.  In Commutative algebra (Trieste, 1992), pages 291–302. World Sci. Publ., River Edge, NJ, 1994.