# Computing the non-properness set of real polynomial maps in the plane

Boulos El Hilany, Elias Tsigaridas

► To cite this version:

Boulos El Hilany, Elias Tsigaridas. Computing the non-properness set of real polynomial maps in the plane. Vietnam Journal of Mathematics, 2023, 10.1007/s10013-023-00652-0. http://dx.doi.org/10.1007/s10013-023-00457-8

HAL Id: hal-04223513

https://hal.science/hal-04223513v1

Submitted on 29 Sep 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Computing the non-properness set of real polynomial maps in the plane*

Boulos EL HILANY†

Elias TSIGARIDAS‡

## Abstract

We introduce novel mathematical and computational tools to develop a complete algorithm for computing the set of non-properness of polynomials maps in the plane. In particular, this set, which we call the *Jelonek set*, is a subset of $K^2$ where a dominant polynomial map $f: K^2 \to K^2$ is not proper; $K$ could be either $\mathbb{C}$ or $\mathbb{R}$. Unlike all the previously known approaches we make no assumptions on $f$ whenever $K = \mathbb{R}$; this is the first algorithm with this property.

The algorithm takes into account the Newton polytopes of the polynomials. As a byproduct we provide a finer representation of the set of non-properness as a union of semi-algebraic curves, that correspond to edges of the Newton polytopes, which is of independent interest. Finally, we present a precise Boolean complexity analysis of the algorithm and a prototype implementation in MAPLE.

<footnote>*MSC: 14R25, 26C05 (Primary), 12D10, 14P10, 52B20 (Secondary). Keywords: Real polynomial maps, Set of non-properness, Maps on the plane, Newton polytopes, Boolean complexity.</footnote>

<footnote>†Institut für Analysis und Algebra, TU Braunschweig, Germany (email:boulos.hilani@gmail.com, b.el-hilany@tu-braunschweig.de)</footnote>

<footnote>‡Inria Paris and Institut de Mathématiques de Jussieu-Paris Rive Gauche, Sorbonne Université and Paris Université, France (email:elias.tsigaridas@inria.fr)</footnote>
# Contents

<table><tr><td>1</td><td>Introduction</td><td>3</td></tr><tr><td>1.1</td><td>Our contribution</td><td>3</td></tr><tr><td>1.2</td><td>An example</td><td>5</td></tr><tr><td>1.3</td><td>Related work</td><td>6</td></tr><tr><td>1.4</td><td>Notation</td><td>6</td></tr><tr><td>1.5</td><td>Organization of the paper</td><td>7</td></tr><tr><td>2</td><td>Complexity of known methods</td><td>7</td></tr><tr><td>3</td><td>Preliminaries</td><td>8</td></tr><tr><td>3.1</td><td>Polytopes, Minkowski sums, and mixed volume</td><td>9</td></tr><tr><td>3.1.1</td><td>Mixed volume</td><td>9</td></tr><tr><td>3.1.2</td><td>Characterization of the faces</td><td>9</td></tr><tr><td>3.2</td><td>Polynomials restricted to faces</td><td>10</td></tr><tr><td>4</td><td>Decomposing the Jelonek set</td><td>11</td></tr><tr><td>4.1</td><td>Toric change of variables using edges</td><td>11</td></tr><tr><td>4.2</td><td>The topological and algebraic multiplicity sets of f</td><td>12</td></tr><tr><td>4.3</td><td>The Jelonek set as a union of multiplicity sets</td><td>14</td></tr><tr><td>4.3.1</td><td>The T-multiplicity sets in C</td><td>16</td></tr><tr><td>4.3.2</td><td>The T-multiplicity sets in R</td><td>18</td></tr><tr><td>5</td><td>Strategy for computing the Jelonek set</td><td>20</td></tr><tr><td>5.1</td><td>Characterizing the edges</td><td>21</td></tr><tr><td>5.2</td><td>Computing the multiplicity sets</td><td>21</td></tr><tr><td>5.3</td><td>Complexity and representation of the output</td><td>22</td></tr><tr><td>5.4</td><td>An example</td><td>23</td></tr><tr><td>6</td><td>Computing the multiplicity sets</td><td>23</td></tr><tr><td>6.1</td><td>Resultant computations for the multiplicity set</td><td>24</td></tr><tr><td>6.1.1</td><td>The complexity of the complex T-multiplicity set</td><td>24</td></tr><tr><td>6.1.2</td><td>Testing the emptiness of T<sub>R</sub>(Γ) and its complexity</td><td>25</td></tr><tr><td>7</td><td>Implementation</td><td>29</td></tr></table>
# 1 Introduction

Let $f = (f_1, \dots, f_n) : \mathbb{K}^n \to \mathbb{K}^n$ be a polynomial map, where $\mathbb{K} \in \{\mathbb{C}, \mathbb{R}\}$. We say that $f$ is non-
proper at a point $y \in \mathbb{K}^n$ if for any neighborhood $\mathcal{O}$ of $y$, the preimage $f^{-1}(\bar{\mathcal{O}})$ is not compact,
where $\bar{\mathcal{O}}$ is the Euclidean closure of $\mathcal{O}$. Namely, at the set $\mathcal{J}_f \subset \mathbb{K}^n$ of points $y$ at which $f$ is
non-proper, there exists a sequence $\{x_k\}_{k \in \mathbb{N}} \subset \mathbb{K}^n$ such that $\|x_k\| \to \infty$ and $f(x_k) \to y$. We call
$\mathcal{J}_f$ the *Jelonek set* of $f$.

Jelonek first studied [19] the non-properness of maps $\mathbb{C}^n \to \mathbb{C}^n$ for the purpose of pushing
forward the state-of-the-art results around the Jacobian conjecture [44]. In this context, if the
Jacobian matrix of such a map $f$ is everywhere non-singular, then the invertibility of $f$ becomes
equivalent to emptiness of its Jelonek set. To this end, substantial work has been directed towards
the study of this set [20, 22, 25], which led to solving many problems regarding the topology of
polynomial maps [16, 20, 23, 26].

Besides the Jacobian conjecture, the description of the Jelonek set is essential to compute the
atypical values of a polynomial function $\mathbb{C}^n \to \mathbb{C}$ [23, 26], for classifying the algebraic subsets
of $\mathbb{R}^n$ that are images of $\mathbb{R}^n$ under a polynomial morphism [16], and for characterizing the
set of fixed points under a polynomial morphism [24]. As for applications to real-life problems,
polynomial maps appear as models in algebraic statistics [33], robotics [36], computer vision [13],
and chemical reaction networks [11]; to mention few of them. For such a setting, the input of
the problem is a point in the target space, while the output is a point in the preimage. Then,
the Jelonek set represents some of those inputs that result in a sub-optimal output.

There is no shortage of effective algorithms for computing exactly the Jelonek set of some
polynomial maps, even in more general settings [19, 20, 37, 43]. Unfortunately, they are not
universal; for example, in some cases [19, 21, 37] one requires $\mathbb{K}$ to be an algebraically closed
field, while in other cases, these methods require the maps to be finite [43]. In addition, to
our knowledge, there are no precise bit complexity estimates for the various algorithms. Even
more, the known algorithms rely on black box elimination techniques based on Gröbner basis
computations and they do not take into account the structure and the Newton polytopes of the
input. When $\mathbb{K} = \mathbb{R}$, the situation is more dire; even though the geometry of the Jelonek set
is fairly well understood [19, 22, 25, 43], to our knowledge, there are no dedicated algorithms
to compute it. Up until now, we had to rely on algorithms that assume $\mathbb{K} = \mathbb{C}$ and compute a
superset of the (real) Jelonek set.

## 1.1 Our contribution

We consider a *dominant* polynomial map $f = (f_1, f_2) : \mathbb{K}^2 \to \mathbb{K}^2$, where $\mathbb{K} \in \{\mathbb{C}, \mathbb{R}\}$, i.e.,
$f(\mathbb{K}^2) = \mathbb{K}^2$. We present a complete and efficient algorithm to compute the Jelonek set of $f$,
SPARSEJELONEK-2 (Alg. 3), along with its mathematical foundations, complexity analysis, and
a prototype implementation.

The algorithm makes no assumptions on the input polynomials $f$. It outputs a partition of
the (equations of the) Jelonek set to subsets of semi-algebraic (or algebraic) curves of smaller
degree; hence it provides a more accurate and detailed picture of the topology and the geometry
of the Jelonek set, from the one known before. It depends on their Newton polytopes; the
latter encode the non-zero terms of the polynomials, see Sec. 3.1.1 for the definition and various
properties. This feature provides us with tools from combinatorial and toric geometry, and makes
the algorithm input and output sensitive. We present a precise bit complexity analysis of the
algorithm when the input consists of polynomials with rational coefficients, and a (prototype)
implementation in MAPLE. To our knowledge this is the first dedicated algorithm for computing
the Jelonek set when $\mathbb{K} = \mathbb{R}$ in the plane, under no assumptions.
An important aspect of our approach is the partition of the Jelonek set into sets of irreducible (semi-)algebraic curves. The equations of the curves in each partition set are obtained by analyzing the coefficients of $f$ restricted at some distinguished edge $\Gamma$ of the polygon NP($f$); the latter is the Minkowski sum of the Newton polytopes of $f_1$ and $f_2$, NP($f_1$) and NP($f_2$), respectively. As distinguished edges, we consider the ones that their corresponding inner normal vector has at least one negative coordinate; we call them *infinity edges* (Definition 3.1).

Consider $q$ to be a generic point of the Jelonek set of $f$, i.e., $q \in \mathcal{J}_f$, and $y$ sufficiently close to $q$. By definition of $\mathcal{J}_f$, there is an isolated point $x \in f^{-1}(y)$ whose Euclidean norm takes arbitrary large values. One thus can construct a change of variables that sends $x = (x_1, x_2)$ to $(z^{M_1}, z^{M_2}) = (z_1^{M_{11}}z_2^{M_{12}}, z_1^{M_{21}}z_2^{M_{22}})$, where $M_{ij} \in \mathbb{Z}$, so that, in the new variables, the (transformed) preimage is arbitrary close to one of the coordinate axes of $\mathbb{K}^2$. This suitable change of variables depends on an edge of the Newton polytope of $f$ in the following way: the inverse $U$ of the matrix $M := (M_1, M_2) \in \mathbb{Z}^{2\times 2}$ is such that its first row spans an edge of NP($f$) (Section 4.1). Accordingly, after the change of variables, the new polynomial system $f(x)-y=0$ is written as $\bar{U}(f-y)(z) = 0$.

The *topological face multiplicity set* corresponding to the face $\Gamma$, or $\mathbf{T}$-multiplicity set for short, collects all points $q$, for which any $y$ sufficiently close to $q$, gives rise to a solution $z$ to the system $\bar{U}(f-y) = 0$ satisfying $\|z - (\rho, 0)\| \to 0$ for some $\rho \in \mathbb{K}^*$.

We denote it by $\mathbf{TF}_{\mathbb{K}}(\Gamma)$ (Definition 4.5). Going over all the infinity edges of its Newton polytope NP($f$), we obtain the $\mathbf{T}$-multiplicity set of $f$, and through it the Jelonek set of $f$. The following theorem summarizes these properties; it appears in Thm. 4.15 along with its proof.

**Theorem (The Jelonek set as a union of T-multiplicity sets).** Let $f: \mathbb{K}^2 \to \mathbb{K}^2$ be a dominant polynomial map, where $\mathbb{K} \in \{\mathbb{C}, \mathbb{R}\}$. Then, the Jelonek set of $f$ is the union, over all the edges of its Newton polytope NP($f$) intersecting $(\mathbb{R}^*)^2$, of its T-multiplicity sets.

To compute the $\mathbf{T}$-multiplicity sets we note that, as $\|y-q\| \to 0$, if a solution $z(y) \in \mathbb{K}^2$ to any (parametrized by $y$) polynomial system $F_y = 0$ converges to a point $z(q)$, then the multiplicity of $z(q)$ (as a solution of $F_y = 0$) should usually be higher for $y=q$ than for most other values of $y$.

This observation demonstrates that we can detect points in $\mathbf{T}$-multiplicity sets by capturing the change in the multiplicity of some solutions of the transformed system. The set of all such $q \in \mathbb{K}^2$ that increase the multiplicity of a solution to $F_y = 0$, is called the *algebraic face multiplicity set* corresponding to $\Gamma$, or $\mathbf{A}$-multiplicity for short, and we denote it by $\mathbf{AF}_{\mathbb{K}}(\Gamma)$ (Definition 4.10). We develop an algorithm, *MS_RESULTANT*, to compute the $\mathbf{T}$-multiplicity set using the $\mathbf{A}$-multiplicity set by employing tools from elimination theory. The following theorem supports *MS_RESULTANT*; it appears in Prop. 6.1 along with its proof.

**Theorem (MS_RESULTANT and computation of the T-multiplicity sets).** Let $f: \mathbb{K}^2 \to \mathbb{K}^2$ be a dominant polynomial map, where $\mathbb{K} \in \{\mathbb{C}, \mathbb{R}\}$. Then, for any edge $\Gamma$ of NP($f$), *MS_RESULTANT* (*Alg. 4*), correctly computes the T-multiplicity set.

*MS_RESULTANT* relies on resultant computations and exploits the property that the multiplicity of a root of the resultant accumulates the multiplicities of the solutions of the system in the corresponding fiber. It is the best choice for maps that are quite degenerate and it has polynomial worst case complexity. *MS_RESULTANT* is straightforward for complex polynomial maps. For polynomial maps $f: \mathbb{R}^2 \to \mathbb{R}^2$, however, we need to perform a more refined analysis. Namely, let $g := \mathbb{C}f: \mathbb{C}^2 \to \mathbb{C}^2$ denote the complexification of $f$, and let $\mathcal{D}_g$ be its *discriminant*. This is the image, under $g$, of the critical points in $\mathbb{C}^2$ of $g$. For each edge $\Gamma \prec \text{NP}(g)$ we consider the decomposition of $\mathbf{AF}_{\mathbb{C}}(\Gamma) \cap \mathbb{R}^2$ into a collection $\mathcal{C}$ of smooth disjoint segments $C_1, \dots, C_r$, separated by isolated points from $\mathcal{D}_g \cap \mathbf{AF}_{\mathbb{C}}(\Gamma)$ and singular points of $\mathbf{AF}_{\mathbb{C}}(\Gamma)$. That
is, these points are boundary points of the curve segments and $\mathcal{J}_f$ is the Euclidean closure of the disjoint union $C_1 \cup \cdots \cup C_r$. We show in §4 that each segment $C \in \mathcal{C}$ either lies entirely in the T-multiplicity set of $f$, or it is disjoint from it. Then, once the A-multiplicity set of the complex map $g$ is computed, determining which of its segments $C \in \mathcal{C}$ is a part of the T-multiplicity set of $f$ reduces to picking a random point in $C$, and counting the number of its real preimages under $f$. One has to make sure that this sampling procedure avoids other A-multiplicity sets. We describe this in §6. Note that, thanks to our first theorem above, this approach holds true if we replace the A-multiplicity set by $\mathcal{J}_g$ and the T-multiplicity set by $\mathcal{J}_f$.

The complexity bound of MS_RESULTANT for maps $\mathbb{R}^2 \to \mathbb{R}^2$ (Thm. 6.5) is much higher than the one in the complex case (Thm. 6.5). However, this worst case bound is attained only for very particular polynomial maps.

Using the previous tools, a straightforward method to compute the Jelonek set is as follows: For all edges $\Gamma$ of NP($f$) compute the corresponding T-multiplicity set. This is the backbone of the proof of correctness of algorithm SPARSEJELONEK-2.

**Theorem (Computation of the Jelonek set).** Let $f: \mathbb{K}^2 \to \mathbb{K}^2$ be a dominant polynomial map, where $\mathbb{K} = \{\mathbb{C}, \mathbb{R}\}$. Then, SPARSEJELONEK-2 (Alg. 3) computes correctly the Jelonek set of $f$.

Unlike previously known methods for computing $\mathcal{J}_f$, SPARSEJELONEK-2 depends on the Newton polytope of $f$. Consequently, for maps that are mildly degenerate with respect to their Newton polytopes, our methods outperforms standard algorithms for complex maps (cf. Thm. 2.5 and Cor. 5.2.)

As a byproduct of our methods for describing the Jelonek set, we obtain in Thm. 4.22 of §4 a partial characterization of real polynomial maps whose Jelonek set is a union of algebraic curves in $\mathbb{R}^2$. Consequently (Corollary 4.23), we show that the Jelonek set of real maps, with a birational complexification, is algebraic.

## 1.2 An example

The following example illustrates our first main Theorem that relates the Jelonek set to T-multiplicity sets. Let $f: \mathbb{K}^2 \to \mathbb{K}^2$ be the following polynomial map

$$f(x) = 0 \Leftrightarrow \left\{ \begin{array}{l} 1 + 2x_1x_2 - x_1^2x_2^3 = 0 \\ 5 + 12x_1x_2 - 10x_1^2x_2^3 + 2x_1^3x_2^5 = 0 \end{array} \right\}. \qquad (1)$$

The corresponding Newton polytopes and their Minkowski sum are in Figure 1. The preimage of $y$ is such that $x_1 x_2 = \frac{2(y_1-1)^2}{(-2y_1+y_2-3)}$. Thus, the norm of $x$ takes arbitrary large values if $y$ converges to, say, $(-2, -1)$.

To transform the polynomials in (1) we consider the edge $\Gamma$ (in the Minkowski sum) with outer normal $(2, -1)$ and defined by the vertices $(2, 2)$ and $(5, 8)$; see the rightmost polygon in Figure 1. The corresponding toric transformation has matrix $U = \begin{pmatrix} -1 & 1 \\ -2 & 1 \end{pmatrix}$ and it transforms the system $f_1(x_1, x_2) - y_1 = f_2(x_1, x_2) - y_2 = 0$ (up to a monomial multiplication) to

$$\left\{ \begin{array}{l} 2 - z_1 - z_2(1 - y_1) = 0 \\ 12 - 10z_1 + 2z_1^2 - z_2(5 - y_2) = 0 \end{array} \right\}. \qquad (2)$$

The new system has two simple solutions $(2, 0)$ and $\sigma := \left( \frac{6y_1 - y_2 - 1}{2(y_1 - 1)}, \frac{y_2 - 2y_1 - 3}{2(y_1 - 1)^2} \right)$. Notice that if $(y_1, y_2) \to (-2, -1)$, then the second coordinate of $\sigma$ goes to 0. In particular, if $(y_1, y_2) \to (-2, -1)$, then $\sigma \to (2, 0)$. For our example it holds $\mathrm{TF}_{\mathbb{K}}(\Gamma) = \{(y_1, y_2) \in \mathbb{K}^2 | 2y_1 - y_2 - 3 = 0\}$;
<figure><img src="image_2.png" /><figcaption>Figure 1: Two Newton polytopes and their Minkowski sum. They correspond to the polynomials of the map in Eq. (2).</figcaption></figure>

which is a curve. In addition, following Eq. (2), the solution (2,0) is simple if $y_2 - 2y_1 - 3 \neq 0$. Indeed, the determinant of the Jacobian matrix of the system (2) evaluated at $z = (2,0)$ equals $| {}^{\begin{smallmatrix} -1 & -2 \\ 1-y_1 & 5-y_2 \end{smallmatrix} |$. This is the polynomial the zero set of which defines $\text{TF}_{\mathbb{K}}(\Gamma)$.

## 1.3 Related work

There are already works that exploit the structure of Newton polyhedra for the computation of topological data of polynomial maps. For polynomial functions this includes computing the Milnor number at the origin [29] and the bifurcation set [32, 46]. Whereas for maps, Newton polyhedra were used to compute the Łojasiewicz exponents [3], prove non-properness conditions [42], and compute the set of atypical values [7, 15]. In all these cases, there is the requirement of some form of face non-degeneracy condition on the corresponding maps. That is, the tuple of polynomials is required to be in a Zariski open set in the space of all polynomial maps with a given set of Newton polyhedra. Our approach does not need any such assumption whatsoever.

## 1.4 Notation

We denote by $\mathcal{O}$, resp. $\mathcal{O}_B$, the arithmetic, resp. bit, complexity and we use $\tilde{\mathcal{O}}$, respectively $\tilde{\mathcal{O}}_B$, to ignore (poly-)logarithmic factors.

For a polynomial $f \in \mathbb{Z}[x]$ or $f \in \mathbb{Z}[x_1, x_2]$ its infinity norm $\|f\|_{\infty}$ equals the maximum of absolute values of its coefficients. We denote by $\mathcal{L}(f)$ the logarithm of its infinity norm. We also call the latter the bitsize of the polynomial, that is a shortcut for the maximum bitsize of all its coefficients. A univariate polynomial is of size $(d, \tau)$ when its degree is at most $d$ and has bitsize $\tau$. We represent a real algebraic number $\alpha \in \mathbb{R}$ using the *isolating interval representation*; it includes a square-free polynomial, $A$, which vanishes at $\alpha$ and an interval with rational endpoints that contains $\alpha$ and no other root of $A$. If $\alpha \in \mathbb{C}$, then instead of an interval we use a rectangle in $\mathbb{R}^2$ where the coordinates of its vertices are rational numbers.

For a polynomial $f \in \mathbb{K}[x_1, x_2]$, where $\mathbb{K} \in \{\mathbb{R}, \mathbb{C}\}$, we denote its zero set by $\mathbb{V}_{\mathbb{K}}(f) \subset \mathbb{K}^2$ and $\mathbb{V}_{\mathbb{K}^*}(f) \subset (\mathbb{K}^*)^2$ is its zero set over the corresponding torus. We use the same notation if $f$ is a polynomial system, that is $f = (f_1, f_2)$.

We use the abbreviation $[n]$ for $\{1, 2, \dots, n\}$.
## 1.5 Organization of the paper

Sec. 2 gives the state of the art of the problem. We present the known methods for computing the Jelonek set for maps $\mathbb{C}^n \to \mathbb{C}^n$ (Algs. 1, and 2), and deduce their complexity in Thms. 2.4, and 2.5. In Sec. 3 we give the necessary notations to introduce the algorithm SPARSEJELONEK-2. This includes a classification of faces of NP($f$) and the introduction of the toric change of coordinates. The first half of Section 5 gives a detailed description of the functionality of SPARSEJELONEK-2, while in the second half we present its complexity analysis (Thm. 5.1) and a detailed example. Sections 4 and 6 concern the correctness of Algorithm SPARSEJELONEK-2; in particular we define T-multiplicity sets in terms of appropriate toric transformations introduced in Sec. 4.1. Then, we reformulate Thm. 1.1 as Thm. 4.15 and prove it. The proof of Thm. 1.1 is the proof of Prop. 6.1 in Sec. 6. Finally, Sec. 7 presents our prototype implementation.

## 2 Complexity of known methods

We start with a definition of the Jelonek set, see [19, 20].

**Definition 2.1 (Jelonek set).** Given two affine varieties, X and Y, and a map $F: X \to Y$, we say that $F$ is non-proper at a point $y \in Y$, if there is no neighborhood $U \subset Y$ of $y$, such that the preimage $F^{-1}(\bar{U})$ is compact, where $\bar{U}$ is the Euclidean closure of $U$. In other words, $F$ is non-proper at $y$ if there is a sequence of points $\{x_k\}_{k \in \mathbb{N}}$ in $X$ such that $\|x_k\| \to +\infty$ and $f(x_k) \to y$. The Jelonek set of $F$, $\mathcal{J}_F$, consists of all points $y \in Y$ at which $F$ is non-proper.

Jelonek proved [19, 22] that for a dominant polynomial map $f = (f_1, \dots, f_n) : \mathbb{K}^n \to \mathbb{K}^n$, $x := (x_1, \dots, x_n) \mapsto f(x)$, the set $\mathcal{J}_f$, if it is non-empty, then it is $\mathbb{K}$-uniruled. That is, for every point $y \in \mathcal{J}_f$, there exists a non-constant polynomial map $\varphi : \mathbb{K} \to \mathcal{J}_f$ such that $\varphi(0) = y$. Moreover, if $\mathbb{K} = \mathbb{C}$, then $\mathcal{J}_f$ is a hypersurface [19], while in the real case the dimension is less than or equal to $n-1$. These two properties are also valid for maps over algebraically closed fields [38] and when the domain, or the codomain, is an affine variety [25]. In this setting, there are methods for testing properness [20] and computing the Jelonek set [19, 37]. These is also an upper bound on the degree of $\mathcal{J}_f$ when $\mathbb{K} = \mathbb{C}$ [19], which is

$$ \frac{\prod_{i=1}^{n} \deg f_i - \mu(f)}{\min_{i=1, \dots, n} \deg f_i}, $$

where $\mu(f)$ is the number of points in a generic fiber of $f$ (cf. [19]).

Consider the maps $F_i : \mathbb{C}^n \to \mathbb{C}^n \times \mathbb{C}$, such that $F_i(x) := (f(x), x_i)$, for $i \in [n]$. Also let

$$ \sum_{k=0}^{N_i} A_k^i(f) x_i^{N_i-k} \in \mathbb{C}[f_1, \dots, f_n, x_i], $$

be the polynomial defining the equation of the hypersurface $F_i(\mathbb{C}^n) \subset \mathbb{C}^n \times \mathbb{C}$. Then, $A_0^i(f)$ is the $i$-th non-properness polynomial of $f$.

**Theorem 2.2 ([19, Prop. 7]).** The Jelonek set, $\mathcal{J}_f$, of a dominant polynomial map $f : \mathbb{C}^n \to \mathbb{C}^n$, is the zero locus of the polynomial $\prod_{i=1}^n A_0^i(y)$, where each $A_0^i$ is the $i$-th non-properness polynomial of $f$.

For the special case $n=2$, the following theorem holds:

**Theorem 2.3 ([21, Thm. 2.2]).** Consider a dominant polynomial map $f : \mathbb{C}^2 \to \mathbb{C}^2$, $(x_1, x_2) \mapsto f(x_1, x_2)$. Let $P_i(y_1, y_2, x_i) = \sum_{k=0}^{n_i} P_{ik}(y_1, y_2) x_i^{n_i-k}$ be the resultant of the polynomials $(f_1 - y_1, f_2 - y_2)$ with respect to $x_j$ for distinct $i, j \in \{1, 2\}$. Then, the Jelonek set of $f$ is $\{(y_1, y_2) \in \mathbb{C}^2 | P_{1,0}P_{2,0} = 0\}$.
**Algorithm 1:** JELONEK\_N($f_1, \dots, f_n$)

**Input** : $f = (f_1, \dots, f_n) \in \mathbb{Z}[x_1, \dots, x_n]^n$

**Output** : The set of non-properness of $f: \mathbb{C}^n \to \mathbb{C}^n$

/* Notice that $F_i \in (\mathbb{C}[y])[x]$, where $y = (y_1, \dots, y_n)$.

*/

1 $F_1 \leftarrow f_1(x) - y_1, \dots, F_n \leftarrow f_n(x) - y_n$;

2 **for** $i \in [n]$ **do**

/* Eliminate all the x-variables but $x_i$.

*/

3 $R_i = \text{res}_{x_i}(F_1, \dots, F_n) = \sum_{k=0}^{N_i} A_k^i(y) x_i^{N_i-k} \in (\mathbb{C}[y])[x_i]$

4 **RETURN** $\prod_{i=1}^n A_0^i(y) \in \mathbb{C}[y]$;

The computation of the implicit equation of parametrized hypersurfaces $F_i(\mathbb{C}^n)$ requires to eliminate $n-1$ from the variables $x_1, \dots, x_n$. Thus, to compute the Jelonek set we need effective computations with resultants or Gröbner bases.

In Alg. 2 and Alg. 1 we present the pseudo-code of the algorithms supported by Thms. 2.2 and 2.3 for computing the Jelonek set in $\mathbb{C}^n$ and $\mathbb{C}^2$. The proofs of the following two results are in the appendix.

**Theorem 2.4.** Let $f = (f_1, \dots, f_n) \in \mathbb{Z}[x_1, \dots, x_n]$ be polynomials of size $(d, \tau)$. Alg. 1 computes the Jelonek set $\mathcal{J}_f$ in

$$ \tilde{\mathcal{O}}_B(2^n n^{n(\omega+1)-\omega+1} d^{2+(n-1)\omega} (\tau + nd)), \quad (3) $$

where $\omega$ is the exponent in the complexity of matrix multiplication. It consists of polynomials in $\mathbb{Z}[y_1, \dots, y_n]$ of size $(\mathcal{O}(d^n), \tilde{\mathcal{O}}((nd)^{n-1}\tau))$.

For the special case of two variables a slightly better bound is possible.

**Theorem 2.5.** Let $f_1, f_2 \in \mathbb{Z}[x_1, x_2]$ be polynomials of size $(d, \tau)$. Alg. 2 computes the Jelonek set $\mathcal{J}_f$ in $\tilde{\mathcal{O}}_B(d^6\tau)$. It consists of a polynomial in $\mathbb{Z}[y_1, y_2]$ of size $(\mathcal{O}(d), \tilde{\mathcal{O}}(d\tau))$.

**Algorithm 2:** JELONEK\_2($f_1, f_2$)

**Input** : $F = (f_1, f_2) \in \mathbb{Z}[x_1, x_2]^2$

**Output** : The set of non-properness of $F: \mathbb{C}^2 \to \mathbb{C}^2$

1 $g_1 \leftarrow f_1(x_1, x_2) - y_1$;

2 $g_2 \leftarrow f_2(x_1, x_2) - y_2$;

3 $r_1 \leftarrow \text{res}_{x_2}(g_1, g_2) \in (\mathbb{Z}[y_1, y_2])[x_1]$;

4 $r_2 \leftarrow \text{res}_{x_1}(g_1, g_2) \in (\mathbb{Z}[y_1, y_2])[x_2]$;

/* Return the leading coefficient with respect to $x_1$, resp. $x_2$, of $r_1$ and $r_2$ */

5 $p \leftarrow \text{lc}_{x_1}(r_1) \cdot \text{lc}_{x_2}(r_2) \in \mathbb{Z}[y_1, y_2]$;

6 **RETURN** $p$;

# 3 Preliminaries

We present the necessary terminology we need for the following sections.
<figure><img src="image_3.png" /><figcaption>Figure 2: Two Newton polytopes and their Minkowski sum. They correspond to the polynomials of the map in Section 5.4. The edges of the blue, resp. the black, polytope are labeled by $a_i$, resp. $b_j$, for $i, j \neq 0$. The vertices that correspond to $(0,0)$ are $a_0$, and $b_0$.</figcaption></figure>

## 3.1 Polytopes, Minkowski sums, and mixed volume

A *polytope*, also called *polygon*, $\Delta$ in $\mathbb{R}^2$ is a bounded intersection of closed half-spaces of the form $\{a_0 \le a_1 X_1 + a_2 X_2\} \subset \mathbb{R}^2$, where $a_0, a_1, a_2 \in \mathbb{R}$. The latter are the *supporting half-spaces* of $\Delta$ and their boundary intersects the boundary of $\Delta$, $\partial\Delta$, at a connected set of $\Delta$ that we call *face*. Thus, any face $F$ of $\Delta$ minimizes a function $a^* : \Delta \to \mathbb{R}$, given by $(X_1, X_2) \mapsto -a_0 + a_1 X_1 + a_2 X_2$. In this case $a = (a_1, a_2) \in \mathbb{R}^2$ is an interior normal vector to $F$ and we say that it *supports* $F$.

The Minkowski sum $A \oplus B$ of two subsets $A, B \subset \mathbb{R}^n$ is the set $\{a + b \mid a \in A, b \in B\}$. Let $A_1$ and $A_2$ denote the respective convex hulls of two finite sets in $\mathbb{Z}^2$ and let their Minkowski sum be $A = A_1 \oplus A_2$. The *summands* of $A$ refers to the pair $(A_1, A_2)$. If $\Gamma$ is a face of $A$, that is $\Gamma \subset A$, then we denote the summands of $\Gamma$ by $(\Gamma_1, \Gamma_2)$, such that $\Gamma = \Gamma_1 \oplus \Gamma_2$, $\Gamma_1 \subset A_1$, and $\Gamma_2 \subset A_2$.

### 3.1.1 Mixed volume

Given a convex set $\Delta \subset \mathbb{R}^2$, let $\mathrm{Vol}(\Delta)$ be its fixed and Lebesgue measure endowed in $\mathbb{R}^2$. Minkowski's *mixed volume* is the unique real-valued multi-linear, with respect to the Minkowski sum, function of two convex sets $\Delta_1, \Delta_2 \subset \mathbb{R}^2$, whose value, if $\Delta_1 = \Delta_2 = \Delta$, equals $2 \mathrm{Vol}(\Delta)$. We denote the mixed volume by $\mathrm{MV}(\Delta_1, \Delta_2)$ and we can compute it using the inclusion-exclusion formula

$$ \mathrm{Vol}(\Delta_1 \oplus \Delta_2) - \mathrm{Vol}(\Delta_1) - \mathrm{Vol}(\Delta_2). $$

If $\Delta_1 \oplus \Delta_2$ is a line segment or if $\Delta_i$ is a point for some $i \in \{1, 2\}$, then $\mathrm{MV}(\Delta_1, \Delta_2) = 0$. The other direction of this statement is also true; it is a particular case of Minkowski's theorem for the higher-dimensional mixed volume, see [28, Section 2].

A pair $(\Delta_1, \Delta_2)$ is *independent* if $\mathrm{MV}(\Delta_1, \Delta_2) \neq 0$; or, equivalently, if $\dim(\sum_{i \in I} \Delta_i) \ge |I|$ for all $I \subset \{1, 2\}$. A pair is *dependent* if it is not independent.

### 3.1.2 Characterization of the faces

In what follows, we distinguish types of edges of the Minkowski sum of $\Delta := \Delta_1 \oplus \Delta_2$. The following definition details these types, while Figure 3 gives a pictorial overview.

**Definition 3.1.** Let $\Delta = \Delta_1 \oplus \Delta_2$. A face $\Gamma \subset \Delta$ with summands $(\Gamma_1, \Gamma_2)$ is an edge if $\dim(\Gamma) = 1$. An edge is

* long if both of its summands have dimension 1, that is if $\dim(\Gamma_1) = \dim(\Gamma_2) = 1$.
<figure><img src="image_4.png" /><figcaption>Figure 3: The partition of the edges that SPARSEJELONEK-2 exploits. $\Gamma$ is an edge of the Minkowski sum and its summands are $\Gamma_1$ and $\Gamma_2$.</figcaption></figure>

* short if it is not long.

* pertinent if it is long and both of its summands do not contain the origin, that is $(0,0) \notin \Gamma_1$ and $(0,0) \notin \Gamma_2$.

* semi-origin if at least one of its summands contains the origin, that is $(0,0) \in \Gamma_1$ or $(0,0) \in \Gamma_2$.

* origin if both of its summands contain the origin, that is $(0,0) \in \Gamma_1$ and $(0,0) \in \Gamma_2$.

* infinity if the corresponding (inner) normal vector has a negative coordinate.

**Example 3.2.** Consider the three (Newton) polytopes in Figure 2. The third polytope is the Minkowski sum of the first two and we have the following characterization of its edges:

* Semi-origin long edges: $a_1 \oplus b_3, a_4 \oplus b_6$.

* Origin long edges: $a_4 \oplus b_6$.

* Semi-origin short edges: $a_0 \oplus b_1, a_0 \oplus b_2$.

* Origin short edges: $a_0 \oplus b_0, a_0 \oplus b_1$.

* Pertinent edges: $a_2 \oplus b_4, a_3 \oplus b_5$.

* All of the edges are infinity edges.

## 3.2 Polynomials restricted to faces

Let $P \in \mathbb{K}[x_1^{\pm 1}, x_2^{\pm 1}]$ be a bivariate Laurent polynomial, that is

$$P(x) = \sum_{a \in \mathbb{Z}^2} c_a x^a = \sum_{(a_1, a_2) \in \mathbb{Z}^2} c_a x_1^{a_1} x_2^{a_2},$$

where $c_a \in \mathbb{K}$. The support of $P$ is the set $\text{supp}(P) = \{a \in \mathbb{Z}^2 | c_a \neq 0\}$. The Newton polytope of $P$ is the convex hull of its support; we denote it by $\text{NP}(P)$.

Consider the pair of polynomials $f := (f_1, f_2) \in \mathbb{K}[x_1^{\pm 1}, x_2^{\pm 1}]^2$, with non-zero constant terms such that

$$f_1 = \sum_{a \in S_1} c_{1,a} x^a \quad \text{and} \quad f_2 = \sum_{b \in S_2} c_{2,b} x^b, \qquad (4)$$
<figure><img src="image_5.png" /><figcaption>Figure 4: Toric change of basis. The face $\Gamma$ is the edge delimited by $a_1$ and $a_2$, while $\Gamma'$ is delimited by $a_1$ and $a_3$. The corresponding primitive vectors are $v$ and $v'$, respectively. The vectors $v$ and $w$ consist a basis of $\mathbb{Z}^2$. In addition they define a cone that contains all the lattice points of the polygon. Thus, the toric change of basis consists of the vectors $v$ and $w$ and $\tilde{e} = (v, w)$.</figcaption></figure>

where $S_i = \text{supp}(f_i) \subset \mathbb{Z}^2$. The corresponding Newton polytopes (in our case polygons) are $\Delta_i = \text{NP}(f_i)$, for $i \in \{1, 2\}$. Also let $\text{NP}(f) := \Delta = \Delta_1 \oplus \Delta_2$. For any face $\Gamma \prec \Delta$ with summands $(\Gamma_1, \Gamma_2)$, we denote by $f_{\Gamma_1}$ the restriction of $f_1$ to those monomial terms $c_{1,a}x^a$ for which $a \in \Gamma_1 \cap \mathbb{Z}^2$. Similarly for $f_{\Gamma_2}$. We also write $f_{\Gamma}$ for the pair $(f_{\Gamma_1}, f_{\Gamma_2}) \in \mathbb{K}[x_1^{\pm 1}, x_2^{\pm 1}]^2$.

# 4 Decomposing the Jelonek set

Let $f: \mathbb{K}^2 \to \mathbb{K}^2$ be a dominant polynomial map sending $(0,0)$ to $(\mathbb{K}^*)^2$. The main goal of this section is to describe $\mathcal{J}_f$ in terms of the multiplicities and the existence of solutions of polynomial systems resulting from suitable toric transformation of $f$. The results of this section contribute to the correctness proof of the main algorithm in Sec. 6.

We keep using $\Delta_1$, $\Delta_2$, and $\Delta$ to denote $\text{NP}(f_1)$, $\text{NP}(f_2)$, and $\text{NP}(f_1) \oplus \text{NP}(f_2)$, respectively.

## 4.1 Toric change of variables using edges

To each edge $\Gamma \prec \Delta$, we introduce a toric change of coordinates $U \in \text{SL}(2, \mathbb{Z})$ to deduce a description of the points in the preimage of $f$ that escape to infinity.

Assume that $(\Gamma_1, \Gamma_2)$ is the pair of summands of $\Gamma$, and let $a_1$ be any endpoint of $\Gamma$. We use $v$ to denote the primitive vector starting from $a_1$ along the direction of $\Gamma$.

Then, there exists a vector $w \in \mathbb{Z}^2$ satisfying $\det(v, w) = \pm 1$ and such that for any point in $\Delta \oplus \{-a_1\}$ spanned by the basis $\tilde{e} := (v, w)$, the coefficient in front of $w$ is positive. In other words, $w$ points towards the direction of the polygon. We call $(v, w)$ a $\Gamma$-basis for $\Delta$.

The linear transformation $U: \mathbb{Z}^2 \to \mathbb{Z}^2$ maps the new basis $\tilde{e}$ to the canonical basis of $\mathbb{Z}^2$. We can also relate the computatin of $\tilde{e}$ to the computation of the shorted vector problem in $\mathbb{Z}^2$ [45, Lecture VIII].

Now consider the matrix $T$, where

$$T = \begin{pmatrix} t_{11} & t_{12} \\ t_{21} & t_{22} \end{pmatrix} = \begin{pmatrix} v_1 & v_2 \\ w_1 & w_2 \end{pmatrix} \in \text{SL}(2, \mathbb{Z}).$$
It corresponds to the following change of variables $z = x^T(1)$. The transformation $U$ that we are looking for is the transpose of the inverse of $T$, that is $U = T^{-\top}$ which induces an isomorphism $(K^*)^2 \to (K^*)^2$, given by the transformation

$$ (z_1, z_2) \mapsto (z_1^{w_2/D} z_2^{-v_2/D}, z_1^{-w_1/D} z_2^{v_1/D}), $$

where $D = \det(T) = \pm 1$ is the determinant of $T$. We deduce that $T$, and thus also $U$, depends on $\Gamma$ and $\Delta$.

**Definition 4.1.** The set of $\Gamma$-toric transformations is the subset of all matrices $(\begin{smallmatrix} w_2/D & -w_1/D \\ -v_2/D & v_1/D \end{smallmatrix}) \in \mathrm{SL}(2, \mathbb{Z})$, where $(v, w)$ is a $\Gamma$-basis for $\Delta$. We denote this set by $\mathrm{TM}_{\Gamma}(\mathbb{Z}^2)$.

We also have the following immediate consequence.

**Lemma 4.2.** Let $\alpha \in \mathbb{Z}^2$ be the primitive integer vector supporting an edge $\Gamma \prec \Delta$. Then, for any $U \in \mathrm{TM}_{\Gamma}(\mathbb{Z}^2)$, $U\Gamma$ is an edge of $U\Delta$. Moreover, there is a $U$ such that the vector $U^{-\top} \cdot \alpha$ equals $(0, 1)$ and it supports $U\Gamma$.

**Remark 4.3.** If $f = (f_1, f_2)$ is a pair of bivariate polynomials and $Uf = (Uf_1, Uf_2)$, then $\mathbb{V}_{K^*}(f)$ has the same number of isolated points as $\mathbb{V}_{K^*}(Uf)$.

If $Uf$ consists of Laurent polynomials, then there might be monomials with negative exponents. We transform them to polynomials by multiplying them by suitable monomials. We denote this transformation by $\overline{U}f$, which is the map $(Ux^{r_1}f_1, Ux^{r_2}f_2)$, for suitable $r_1, r_2 \in \mathbb{Z}^2$; in other words we multiply by monomials of the smallest possible degree to clear the denominators.

The following observations will be useful in the sequel as they relate the roots of the transformed polynomial system to the roots of the original one.

**Remark 4.4** (Toric transformation and polynomials). For any $f \in \mathbb{K}[x_1, x_2]^2$, where $\Delta = \mathrm{NP}(f)$, the following hold:

(i) For any $U \in \mathrm{TM}_{\Gamma}(\mathbb{Z}^2)$, the system $\overline{U}f_{\Gamma} = 0$ is univariate and $\overline{U}f = 0$ is bivariate, and

(ii) $\overline{U}f_{\Gamma} = 0$ has a solution $\rho \in \mathbb{K}^*$ iff $\overline{U}f = 0$ has a solution $(\rho, 0) \in \mathbb{K}^* \times \{0\}$ iff $f_{\Gamma} = 0$ has a solution in $(\mathbb{K}^*)^2$.

## 4.2 The topological and algebraic multiplicity sets of $f$

Let $f: \mathbb{K}^2 \to \mathbb{K}^2$ be a polynomial map whose Newton polytope is denoted by $\Delta$ and let $U \in \mathrm{TM}_{\Gamma}(\mathbb{Z}^2)$ for some fixed $\Gamma \prec \Delta$. Define the graph

$$ G := G(U, f) = \{(z, y) \in (\mathbb{K}^*)^2 \times \mathbb{K}^2 \mid \overline{U}(f - y)(z) = 0\}, $$

and consider the projection $\pi: \mathbb{K}^2 \times \mathbb{K}^2 \to \mathbb{K}^2$, $(z, y) \mapsto y$.

**Definition 4.5** ($\mathrm{TF}_{\mathbb{K}}(\Gamma)$, topological face multiplicity set). For any $\rho \in \mathbb{K}^*$, consider the following set

$$ T^{\rho}(\Gamma) := \{ y \in \mathbb{K}^2 \mid \exists \{(z_k, y_k)\}_{k \in \mathbb{N}} \subset G(U, f), z_k \xrightarrow{k \to \infty} (\rho, 0) \text{ and } y_k \to y \}. $$

Then $\mathrm{TF}_{\mathbb{K}}^{\rho}(\Gamma)$ is the Euclidean closure $T^{\rho}(\Gamma)$, that is $\mathrm{TF}_{\mathbb{K}}^{\rho}(\Gamma) = \overline{T^{\rho}(\Gamma)}^E$.
The topological face multiplicity set of $f$ corresponding to $\Gamma$, $\mathrm{TF}_K(\Gamma)$, is the union of the sets $\mathrm{TF}_K^\rho(\Gamma)$, that is

$$ \mathrm{TF}_K(\Gamma) = \bigcup_{\rho} \mathrm{TF}_K^\rho(\Gamma), $$

where $\rho$ takes all distinct values in $K^*$ satisfying $\bar{U}(f - \tilde{y})((\rho, 0)) = 0$ for some $\tilde{y} \in K^2$. For brevity, we call it T-multiplicity set.

We prove later in Thm. 4.15 that the Jelonek set of $f$ is formed by the union of all T-multiplicity sets, running over all the infinity edges of NP($f$).

Depending on the type of the edge $\Gamma \prec \Delta$, a non-empty set $\mathrm{TF}_K^\rho(\Gamma)$ can be either a finite set or a semi-algebraic curve.

We represent those cases in two examples.

**Example 4.6.** Consider the case $g := \bar{U}(f - y)$, where $g_1 = -y_1 + z_1^2 + z_2$ and $g_2 = -y_2 + z_1^2$. For any $\rho \in K^*$, consider the sequence $z(k) := (\rho, 1/k)$ for $k \in \mathbb{N}$. If $y(k) = (\rho^2 + 1/k, \rho^2)$, then the sequence $\{(z(k), y(k))\}_{k \in \mathbb{N}} \subset G$ converges to $(\rho, 0, \rho^2, \rho^2)$. Hence, it holds $\mathrm{TF}_K^\rho(\Gamma) = \{(\rho^2, \rho^2)\}$, and thus $\mathrm{TF}_K(\Gamma) = \{(\rho^2, \rho^2) | \rho \in K\}$.

**Example 4.7.** Assume now that $g := \bar{U}(f - y)$ is given by $g_1 = 1 - z_1 - y_1z_2$ and $g_2 = 1 + 2z_1 - 3z_1^2 - y_2z_2$. On the one hand, for each $i \in \{1, 2\}$, it holds $g_i(z_1, 0) = 0 \Leftrightarrow z_1 = 1$ making the set $\mathrm{TF}_K^\rho(\Gamma)$ empty whenever $\rho \neq 1$. On the other hand, as the sequence $z(k) := (1+1/k, 1/k)$ converges to $(1, 0)$, the sequence $y(k) := (1, 4+3/k)$ satisfies $g(z(k), y(k)) = 0$, and converges to the line $L := \{4y_1 = y_2\}$. We deduce that if $\rho = 1$, then $\mathrm{TF}_K^\rho(\Gamma) = \mathrm{TF}_K(\Gamma) = L$.

The following observation follows from the definitions.

**Lemma 4.8.** The T-multiplicity set of $f$ corresponding to $\Gamma$, $\mathrm{TF}_K(\Gamma)$, does not depend on the choice of the toric transformation $U$ from $\mathrm{TM}_\Gamma(\mathbb{Z}^2)$.

To compute T-multiplicity sets we need to introduce the multiplicity of a solution of a polynomial system.

**Definition 4.9.** [8, Ch. 4, Def. 2.1] Let $g := (g_1, g_2) \in K[z_1, z_2]^2$ and $J = \langle g_1, g_2 \rangle$ the corresponding ideal. The multiplicity of a solution $x \in K^2$ of the system $g = 0$ is the dimension of the ring obtained by localizing $K[z_1, z_2]$ at the maximal ideal $m := \langle z_1 - x_1, z_2 - x_2 \rangle$ and considering the quotient ring $K[z_1, z_2]_m/JK[z_1, z_2]_m$.

For our purposes, to compute the multiplicity of the solution of a bivariate polynomial system we proceed as follows. We augment the system with a linear form, say $g_0 = s - r_1z_1 - r_2z_2$, where $s$ is a new variable and $r_{\{1,2\}}$ are sufficiently generic integers. After we eliminate the variables $z_1, z_2$ from the system $g_0 = g_1 = g_2 = 0$, we obtain a univariate polynomial in $s$. The multiplicity of the roots of this last polynomial correspond to the multiplicities of the roots of the system. For the further details of this approach we refer the reader to [5, 6, 35].

For any point $\rho \in K$ and any $y \in K^2$, we denote by $\mu_\rho(y)$ the multiplicity of a solution $(\rho, 0)$ to the system $\bar{U}(f - y) = 0$.

**Definition 4.10 (AF$_K(\Gamma)$, algebraic face multiplicity set).** For any $\rho \in K^*$, define $\mathrm{AF}_K^\rho(\Gamma)$ to be the set of all points $y \in K^2$ such that for any $\tilde{y} \notin \mathrm{AF}_K^\rho(\Gamma)$, it holds

$$ \mu_\rho(y) > \mu_\rho(\tilde{y}). $$

The algebraic face multiplicity set of $f$ corresponding to $\Gamma$, $\mathrm{AF}_K(\Gamma)$, is the union of all $\mathrm{AF}_K^\rho(\Gamma)$, where $\rho$ takes all distinct values in $K^*$ satisfying $\bar{U}(f - \tilde{y})((\rho, 0)) = 0$ for some $\tilde{y} \in K^2$.

For brevity, we also call it A-multiplicity set.
**Example 4.11.** Consider the polynomials $(g_1, g_2) = (-y_1 + z_1^2 + z_2, -y_2 + z_1^2)$ from Example 4.6. If $\mathbb{K} = \mathbb{C}$, then the equalities $\mathrm{TF}_{\mathbb{C}}(\Gamma) = \{(\rho^2, \rho^2) \in \mathbb{C}^2 \mid \rho \in \mathbb{C}\} = \{y_1 - y_2 = 0\} = \mathrm{AF}_{\mathbb{C}}(\Gamma) \subset \mathbb{C}^2$ follow from the fact that $y_1 = y_2$ if and only if the system $\bar{U}(f - y) = 0$ has a solution of the form $(\rho, 0)$ for some $\rho \in \mathbb{C}^*$. Similarly, if $\mathbb{K} = \mathbb{R}$, then $\mathrm{TF}_{\mathbb{R}}(\Gamma) = \{(\rho^2, \rho^2) \in \mathbb{R}^2 \mid \rho \in \mathbb{R}\} = \{y_1 - y_2 = 0\} \cap \mathbb{R}^2_{\ge 0} = \mathrm{AF}_{\mathbb{R}}(\Gamma)$.

**Example 4.12.** Consider the polynomials $(g_1, g_2) = (1 - z_1 - y_1z_2, -1 + 2z_1 - 3z_1^2 - y_2z_2)$ from Example 4.7. For any $\mathbb{K} \in \{\mathbb{R}, \mathbb{C}\}$, the point $(1, 0)$ is a simple solution to the system $\bar{U}(f - y) = 0$ whenever $y \notin L$. Indeed, the line $L$ is the zero locus of the polynomial in $\mathbb{K}[y_1, y_2]$ obtained as the determinant of the Jacobian matrix $\det \mathrm{Jac}_{(1,0)}\bar{U}(f - y)$. Therefore, it holds $L = \mathrm{AF}_{\mathbb{K}}(\Gamma)$.

As the previous examples indicate, for any $\Gamma \prec \Delta$, it holds $\mathrm{TF}_{\mathbb{K}}(\Gamma) \subset \mathrm{AF}_{\mathbb{K}}(\Gamma)$. Indeed, since the system $\bar{U}(f - y) = 0$, from Def. 4.5, has a solution $\varrho \in \mathbb{K}^* \times \{0\}$ whose multiplicity increases at points $y \in \mathrm{TF}_{\mathbb{K}}(\Gamma)$, we get the inclusion "$\subseteq$". We will see (Prp. 4.16) that we have equality if $\mathbb{K} = \mathbb{C}$, and the inclusion may be strict for $\mathbb{K} = \mathbb{R}$ (Rem. 4.17 and Thm. 4.22). Furthermore, notice (see e.g., Example 4.11) that, in general, we have $\mathrm{TF}_{\mathbb{R}}(\Gamma) \neq \mathrm{AF}_{\mathbb{C}}(\Gamma) \cap \mathbb{R}^2$.

In Section 6.1.2 we present an algorithm to indentify the components (if any) of $\mathrm{AF}_{\mathbb{R}}(\Gamma)$ contributing to $\mathrm{TF}_{\mathbb{R}}(\Gamma)$ and hence to $\mathcal{J}_f$.

## 4.3 The Jelonek set as a union of multiplicity sets

We start by introducing some useful notation and auxiliary results. We use $\mathrm{Sol}_{\mathbb{K}}(\Gamma)$ to denote the set of numbers $\rho \in \mathbb{K}$ for which $(\rho, 0)$ is a solution of the system $\bar{U}(f - y) = 0$, for some $y \in \mathbb{K}^2$ and $U \in \mathrm{TM}_{\Gamma}(\mathbb{Z}^2)$, where $\Gamma$ is an edge of $\Delta$. We denote by $\mathcal{D}_f$ the discriminant of $f$. That is, if $C_f := \{x \in \mathbb{K}^2 \mid \det(\mathrm{Jac}_x(f)) = 0\}$, then $\mathcal{D}_f = f(C_f)$.

Since $f$ is a dominant map, the following holds.

**Lemma 4.13.** The set $\mathcal{D}_f \cup f(\mathbb{K}^2 \setminus (\mathbb{K}^*)^2)$ is a finite union of curves.

We need the following technical lemma for the proof Thm. 4.15. It identifies the edges that we can safely exclude from our computations.

**Lemma 4.14.** Let $\Gamma \prec \Delta$ be an edge. If one of the summands of $\Gamma$ is a vertex that is not the origin, then for any $y \in \mathbb{K}^2$, the system $(f - y)_{\Gamma} = 0$ has no solutions in $(\mathbb{K}^*)^2$.

*Proof.* Let $\Gamma = \Gamma_1 \oplus \Gamma_2$. Assume that $\Gamma_1$ is the vertex that is not the origin. Then, $(f_1 - y_1)_{\Gamma} = c_w x^w$ and $c_w \neq 0$. Thus, its solution is 0 and so the system $(f - y)_{\Gamma} = 0$ has no solutions in the torus $(\mathbb{K}^*)^2$. $\square$

Now we are ready to state and prove our main result.

**Theorem 4.15.** Consider a dominant polynomial map $f : \mathbb{K}^2 \to \mathbb{K}^2$ and its Newton polytope $\Delta$, where $\mathbb{K} \in \{\mathbb{C}, \mathbb{R}\}$. The Jelonek set of $f$ is

$$ \mathcal{J}_f = \bigcup_{\Gamma} \mathrm{TF}_{\mathbb{K}}(\Gamma), \qquad (5) $$

where $\Gamma$ runs over all infinity edges of $\Delta$.

*Proof.* Consider the subset $\mathcal{J}_f^\bullet \subseteq \mathcal{J}_f$ containing points $y$ such that $f^{-1}(y)$ is finite<fnref n="1" />. Thus,

$$ \mathcal{J}_f^\bullet = \{y \in \mathcal{J}_f \mid \dim(f^{-1}(y)) \le 0\}. $$

<footnote n="1">¹For example consider the blowup $f : (x_1, x_2) \mapsto (x_1, x_1x_2)$. Then, $\mathcal{J}_f^\bullet = \{(0, y_2) \mid y_2 \in \mathbb{K}^*\}$ and $f^{-1}(y) = \emptyset$, for any $y \in \mathcal{J}_f \setminus \{(0, 0)\}$, and hence it is a finite set.</footnote>
On the other hand,

$$ \mathcal{J}_f \setminus \mathcal{J}_f^\bullet = \{y \in \mathcal{J}_f \mid \dim(f^{-1}(y)) = 1\}, $$

and so the preimage of any point in $\mathcal{J}_f \setminus \mathcal{J}_f^\bullet$ shares with $C_f$ an irreducible curve. In addition the $\mathcal{J}_f \setminus \mathcal{J}_f^\bullet$ is finite, i.e., it has dimension 0, as there are finitely many points $y \in \mathbb{K}^2$ for which the system $(f - y)(x) = 0$ is not zero dimensional. So $\mathcal{J}_f^\bullet$ is dense in $\mathcal{J}_f$.

Let $T^\rho(\Gamma)$ be the subset of points $y \in \mathrm{TF}_K(\Gamma)$ as in Def. 4.5 (without taking the Euclidean closure). It is enough to show that

$$ \mathcal{J}_f^\bullet = \bigcup_{\Gamma} T^\rho(\Gamma), \qquad (6) $$

where the faces $\Gamma$ are the infinity edges of $\Delta$. This is so, because both sets, on the left and on the right hand side of Eq. (6), are dense subsets of the corresponding closed (under the Euclidean topology) sets.

To prove the inclusion $\mathcal{J}_f^\bullet \subseteq \bigcup_\Gamma T^\rho(\Gamma)$, we borrow the arguments of the proof of [2, Thm. B] that relates the branches of the curves at infinity to the faces of the corresponding Newton polytopes (cf. also [18, Lemma 1]). Lem. 4.13, the fact that the Jelonek set is $\mathbb{K}$-uniruled [19, 22] (see also the proof of Prop. 6.1) imply that the discriminant, the T-multiplicity sets

and the image of the coordinate axes form a union of curves in $\mathbb{K}^2$.

Therefore, for any $y \in \mathcal{J}_f^\bullet$, one can choose a point $q \in \mathbb{K}^2$, and a line segment $\lambda([0, 1])$ outside

$$ \bigcup_{\Gamma} \mathrm{TF}_{\mathbb{K}}(\Gamma) \cup \mathcal{D}_f \cup \mathcal{J}_f^\bullet \cup f(\mathbb{K}^2 \setminus (\mathbb{K}^*)^2), $$

where $\lambda := (\lambda_1, \lambda_2) : [0, 1] \to \mathbb{K}^2$, $t \mapsto (1-t)y + tq$. Then, we consider the parametrized polynomial system

$$ f - \lambda(t) = 0. \qquad (7) $$

Our assumptions on $\lambda$ imply that all the solutions $x(t) \in \mathbb{K}^2$ of (7) are simple and contained in $(\mathbb{K}^*)^2$. Moreover, the coordinates of every solution is a function in $t$. In particular, the coordinates of the solutions have the following Puiseux series expansion

$$ x_i(t) = a_i t^{\alpha_i} + \text{higher order terms in } t, \text{ for } i \in \{1, 2\}, \qquad (8) $$

where $a_i \in \mathbb{K}^*$ and $\alpha_i \in \mathbb{Q}$. If we substitute $x(t)$ in $f_i - \lambda_i(t)$ and set to zero the coefficient of the smallest power of $t$, say $\omega^*$, then we obtain $(f_i - y_i)_\Gamma(a_1, a_2) = 0$, for some edge $\Gamma \prec \mathrm{NP}(f)$. Indeed, the value $\omega^*$ is $\min(\langle\alpha, \omega\rangle \mid \omega \in \mathrm{NP}(f_i))$, which is attained only for points $w$ in the face of $\mathrm{NP}(f_i)$ supported by the vector $\alpha = (\alpha_1, \alpha_2)$. Therefore, the point $a = (a_1, a_2) \in (\mathbb{K}^*)^2$ is a solution to $(f - y)_\Gamma = 0$.

To prove that $\Gamma$ is an infinity edge we use the definition of the Jelonek set (Def. 2.1). As $y \in \mathcal{J}_f^\bullet$, one of the solutions $x(t)$ of (7) converges to infinity as $t \to 0$ (we may take, e.g. a branch from $f^{-1}(\lambda([0, 1]))$). Then, the value $\alpha_i$ appearing in (8) is negative for some $i$. Together with Lem. 4.14, it implies that $\Gamma$ is an infinity edge.

To prove that $y \in T^\rho(\Gamma)$, we combine the previous description with toric change of coordinates. The vector $(\beta_1, \beta_2) := (U^{-1})^\top \cdot \alpha$ which supports the edge $\Xi := U\Gamma$ of the transformed polytope $\mathrm{UNP}(f)$ equals (0, 1) (Lem. 4.2). The point $z(t)$, satisfying $z^U(t) = x(t)$, is a solution to $\bar{U}(f - \lambda(t)) = 0$, and we have

$$ z_i(t) = b_i t^{\beta_i} + \text{higher order terms in } t, \text{ for } i \in \{1, 2\}, \qquad (9) $$

for some $b = (b_1, b_2) \in (\mathbb{K}^*)^2$. Therefore, as $t \to 0$, $z(t)$ converges to a point $\varrho \in \mathbb{K}^* \times \{0\}$.
To prove the inclusion $\mathcal{J}_f^\bullet \supseteq \bigcup_\Gamma T^\rho(\Gamma)$, let $\Gamma \prec \mathrm{NP}(f)$ be an infinity edge. Assume that $T^\rho(\Gamma) \neq \emptyset$ for some matrix $U \in \mathrm{TM}_\Gamma(\mathbb{Z}^2)$. For any $y \in T^\rho(\Gamma)$, let $q$ be close enough to $y$, which results a solution $p \in (\mathbb{K}^*)^2$ to $\bar{U}(f-q) = 0$ as in Def. 4.5. As $q$ converges to $y$, the second coordinate of $p$ converges to 0, while the first one remains close to a non-zero constant. Then, we can express $p$ by a Puiseux series of the form (9), with $\beta = (0,1)$. The matrix $U \in \mathrm{TM}_\Gamma(\mathbb{Z}^2)$ transforms the point $p$ into a solution $p^U$ to the system $f-q = 0$, whose coordinates are expressed as in (8). The assumptions on $\Gamma$ imply that one of the $\alpha_i$ appearing in (8) is negative. Then, the solution $p^U$ converges to infinity as $p \to \varrho$, and $q \to y$. This proves that $y \in \mathcal{J}_f^\bullet$. $\square$

### 4.3.1 The T-multiplicity sets in $\mathbb{C}$

In what follows, we describe the relation between T-multiplicity and the A-multiplicity sets for different cases of $\mathbb{K}$.

**Proposition 4.16.** Consider a dominant polynomial map $f : \mathbb{C}^2 \to \mathbb{C}^2$, its Newton polytope $\Delta$, and let $\rho \in \mathrm{Sol}_\mathbb{C}(\Gamma)$. Then, for any edge $\Gamma \prec \Delta$, it holds

$$ \mathrm{TF}_{\mathbb{C}}^{\rho}(\Gamma) = \mathrm{AF}_{\mathbb{C}}^{\rho}(\Gamma). \qquad (10) $$

*Proof.* We first prove the statement for the case where $\Gamma$ is a semi-origin edge. Recall the surface $G \subset (\mathbb{C}^*)^2 \times \mathbb{C}^2$, and $\bar{G} \subset \mathbb{C}^4$ defined in Sec. 4.2. Then, Def. 4.5 shows that $\mathrm{TF}_\mathbb{C}(\Gamma) = \pi(\bar{G} \cap \{z_2 = 0\})$. Furthermore, since $\Gamma$ is semi-origin, the value $y_i$ appears in the equation $\bar{U}(f_i - y_i)\Gamma(z_1, z_2) = \bar{U}(f_i - y_i)(z_1, 0)$ for some $i \in \{1, 2\}$ (see Remark 4.4). Hence, for any $\rho \in \mathbb{C}^*$ and $y \in \mathbb{C}^2$, it holds $\bar{U}(f - y)(\rho, 0) = 0$ if and only if $(\rho, 0, y_1, y_2) \in \bar{G} \cap \{z_2 = 0\}$. We deduce that $y \notin \pi(\bar{G} \cap \{z_2 = 0\}) \Rightarrow y \notin \mathrm{AF}_\mathbb{C}(\Gamma)$, which yields the equality $\mathrm{TF}_\mathbb{C}(\Gamma) = \mathrm{AF}_\mathbb{C}(\Gamma)$.

Note that, for a semi-origin edge $\Gamma$, the above arguments hold true after we replace $\mathbb{C}$ by $\mathbb{R}$. Thus, we also get $\mathrm{TF}_\mathbb{R}(\Gamma) = \mathrm{AF}_\mathbb{R}(\Gamma)$. The same cannot be said for pertinent edges.

Assume now that $\Gamma$ is pertinent, and let $T(\Gamma)$ be the subset of $\mathrm{TF}_\mathbb{C}^\rho(\Gamma)$ defined as in Def. 4.5 but without taking the Euclidean closure.

The inclusion $T(\Gamma) \subseteq \mathrm{AF}_\mathbb{C}^\rho(\Gamma)$ follows directly from the definition of the multiplicity sets. Since $\mathrm{AF}_\mathbb{C}^\rho(\Gamma)$ is closed, the closure of $T(\Gamma)$ (i.e. the set $\mathrm{TF}_\mathbb{C}^\rho(\Gamma)$) is included in $\mathrm{AF}_\mathbb{C}^\rho(\Gamma)$.

To prove the inclusion $\mathrm{TF}_\mathbb{C}(\Gamma) \supseteq \mathrm{AF}_\mathbb{C}^\rho(\Gamma)$ we proceed as follows. Consider the set $A(\Gamma)$ of points $y \in \mathrm{AF}_\mathbb{C}^\rho(\Gamma)$ at which the system $\bar{U}(f-y) = 0$ has finitely-many solutions. One can check (see e.g. proof of Thm. 4.15) that $\mathrm{AF}_\mathbb{C}^\rho(\Gamma) \setminus A(\Gamma)$ is finite and hence $A(\Gamma)$ is dense in $\mathrm{AF}_\mathbb{C}^\rho(\Gamma)$.

Next, we choose a point $q \in A(\Gamma)$, and will show that it belongs to $\mathrm{TF}_\mathbb{C}(\Gamma)$. Then, the point $(\rho, 0)$ is an isolated solution to $\bar{U}(f-q) = 0$.

Let $R \in \mathbb{C}[y_1, y_2, z_1]$ be the generator in the elimination ideal

$$ \langle \bar{U}(f_1 - y_1), \bar{U}(f_2 - y_2) \rangle \cap \mathbb{C}[y_1, y_2, z_1], \qquad (11) $$

and let $k$ be the largest integer allowing the factorization $R = (z_1 - \rho)^k R_0$, with $R_0 := \phi_0(y) + \phi_1(y)(z_1 - \rho) + \cdots + \phi_r(y)(z_1 - \rho)^r$.

Note that, we have $R_0(q, \rho) = 0$, and $R_0(\tilde{q}, \rho) \neq 0$ for any $\tilde{q} \notin \mathrm{AF}_\mathbb{C}^\rho(\Gamma)$. There exists $m > 0$ such that the polynomial $R_0$ is expressed as

$$ \phi_0 \cdot R_{01} + (z_1 - \rho)^m R_{02}, \qquad (12) $$

where $R_{01}$ collects all terms of $R_0$ that are factors of $\phi_0$, and $R_{02}$ is not a factor of $(z_1 - \rho)$. Moreover, we have $R_{02}$ is not identically zero since $\forall y \in \mathbb{C}^2$, $\exists z \in \mathbb{C}^2$ such that $\bar{U}(f-y)(z) \neq 0$. This shows that $\mathrm{AF}_\mathbb{C}^\rho(\Gamma)$ is given by the curve $\mathcal{V}(Q)$, where $\phi_0$ is a factor of $Q \in \mathbb{C}[y]$.
Now, for any generic point $\tilde{q} \to q$, we get $Q(\tilde{q}) \to 0$, and the solutions to $\overline{U}(f - \tilde{q}) = 0$ are mapped to the roots $\Sigma_{\tilde{q}} \subset \mathbb{C}$ of $R_0(\tilde{q}, z_1)$ under the projection $\pi_1 : \mathbb{C}^2 \to \mathbb{C}$, $(z_1, z_2) \mapsto z_1$. The point $\tilde{q}$, together with each such solution $\sigma \in \Sigma_{\tilde{q}}$ satisfy

$$ \phi_0(\tilde{q}) = -R_{02}(\tilde{q}, \sigma)/R_{01}(\tilde{q}, \sigma). \qquad (13) $$

It follows from (12) that the rational function $\phi_{\tilde{q}} : \mathbb{C} \to \mathbb{C}$, defined as $z_1 \mapsto -\frac{R_{02}}{R_{01}}(\tilde{q}, z_1)$ satisfies $\phi_{\tilde{q}}(\rho) = 0$. Therefore, whenever $Q \to 0$, equation (13) has a solution $\sigma \to \rho$. We deduce that a point in the set

$$ \pi_1^{-1}(\sigma) \cap \mathbb{V}_{\mathbb{C}^*}(\overline{U}(f - q)) $$

converges to the vertical line $\pi^{-1}(\rho)$, containing $(\rho, 0)$. To show that at least one of the points in $\Sigma_{\sigma}$ converges to $(\rho, 0)$ it is enough to note that the same arguments apply if we exchange $z_1$, $\rho$, and the line $\pi_1^{-1}(\rho)$ with $z_1$, 0, and the line $\pi_2^{-1}(0)$.

We have shown that $A(\Gamma) \subset \text{TF}_{\mathbb{C}}^{\rho}(\Gamma)$. This yields the inclusion $\supseteq$, of (10) as $A(\Gamma)$ is a dense subset of $\text{AF}_{\mathbb{C}}^{\rho}(\Gamma)$ and $\text{TF}_{\mathbb{C}}^{\rho}(\Gamma)$ is closed. $\square$

<figure><img src="image_6.png" /></figure>

**Remark 4.17.** Using the same arguments as in the proof Prop. 4.16, we can extract two further statements:

1. the set $\text{AF}_{\mathbb{C}}(\Gamma)$ is a union of irreducible algebraic curves, and

2. if $f$ is a real map instead, and $\Gamma$ is a semi-origin edge, then $\text{AF}_{\mathbb{R}}^{\rho}(\Gamma) = \text{TF}_{\mathbb{R}}^{\rho}(\Gamma)$.

Let us further describe the multiplicity sets for the complex case.

**Lemma 4.18.** Let $f$ and $\Delta$ be as in Prop. 4.16, and let $S$ be an irreducible component of $\text{AF}_{\mathbb{C}}(\Gamma)$ (see Rem. 4.17). Then, for any $p \notin S$, and any $q \in S \setminus \Sigma$ for some finite subset $\Sigma \subset S$, the following two quantities are equal and independent of the choice of $p$ and $q$.

1. The number of solutions in $(\mathbb{C}^*) \times \{0\}$ of the system $\overline{U}(f - q) = 0$ if $\Gamma$ is semi-origin, and

2. The difference $\mu_{\rho}(p) - \mu_{\rho}(q)$ if $\Gamma$ is pertinent.

We denote the value of these two quantities by $m$, which we also call the weight of the algebraic multiplicity.

*Proof.* Since the map is complex, the set $\overline{G} \cap \{z_2 = 0\}$ is a union of irreducible algebraic curves. Then, Prop. 4.16 shows that $S$ is the image of a component $C \subset \overline{G} \cap \{z_2 = 0\}$ under the projection $\pi : (x, y) \mapsto y$.

Assume first that $\Gamma$ is semi-origin. Then, for some $i \in \{1, 2\}$, the equation $\overline{U}(f_i - y_i)(z_1, 0) = 0$ can be written as $\overline{U}(f_i)(z_1, 0) - y_i = 0$. Hence, the map $K : C \to \{z_2 = 0\}$, given by the restriction to $C$ of the other projection $(z, y) \mapsto z$, is a generically finite map, where $K^{-1}(q)$ is a set of solutions to $\overline{U}(f - q) = 0$ in $(\mathbb{C}^*) \times \{0\}$. The value $m \in \mathbb{N}$ will thus be exactly the topological degree of $K$.

Assume now that $\Gamma$ is pertinent. Then, the above map $K$ is not dominant, and $S = \text{AF}_{\mathbb{C}}^{\rho}(\Gamma)$ for some $\rho \in \mathbb{C}^*$. Following the steps of the proof of Prop. 4.16 and using its notations we conclude that $\text{AF}_{\mathbb{C}}^{\rho}(\Gamma)$ is given by a polynomial $Q \in \mathbb{C}[y_1, y_2]$ that divides $\phi_0$. Since the polynomial (12) is obtained from the ideal (11), the value $m$ appearing therein is exactly the difference of multiplicities $\mu_{\rho}(p) - \mu_{\rho}(q)$. Here, we set $\mathcal{V} \subset \mathbb{V}(Q) \setminus \mathbb{V}(\phi_{i_1}) \cup \cdots \cup \mathbb{V}(\phi_{i_k})$, where $R_{02} = \phi_{i_1}z^{i_1} + \cdots + \phi_{i_k}z^{i_k}$. $\square$

<figure><img src="image_7.png" /></figure>
### 4.3.2 The $\mathbb{T}$-multiplicity sets in $\mathbb{R}$

Let $f: \mathbb{K}^2 \to \mathbb{K}^2$ be a dominant polynomial map, let $\Delta$ be its Newton polytope, let $\Gamma$ be an edge of $\Delta$, and let $U \in \mathrm{TM}_{\Gamma}(\mathbb{Z}^2)$. We use $g$ to denote the pair of polynomials $(g_1, g_2) := \bar{U}(f - y)(z)$. Recall that $G$ is given by $\{(z, y) | g = 0\} \subset (\mathbb{K}^*)^2 \times \mathbb{K}^2$, and $\bar{G}$ is given as the closure of $G$ in $\mathbb{K}^4$. Let $P := \pi|_G$, where $\pi: \mathbb{K}^4 \to \mathbb{K}^2$, $(z, y) \mapsto y$.

**Lemma 4.19.** It holds that

$$ \overline{P(\mathrm{Crit} P)} = \overline{\mathcal{D}_f \cap (\mathbb{K}^*)^2}. $$

*Proof.* First, note that $P(\mathrm{Crit} P)$ can be expressed as

$$ P(\{(z, y) \in G \mid \det \mathrm{Jac}_z g = 0\}) $$

From its construction, the map $g$ is written as

$$ (z, y) \mapsto (z^{s_1}(f_1 \circ \varphi - y_1), z^{s_2}(f_2 \circ \varphi - y_2)), $$

for some $s_1, s_2 \in \mathbb{N}^2$, where $\varphi: (\mathbb{K}^*)_z^2 \to (\mathbb{K}^*)_x^2$ is the coordinate change of variables induced by $U$.

Let $(z, y) \in G$. Then, there exists $v \in \mathbb{Z}^2$ such that

$$ \mathrm{Jac}_z g = z^v \cdot \mathrm{Jac}_z (f_1 \circ \varphi - y_1, f_2 \circ \varphi - y_2), $$

and since $z_1 \cdot z_2 \neq 0$, we get

$$ \det \mathrm{Jac}_z g = 0 \Leftrightarrow \det \mathrm{Jac}_z (f \circ \varphi). $$

The multivariate chain rule implies that

$$ \mathrm{Jac}_z f \circ \varphi = (\mathrm{Jac}_\varphi f \circ \varphi) \cdot \mathrm{Jac}_z \varphi, $$

where $\det \mathrm{Jac}_z \varphi$ is non-zero for any $z \in (\mathbb{K}^*)^2$. Therefore, we have $(z, y) \in G$ and $\det \mathrm{Jac}_z (f \circ \varphi) = 0$ if and only if there exists $x \in (\mathbb{K}^*)^2$ such that $x = \varphi(z)$, $f(x) = y$ and $\det \mathrm{Jac}_x (f) = 0$. This readily yields the proof. $\square$

In what follows, we assume that $\mathbb{K} = \mathbb{R}$. Let $S \subset \mathbb{R}^2$ be a semi-algebraic curve, such that there exists a polynomial surjective map $\phi: \mathbb{R} \to S$. Then $S$ will be called a *parametric semi-line*. Jelonek showed in [22] that $\mathcal{J}_f$ can be decomposed into a finite union of parametric semi-lines. In the rest of this section, we use Theorem 4.15 to obtain several results on this decomposition.

We say that $p \in S$ is an *endpoint* if for any small enough $\varepsilon > 0$, the open ball $B_\varepsilon(p) \subset \mathbb{R}^2$, intersected with $S$ is homeomorphic (in the Euclidean topology) to the half-open interval $[0, 1[$.

**Theorem 4.20.** Let $S$ be a parametric semi-line of $\mathcal{J}_f$, and assume that $S$ has an endpoint $q$. Then $q$ belongs to a component of the algebraic curve $\mathcal{D}_f$ not containing $S$.

*Proof.* Let $\Gamma$ be an edge of $\Delta$. We keep the same notation as in this Section for $U$, $g$, and $G$ for $\mathbb{K} = \mathbb{R}$. We use $\mathbb{C}G$ to denote the complex surface in $(\mathbb{C}^*)^2 \times \mathbb{C}^2$ given by $\mathbb{V}(g)$, and by $\overline{\mathbb{C}G}$ its Zariski closure in $\mathbb{C}^4$.

Eventhough the closure $\overline{G} \subset \mathbb{R}^4$ is smooth over all points in $G$, the same cannot be said about its boundary $\partial G := \overline{G} \setminus G = \overline{G} \cap \{z_1 \cdot z_2 = 0\}$. Then, using a sequence of blow-ups of $\mathbb{C}^4$ at the complex algebraic curves $\overline{\mathbb{C}G} \cap \{z_1 \cdot z_2 = 0\}$, if necessary, we may assume (with abuse of notation) that $\overline{G}$ is smooth. The set $\overline{G} \cap \{z_2 = 0\}$ is now a union of real irreducible algebraic curves and of points.
Then, we deduce from Thm. 4.15 that there exists an irreducible curve $\mathcal{C}$ from $\bar{G} \cap \{z_2 = 0\}$, such that $S = \pi(\mathcal{C})$, where $\pi : (z, y) \mapsto y$.

Recall that $q$ is an endpoint of $S$. Then, if $\pi|_{\mathcal{C}}$ denotes the restriction of $\pi$ to the curve $\mathcal{C}$, we conclude that there exists a point $p$ in its critical locus $\text{Crit}(\pi|_{\mathcal{C}})$ such that $\pi(p) = q$. In fact, since $\mathcal{C} \subset \bar{G}$, the point $p$ is in the critical locus $\text{Crit}(\pi|_{\bar{G}})$ of $\pi$ restricted to $\bar{G}$.

Thanks to Lemma 4.19, it is enough to show that $\pi(\text{Crit}(\pi|_{\bar{G}}))$ contains a curve $D$ satisfying

$$q \in D \subsetneq \pi(\bar{G} \cap \{z_2 = 0\}).$$

Since $\mathcal{C}$ is an algebraic curve and $\pi(\mathcal{C})$ is a semi-algebraic curve with an endpoint $q$, it holds that $|\pi^{-1}(y) \cap \mathcal{C}| \ge 2$ for finitely-many $y \in \pi(\mathcal{C})$. Let $\mathcal{U}$ be a neighborhood of $p$, and let $K$ be a connected component of $G \cap \mathcal{U}$, adjacent to $\mathcal{C}$. Since $\pi|_{\bar{G}}$ is dominant, for all $y \in \pi(K)$, the preimage $\pi|_{K}^{-1}(y)$ also has at least two points. It follows that

$$\emptyset \neq \pi(\text{Crit} \pi|_{K}) \subset \pi(\text{Crit}(\Pi|_{G})).$$

Here, the non-emptiness follows from $\pi|_{K}$ being a proper, locally algebraic morphism over a connected set $K$, whereas the inclusion is obvious. $\square$

**Corollary 4.21.** With the same notations as in Theorem 4.20, let $\Sigma \subset \mathbb{R}^2$ be the finite set of points formed by endpoints of $S$ and its singularities. Then $S$ is homeomorphic to a line if $\Sigma$ is empty. Otherwise, each connected component of $S \setminus \Sigma$ is a segment homeomorphic (in the induced Euclidean topology) to the open interval $]0, b[$, where $b \in \{1, +\infty\}$.

**Theorem 4.22.** Let $g := \mathbb{C}f : \mathbb{C}^2 \to \mathbb{C}^2$ be the complexification of $f$, and let $\text{AF}_{\mathbb{C}}^{\rho}(\Gamma)$ be a component of the multiplicity set $\text{AF}_{\mathbb{C}}(\Gamma)$ of $\tilde{f}$ having odd weight (see Lemma 4.18), for some $\rho \in \mathbb{R}^*$ and some $\Gamma \subsetneq \Delta$. Then, it holds that

$$\text{AF}_{\mathbb{C}}^{\rho}(\Gamma) \cap \mathbb{R}^2 \subset \mathcal{J}_f.$$

*Proof.* Let $S$ denote the component $\text{AF}_{\mathbb{C}}^{\rho}(\Gamma)$. We retain the set $\Sigma \subset S$ from Lemma 4.18, and define $\mathcal{V} := S \setminus \Sigma$. Then, the set $\mathbb{R}\mathcal{V} := \mathbb{R}^2 \cap \mathcal{V}$ is (homeomorphic to) a disjoint union of open intervals in $S \cap \mathbb{R}^2$. Prop. 4.16 shows that for any $q \in \mathbb{R}\mathcal{V}$, there exists a point $y \in \mathbb{R}^2 \setminus S$, converging to $q$, and a set $K_y$ of points $z \in (\mathbb{C}^*)^2$, converging to a subset $K_q \subset \mathbb{C}^* \times \{0\}$, such that $\bar{U}(f - y)(z) = 0$. Lemma 4.18 shows that, there exists $m \in \mathbb{N}$ such that $\#K_q = m$ if $\Gamma$ is a semi-origin edge, and $K_q$ is a point of multiplicity $m$ otherwise. Therefore, we get $m = \#K_y$.

Recall that $\bar{U}(f - y) = 0$ is a real polynomial system for each $y \in \mathbb{R}^2$ above, and $K_q$ has at least one point in $\mathbb{R}^* \times \{0\}$. Then, if $z$ is a point from $K_y$ converging to $K_q \in \mathbb{R}^2$, so does its complex conjugate $\bar{z}$. Since $m = \#K_y$ is odd, at least one of the points in $K_y$ is real. We get $q \in \text{TF}_{\mathbb{R}}^{\rho}(\Gamma)$, and thus $q \in S_f$ from Thm. 4.15. $\square$

**Corollary 4.23.** Let $f : \mathbb{R}^2 \to \mathbb{R}^2$ be a polynomial map such that its complexification $\tilde{f} := \mathbb{C}f : \mathbb{C}^2 \to \mathbb{C}^2$ is birational. Then, the non-propersness set $\mathcal{J}_f$ is a union of algebraic curves in $\mathbb{R}^2$.

*Proof.* Since the map is birational, for any edge $\Gamma$ of the Newton polytope $\Delta$ of $f$, each non-empty component $S$ of $\text{AF}_{\mathbb{C}}(\Gamma)$ has odd weight. Thm. 4.22 shows that $\mathcal{J}_f$ contains each component $S \cap \mathbb{R}^2$, and Thm. 4.15 shows that $\mathcal{J}_f$ is formed by all such components $S \cap \mathbb{R}^2$. The proof thus follows from Remark 4.17(1). $\square$
# 5 Strategy for computing the Jelonek set

In what follows $f = (f_1, f_2) : \mathbb{K}^2 \to \mathbb{K}^2$, where $f_1, f_2 \in \mathbb{Z}[x_1, x_2]$ are as in (4); we consider integer coefficients to study the bit complexity of the corresponding algorithms. Also, we consider $\Delta_1 = \text{NP}(f_1)$, $\Delta_2 = \text{NP}(f_2)$, and $\Delta = \Delta_1 \oplus \Delta_2$.

As a preprocessing step we consider the pair $(f_1 + a_1, f_2 + a_2)$, where $a := (a_1, a_2) \in \mathbb{Z}^2$ is a random point. This is to ensure that they both have a constant term, or in other words both their Newton polytopes contain the origin. Consequently, the output of SPARSEJELONEK-2 will differ from the "true" Jelonek set of $f$ by exactly this translation.

Accordingly, in what follows we assume that polynomials have a constant term.

The algorithm has two phases. During the first phase, which we detail in Sec. 5.1, we compute the Minkowski sum of the Newton polytopes of the input polynomials and we characterize its edges, following Def. 3.1. The partition of the edges with respect to the various types appears in Fig. 3. Following Lem. 4.14 we have to consider only the semi-origin and pertinent edges for our computations. At the second phase, which we detail in Sec. 5.2, for each edge of interest, we compute with a restricted polynomial system. For each, real or complex depending on $\mathbb{K}$, solution of this system, we exploit its multiplicity to compute the corresponding T-multiplicity set, using Prop. 4.16 or Cor. 4.21. The union of the T-multiplicity sets is the Jelonek set (Thm. 4.15).

<caption>**Algorithm 3: SPARSEJELONEK-2 ($f = (f_1, f_2), \mathbb{K}$)**</caption>

Input: $f_1, f_2 \in \mathbb{Z}[x_1, x_2], \mathbb{K} \in \{\mathbb{C}, \mathbb{R}\}$
Require: Both $f_1$ and $f_2$ have a non-zero constant term.
Output: The Jelonek set $\mathcal{J}$.
1 &nbsp;&nbsp; $\mathcal{J} \leftarrow \emptyset$;
2 &nbsp;&nbsp; $\Delta_1 \leftarrow \text{NP}(f_1)$; $\Delta_2 \leftarrow \text{NP}(f_2)$;
3 &nbsp;&nbsp; $\Delta \leftarrow \text{MINKOWSKI\_SUM\_2}(\Delta_1, \Delta_2)$;
4 &nbsp;&nbsp; **forall semi-origin edges** $\Gamma \prec \Delta$ **do**
5 &nbsp;&nbsp;&nbsp;&nbsp; /* It holds $\Gamma = \Gamma_1 \oplus \Gamma_2$ */
5 &nbsp;&nbsp;&nbsp;&nbsp; $f_1|_{\Gamma_1} \leftarrow x^u \cdot \sum_{i=0}^{|\Gamma_1 \cap \mathbb{N}^2|} a_i (x_1^k x_2^l)^i$; $f_2|_{\Gamma_2} \leftarrow x^v \cdot \sum_{j=0}^{|\Gamma_2 \cap \mathbb{N}^2|} b_j (x_1^k x_2^l)^j$;
6 &nbsp;&nbsp;&nbsp;&nbsp; if $0 \notin \Gamma_1$ **then** $\mathcal{J} \leftarrow \mathcal{J} \cup \{(y_1, y_2) \in \mathbb{K}^2 \mid y_2 = \sum_j b_j t^j, \text{ with } P_1(t) = \sum_i a_i t^i = 0\}$;
7 &nbsp;&nbsp;&nbsp;&nbsp; if $0 \notin \Gamma_2$ **then** $\mathcal{J} \leftarrow \mathcal{J} \cup \{(y_1, y_2) \in \mathbb{K}^2 \mid y_1 = \sum_i a_i t^i, \text{ with } P_2(t) = \sum_j b_j t^j = 0\}$;
8 &nbsp;&nbsp;&nbsp;&nbsp; if $0 \in \Gamma_1$ and $0 \in \Gamma_2$ **then** $\mathcal{J} \leftarrow \mathcal{J} \cup \{(y_1, y_2) \in \mathbb{K}^2 \mid y_1 = \sum_i a_i t^i, y_2 = \sum_j b_j t^j, \text{ where } t \in \mathbb{K}\}$;
9 &nbsp;&nbsp; **forall pertinent edges** $\Gamma \in \Delta$ **such that** $f|_{\Gamma} = 0$ **has solutions in $(\mathbb{K}^*)^2$** **do**
10 &nbsp;&nbsp;&nbsp;&nbsp; /* Let $a_1$ be the vertex of $\Gamma$ closer to the origin. Let $v$ be a primitive vector on $\Gamma$ starting from $a_1$. We compute a basis for the lattice $\mathbb{Z}^2$, $(v, w)$ that spans positively the polytope $\Delta - a_1$. */
10 &nbsp;&nbsp;&nbsp;&nbsp; $(v, w) \leftarrow \text{COMPUTE\_LATTICE\_BASIS}$;
11 &nbsp;&nbsp;&nbsp;&nbsp; /* It holds $T = \begin{pmatrix} v_1 & w_2 \\ w_1 & w_2 \end{pmatrix} \in \text{SL}(2, \mathbb{Z})$ and $D = \det(T)$. */
11 &nbsp;&nbsp;&nbsp;&nbsp; /* We perform the change of variables $x_1 \leftarrow z_1^{-w_2/D} z_2^{-v_2/D}$, $x_2 \leftarrow z_1^{-w_1/D} z_2^{v_1/D}$. */
11 &nbsp;&nbsp;&nbsp;&nbsp; $D \leftarrow \det(T) = v_1 w_2 - v_2 w_1$ /* Notice that $D = \pm 1$, because $v, w$ is a unimodal basis. */
12 &nbsp;&nbsp;&nbsp;&nbsp; $g_1 \leftarrow \text{numer}(f_1(z_1^{w_2/D} z_2^{-v_2/D}, z_1^{-w_1/D} z_2^{v_1/D}) - y_1) \in \mathbb{Z}[y_1, z_1, z_2]$;
13 &nbsp;&nbsp;&nbsp;&nbsp; $g_2 \leftarrow \text{numer}(f_2(z_1^{w_2/D} z_2^{-v_2/D}, z_1^{-w_1/D} z_2^{v_1/D}) - y_2) \in \mathbb{Z}[y_2, z_1, z_2]$;
14 &nbsp;&nbsp;&nbsp;&nbsp; $g \leftarrow \text{gcd}(g_1(y_1, z_1, 0), g_2(y_2, z_1, 0)) \in \mathbb{Z}[z_1]$;
15 &nbsp;&nbsp;&nbsp;&nbsp; $h \leftarrow \det(\text{Jac}_z(g_1, g_2)) \in \mathbb{Z}[y_1, y_2][z_1, z_2]$;
16 &nbsp;&nbsp; $\mathcal{J} \leftarrow \mathcal{J} \cup \text{CIM\_BY\_RESULTANT}(g_1, g_2, g, \mathbb{K})$;
17 &nbsp;&nbsp; **RETURN** $\mathcal{J}$;
## 5.1 Characterizing the edges

The first phase of SPARSEJELONEK-2 characterizes the edges (and the corresponding summands), see Sec. 3.1.2, of the Minkowski sum $\Delta = \Delta_1 \oplus \Delta_2$. In particular, it identifies the infinity edges $\Gamma \prec \Delta$ which are either semi-origin or pertinent. The characterization relies on the summands of $\Gamma$, say $(\Gamma_1, \Gamma_2)$. The algorithm for computing the Minkowski sum should check whether $\dim(\Gamma_i)$ is zero or not and if $\Gamma_i$ contains $\{0\}$ or not, for $i \in \{1, 2\}$, see Def. 3.1.

## 5.2 Computing the multiplicity sets

We consider only the semi-origin and the pertinent edges (Lem. 4.14). For each one them, say $\Gamma$ with summands $(\Gamma_1, \Gamma_2)$, the algorithm computes the A-multiplicity set, $AF_K(\Gamma)$, which is a superset of the T-multiplicity set $TF_K(\Gamma)$. The A-multiplicity set consists of the set of points $y \in \mathbb{K}^2$ for which there exists a particular transformation $U \in \text{SL}(2, \mathbb{Z})$ (see Section 4.1) such that $\bar{U}(f - y) = 0$ has more isolated solutions (counted with multiplicities) in $\mathbb{K}^* \times \{0\}$ than $\bar{U}f = 0$ has in $\mathbb{K}^* \times \{0\}$ (see Defs. 4.5 and 4.10).

First, we consider the semi-origin edges, Line 4 in SPARSEJELONEK-2 (Alg. 3). For each such $\Gamma$, we deduce from Remark 4.4 that after we restrict $f - y$ to $\Gamma$, we obtain univariate polynomials in a monomial $x_1^k x_2^l$ for some $k, l \in \mathbb{N}$; which in turn we consider it as new variable $t$.

Thus, $(f_1 - y_1)_{\Gamma} \in \mathbb{Z}[y_1, t]$ and $(f_2 - y_2)_{\Gamma} \in \mathbb{Z}[y_2, t]$, which is a parametric representation of $TF_K(\Gamma)$; see Lines 6, 7, and 8 of SPARSEJELONEK-2. We can obtain the implicit equation $TF_K(\Gamma)$ by eliminating the common variable $t$ from the system. The multiplicity set is a point, a parametrized curve, or a union of lines.

Next, we consider the pertinent edges, Line 9 of SPARSEJELONEK-2. Let $\Gamma \prec \Delta$ be pertinent. First, we transform the polynomials $f - y$, using a toric change of variables, to $g = (g_1, g_2) \in \mathbb{Q}[y_1, y_2][z_1, z_2]$, Lines 12 and 13, i.e., $g := \bar{U}(f - y)$. The change of variables corresponds to a $\Gamma$-basis for $A$ (see Sec. 4.1.) of the lattice $\mathbb{Z}^2$, Line 10.

Following Remarks 4.3, 4.4, and Lem. 4.14, the change of basis preserves the number of the 0-dimensional solutions and results in a simpler system to solve; actually a univariate one, Line 14.

We consider $\Gamma$ only if $\bar{U}f_{\Gamma} = 0$ has solutions in $\mathbb{K}^* \times \{0\}$; (see Remark 4.4 and Lem. 4.14). This excludes edges $\Gamma$ that are not semi-origin or not pertinent; see Lem. 4.14. Therefore, $g = 0$ has solutions $(\rho, 0) \in \mathbb{K}^* \times \{0\}$ whose multiplicity changes depending on whether $y$ belongs to the A-multiplicity set or not (Def. 4.5). For each above solution $\rho$ we compute a bivariate polynomial $J_{\rho} \in \mathbb{Z}[\rho][y_1, y_2]$ the zero set of which is a curve $K_{\rho} := \text{V}_{\mathbb{K}}(J_{\rho}) = AF_{\mathbb{K}}^{\rho}(\Gamma) \subset \mathbb{K}^2$, which the A-multiplicity set.

If $\mathbb{K} = \mathbb{C}$, then $TF_{\mathbb{C}}(\Gamma) = AF_{\mathbb{C}}(\Gamma)$ and the T-multiplicity set is the union of all $AF_{\mathbb{C}}^{\rho}(\Gamma)$; Prop. 4.16. If $\mathbb{K} = \mathbb{R}$, then we have to test whether certain distinguished

points, say $\{p_1, \dots, p_r\}$, in $AF_{\mathbb{R}}^{\rho}(\Gamma)$ (if any) are in the Jelonek set or not. That is, according to Cor. 4.21, we subdivide $AF_{\mathbb{C}}^{\rho}(\Gamma) \cap \mathbb{R}^2$ into $r+1$ open intervals separated by points in $D_f \cap AF_{\mathbb{C}}^{\rho}(\Gamma)$, $\text{Sing}(AF_{\mathbb{C}}^{\rho}(\Gamma))$, and so to avoid the discriminant and all other multiplicity sets.

If $p_i$ belongs to the Jelonek set, then $TF_{\mathbb{R}}(\Gamma)$ contains the interval $\ell_i \subset AF_{\mathbb{C}}^{\rho}(\Gamma) \cap \mathbb{R}^2$. The union of all such intervals forms $TF_{\mathbb{R}}(\Gamma)$. If $p_i$ is not in the Jelonek set, then we ignore this line segment.

We present Alg. MS_RESULTANT in Sec. 6.1 for computing the multiplicity of a solution of a bivariate system and the corresponding T-multiplicity sets.
## 5.3 Complexity and representation of the output

Let $f_1, f_2 \in \mathbb{Z}[x_1, x_2]$ be polynomials of degree $d$ and bitsize $\tau$. Also, assume that their Newton polytopes have at most $n$ edges. We go over the various steps of SPARSEJELONEK-2 to estimate their complexity.

*Initial computations.* First, we compute the Minkowski sum, Line 3. This costs $\tilde{O}(n)$ and results a polygon with at most $O(n)$ edges at its convex hull. We do this by slightly modifying the well known optimal algorithm [9, Sec. 13.3] for computing the Minkowski sum of two polygons to remember the summands of its edge of the sum.

*Computations with semi-origin edges.* Next, we consider the semi-origin edges of the Minkowski sum, Line 4 to 8; that is, edges having at least one summand containing 0. The most computational expensive operation is the computation of the roots (real or complex) of univariate polynomials; these are the polynomials $P_1(t)$ and $P_2(t)$ appearing at Lines 6 and 7. They come from the restriction of $f_1$ or $f_2$ on $\Gamma$ and so their degree is at most $d$ and bitsize at most $\tau$. The computation of their roots (real or complex) costs $\tilde{O}_B(d^3 + d^2\tau)$ [34]. As there are at most $O(n)$ semi-origin edges, the total cost of the first phase is $\tilde{O}_B(n(d^3 + d^2\tau))$.

Regarding the output of this phase, first we assume that $\mathbb{K} = \mathbb{R}$. If the real roots of $P_1 \in \mathbb{Z}[t]$ are $\gamma_1, \dots, \gamma_r$, then whenever $0 \notin \Gamma_2$, the output is a union of horizontal lines defined by numbers in $\mathbb{Z}[\gamma_i]$, for $i \in [r]$. Similarly for the case $0 \notin \Gamma_1$. When both $\Gamma_1$ and $\Gamma_2$ contain 0 (Line 8), then $\mathcal{J}_f$ is a parametrized polynomial curve, defined by polynomials in $\mathbb{Z}[t]$ of degree at most $d$ and bitsize at most $\tau$. For $\mathbb{K} = \mathbb{C}$, its implicit representation, consists of a polynomial in $\mathbb{Z}[y_1, y_2]$ of degree at most $d$ and maximum coefficient bitsize $\tilde{O}(d\tau)$. We compute it in $\tilde{O}_B(d^3\tau)$, e.g., [31]. If $\mathbb{K} = \mathbb{C}$ and $0 \in \Gamma_1$ (or $0 \in \Gamma_2$), then we represent the union of lines in a more unified way by considering the resultant $R_2(y) = \text{res}(y_2 - \sum_j b_j t^j, P_1(t), t) \in \mathbb{Z}[y_2]$. In this way we have the implicit representation $(y_1, R_2(y))$ for $\mathcal{J}_f$ whenever $\mathbb{K} = \mathbb{C}$ and a parametrized one when $\mathbb{K} = \mathbb{R}$.

*Computations with pertinent edges.* The last phase of the algorithm deals with pertinent edges. The first task consists in computing a unimodular basis that fits our needs Line 10 and Section 4.1. The most costly part of this procedure is the computation of the Smith Normal Form (SNF) of matrix. As the degree of the input polynomials is $O(d)$, this also bounds the dimension of the matrices. The cost of SNF is $\tilde{O}_B(d^{\omega+1})$ [39], where $\omega$ is the exponent of matrix multiplication.

After the toric change of variables we obtain a univariate polynomials and we compute its roots. Then, we compute the multiplicity sets by exploiting the multiplicities of the roots of the corresponding bivariate polynomial system. `MS_RESULTANT` (Alg. 4) computes the corresponding multiplicity sets in $\tilde{O}_B(d^7 + d^6\tau)$ for the complex case and $\tilde{O}_B(d^{19.11} + d^{18.11}\tau)$ in the real case. As there at most $n$ pertinent edges, we should multiply the previous bounds by $n$ to get the overall cost. The latter bounds dominate the complexity of the algorithm.

**Theorem 5.1.** Let $f = (f_1, f_2) : \mathbb{K}^2 \to \mathbb{K}^2$ be a dominant polynomial, where $f_1, f_2 \in \mathbb{Z}[x_1, x_2]$ are polynomials of size $(d, \tau)$ and their Newton polytopes have at most $n$ edges. SPARSEJELONEK-2 computes the Jelonek set of $f$ in $\tilde{O}_B(n(d^7+d^6\tau))$ over the complex and in $\tilde{O}_B(n(d^{19.11}+d^{18.11}\tau))$ over the real numbers.

If the polynomials are generic, then the complexity bound becomes significantly better.

**Corollary 5.2.** Let $f = (f_1, f_2) : \mathbb{K}^2 \to \mathbb{K}^2$ be a dominant polynomial, where $f_1, f_2 \in \mathbb{Z}[x_1, x_2]$ are polynomials of size $(d, \tau)$ and their Newton polytopes have at most $n$ edges. If $f_1$ and $f_2$ are generic, then SPARSEJELONEK-2 computes the Jelonek set of $f$ in $\tilde{O}_B(n(d^3 + d^2\tau))$.

*Proof.* When the input polynomials are generic, then the Minkowski sum of their Newton polytopes does contain a pertinent edge with probability 1. Therefore, the complexity of the algorithm
depends on the computation of the Minkowski sum and the manipulation of the semi-origin edges. The latter dominates the complexity bound. Its complexity is $\tilde{O}_B(n(d^3 + d^2\tau))$, as we have to solve $n$ times a univariate polynomial. □

**Remark 5.3.** The genericity property of the polynomials in Cor. 5.2 is with respect to fixed Newton polytopes and with respect to non-fixed ones.

## 5.4 An example

Let $\Delta := \Delta_1 \oplus \Delta_2$, where $\Delta_1$, and $\Delta_2$ are integer polytopes in $(\mathbb{R}_{\ge 0})^2$; they appear at the left hand side of Figure 2. The right hand side illustrates $\Delta$.

We want to compute the Jelonek set $\mathcal{J}_f$ of the map $f = (f_1, f_2) : \mathbb{K}^2 \to \mathbb{K}^2$, where

$$f_1 = 1 + x_1 x_2 + 2x_1^2 x_2^2 - \frac{7}{10} x_1^2 x_2 - 3x_1^3 x_2^2,$$

$$f_2 = 1 + 3x_1x_2 - 4x_1^2x_2^2 + 5x_1^3x_2^3 - 6x_1^4x_2^4 + \frac{37}{25}x_1^{10}x_2^4 - 54x_1^6x_2^3 + \frac{5103}{320}x_1^9x_2^3 - x_1^7x_2^2 + x_1^4x_2.$$

Figure 2 shows that $\mathrm{NP}(f) = \Delta$ has exactly six infinity edges; they are either pertinent or semi-origin (see Def. 3.1). Let $S_{01}, S_{02}, S_{13}, S_{24}, S_{35}, S_{46} \subset \mathbb{K}^2$, denote the corresponding multiplicity sets in $\mathbb{K}^2$ (see Def. 4.5) where

$$S_{ij} := \mathrm{TF}_{\mathbb{K}}(a_i \oplus b_j).$$

By Thm. 4.15, the union of the latter is $\mathcal{J}_f$. We apply SPARSEJELONEK-2 to compute $\mathcal{J}_f$.

* Edges $a_0 \oplus b_1$, $a_0 \oplus b_2$, and $a_1 \oplus b_3$ are infinity semi-origin and only $a_0$ contains $(0, 0)$. Therefore, Lines 7 and 8 of SPARSEJELONEK-2 results

$$S_{01} = \{(y_1, y_2) \in \mathbb{K}^2 \mid y_1 = 1, 1 + t = 0\} = \{y_1 = 1\},$$

$$S_{02} = \{(y_1, y_2) \in \mathbb{K}^2 \mid y_1 = 1, 1 - t = 0\} = \{y_1 = 1\},$$

$$S_{13} = \{(y_1, y_2) \in \mathbb{K}^2 \mid y_1 = 1 - 7t/10, 320 + 5163t = 0\} = \{y_1 - 761/729 = 0\}.$$

* The edge $a_4 \oplus b_6$ is origin, where $(0, 0) \in a_4$ and $(0, 0) \in b_6$. Then, Line 8 results

$$S_{46} = \{(y_1, y_2) \in \mathbb{K}^2 \mid y_1 = 1 + t + 2t^2, y_2 = 1 + 3t - 4t^2 + 5t^3 - 6t^4\}.$$

* Edges $a_2 \oplus b_4$, and $a_3 \oplus b_5$ are pertinent. Moreover, the systems $f|_{a_2 \oplus b_4} = 0$ and $f|_{a_3 \oplus b_5} = 0$ have solutions in $(\mathbb{K}^*)^2$. Then, we apply Lines 10–16 to $f$ for both edges. The algorithm outputs

$$\mathrm{AF}_{\mathbb{K}}(a_2 \oplus b_4) = \{y_1 + 1468/18225 = 0\} \text{ and } \mathrm{AF}_{\mathbb{K}}(a_3 \oplus b_5) = \{y_1 + 6238/10935 = 0\},$$

and the reader can check that $\mathrm{TF}_{\mathbb{K}}(a_2 \oplus b_4)$ and $\mathrm{TF}_{\mathbb{K}}(a_3 \oplus b_5)$ are non-empty when $\mathbb{K} = \mathbb{R}$.

# 6 Computing the multiplicity sets

Let $f: \mathbb{K}^2 \to \mathbb{K}^2$ be a dominant polynomial map sending $(0, 0)$ to $(\mathbb{K}^*)^2$ and $\Delta := \mathrm{NP}(f)$. In this section we present how to compute the T-multiplicity set, $\mathrm{TF}_{\mathbb{K}}(\Gamma)$, corresponding to a pertinent edge $\Gamma \prec \Delta$.
Following the process of SPARSEJELONEK-2, for a pertinent edge $\Gamma$, after we perform a toric change of variables, we obtain a bivariate polynomial system that has solutions of the form $(\rho, 0)$, for some complex (or real) $\rho$, Line 14. Each $\rho$ gives rise to the set $\mathbf{AF}_{\mathbb{K}}^{\rho}(\Gamma)$, where

$$ \mathrm{TF}_{\mathbb{K}}(\Gamma) \subseteq \mathrm{AF}_{\mathbb{K}}(\Gamma) = \bigcup_{\rho \in \mathrm{Sol}_{\mathbb{K}}(\Gamma)} \mathrm{AF}_{\mathbb{K}}^{\rho}(\Gamma). $$

The computation of $\mathbf{AF}_{\mathbb{K}}^{\rho}(\Gamma)$ depends on the multiplicity of $(\rho, 0)$. We present an algorithm MS_RESULTANT, for computing the multiplicity of $(\rho, 0)$ as a root of a bivariate polynomial system and then use it to compute the multiplicity set $\mathbf{AF}_{\mathbb{K}}^{\rho}(\Gamma)$. The algorithm exploits resultant computations and its worst case complexity is polynomial.

## 6.1 Resultant computations for the multiplicity set

The pseudo-code of the algorithm appears in Alg. 4 and its proof of correctness presents the details of the various steps.

**Proposition 6.1.** MS_RESULTANT, Alg. 4, correctly computes the A-multiplicity set $\mathbf{AF}_{\mathbb{K}}(\Gamma)$ that corresponds to a pertinent edge $\Gamma \prec \Delta$. The result is a (possibly empty) union $\bigcup_{\rho} K_{\rho}$ of finitely-many curves $K_{\rho}$ that are the zero loci of polynomials in $\mathbb{K}[y_1, y_2]$, where $\mathbb{K} \in \{\mathbb{R}, \mathbb{C}\}$ and $\rho$ runs over all points in $\mathbb{K}^*$.

*Proof.* Let $(\rho, 0)$ be a solution of $g_1 = g_2 = 0$, say of multiplicity $\mu$, where $g_i \in \mathbb{Z}[y_1, y_2][z_1, z_2]$. We will exploit the fact that if we project on $z_1$, then $\rho$ is a root of the resultant of multiplicity at least $\mu$.

We consider the resultant of $g_1$ and $g_2$ with respect to $z_2$. This results a polynomial $R_1 \in \mathbb{Z}[y_1, y_2][z_1]$. Obviously, $\rho$ is a root of $g$ of multiplicity at least $\mu$, say $\mu_1 \ge \mu$. We also know that $R_1$ factors as $R_1 = R_{11}R_{12}$, where $R_{11} \in \mathbb{Z}[z_1]$ and $R_{12} \in \mathbb{Z}[y_1, y_2][z_1]$. The presence of the factor $R_{11}$ is guaranteed because the system has solutions of the form $(\rho, 0)$. We divide out the factors of $R_1$ that depend only on $z_1$, that is $R_{11}$, and we end up with the polynomial $R_{12}$. If we do the substitution $z_1 = \rho$ to $R_{12}$, then the resulting polynomial $J_1$ is in $\mathbb{Z}[\rho][y_1, y_2]$ and it is non-zero. If we want $\rho$ to be of higher multiplicity as a root of $R_1$, then $J_1$ should be zero. Thus, $J_1$ is a superset of the part of the multiplicity set $\mathbf{AF}_{\mathbb{K}}^{\rho}(\Gamma)$ that emanates from $(\rho, 0)$. Then, we consider the resultant of $g_1$ and $g_2$ with respect to $z_1$. We proceed as before, mutatis mutandis, where now the $R_{21}$ is a power of $z_2$. At the end we compute a superset of the part of the multiplicity set $\mathbf{AF}_{\mathbb{K}}(\Gamma)$ emanating from $(\rho, 0)$.

If we want the solution $(\rho, 0)$ to have multiplicity higher than $\mu$ as a solution to the system $g_1 = g_2 = 0$, then both $\rho$ and 0 should be roots of higher multiplicity of the corresponding resultants, that is $R_1$ and $R_2$, respectively. Thus, the $\gcd$ of $J_1$ and $J_2$ should vanish. The latter is $J_{\rho} \in \mathbb{Z}[\rho][y_1, y_2]$ which is the implicit equation of a curve $K_{\rho} = \mathbf{AF}_{\mathbb{K}}^{\rho}(\Gamma)$ that is the A-multiplicity set. For the complex case, the A-multiplicity set $\mathbf{AF}_{\mathbb{C}}^{\rho}(\Gamma)$ is the T-multiplicity set $\mathbf{TF}_{\mathbb{C}}^{\rho}(\Gamma)$. For the real case, following Cor. 4.21, we have to check if a line segment of $\mathbf{AF}_{\mathbb{C}}^{\rho}(\Gamma) \cap \mathbb{R}^2$ belongs to $\mathbf{TF}_{\mathbb{R}}^{\rho}(\Gamma)$ or not.

By repeating the same procedure over all solutions $(\rho, 0)$ of the system $g_1 = g_2 = 0$, we obtain the T-multiplicity set $\mathbf{TF}_{\mathbb{R}}(\Gamma)$. $\square$

### 6.1.1 The complexity of the complex T-multiplicity set

**Theorem 6.2** (Complexity of MS_RESULTANT over $\mathbb{C}$). Consider the polynomials $g_1, g_2 \in \mathbb{Z}[y_1, y_2][z_1, z_2]$ which are of degree $d$ with respect to $z_1$ and $z_2$ and of degree $1$ with respect to $y_1$ and
$y_2$ and bitsize $\tau$. Let $g \in \mathbb{Z}[z_1]$ be of size $(d, \tau)$. The bit complexity of $\text{MS\_RESULTANT}(g_1, g_2, g, \mathbb{C})$, Alg. 4, is $\tilde{O}_B(d^7 + d^6\tau)$.

**Proof.** The resultant $R_1$ is a polynomial in $(z_1, y_1, y_2)$ of degree $(O(d^2), O(d), O(d))$ respectively [1, Prop. 8.49], and bitsize $\tilde{O}(d\tau)$ [1, Prop. 8.50]. To compute $R_1$ we employ fast subresultant algorithms, e.g., [31]. We perform $\tilde{O}(d)$ operations. Each operation consists of multiplying two trivariate polynomials in $z_1, y_1, y_2$; with degrees and bitsize as mentioned before. Each multiplications costs $\tilde{O}_B(d^5\tau)$ and so the overall costs for computing $R_1$ is $\tilde{O}_B(d^6\tau)$.

To compute $R_{12}$ we consider $R_1$ as a bivariate polynomial in $y_1$ and $y_2$ with coefficients in $\mathbb{Z}[z_1]$ and we compute its primitive part; that is to compute the gcd of all the coefficients and then divide all of them with it. The coefficients are polynomials in $z_1$ of degree $\tilde{O}(d^2)$ and bitsize $\tilde{O}_B(d\tau)$. We can compute their common gcd in $\tilde{O}_B(d^6 + d^5\tau)$ with Las Vegas algorithm [27, Lem. 2.2]. The cost of the exact division is dominated by the cost of this operation. The polynomial $R_{12} \in \mathbb{Z}[y_1, y_2][x_1]$ has degree(s) $(O(d^2), O(d), O(d))$ and bitsize $\tilde{O}(d^2 + d\tau)$.

The same complexity and bitsize bounds hold for the computation of $R_2$ and $R_{22}$.

The polynomial $g$ is of size $(d, \tau)$ and so the cost for solving is $\tilde{O}_B(d^3 + d^2\tau)$ [34]. Then, for each root of $g$, say $\rho$, we make the substitution $(z_1, z_2) \leftarrow (\rho, 0)$ to obtain the polynomials $J_1$ and $J_2$ and we compute their gcd, that is $J = \gcd(J_1, J_2) \in \mathbb{Z}[\rho][y_1, y_2]$. The latter is of degree $d$ with respect to both $y_1$ and $y_2$. Its coefficients are polynomials in $\rho$ of bitsize $\tilde{O}(d^3 + d^2\tau)$. The expected cost of the gcd is $\tilde{O}_B(d^6 + d^5\tau)$ [30], that is almost linear in the size of the output. As we have to do this at most $d$ times in the worst case, which corresponds to the different roots of $g$, the bounds follows for the complex case. $\square$

**Remark 6.3.** For the complex case, we can avoid working with algebraic numbers. We notice that we perform computations with all the roots of $g$ and so we exploit the Poisson formula of the resultant. Thus, we first consider the resultant of $R_{12}$ and $g$, that is $H \leftarrow \text{res}(R_{12}, g, z_1) \in \mathbb{Z}[y_1, y_2]$; this is the evaluation of $R_{12}$ over all the roots of $g$. Then, we consider the gcd with $R_{22}$, that is $\text{gcd}(R_{22}, H) \in \mathbb{Z}[y_1, y_2]$.

The theoretical complexity is same as considering each root independently and perform gcd computations in an extension field. The gain is that all the output polynomials have integer coefficients.

## 6.1.2 Testing the emptiness of $\text{TF}_{\mathbb{R}}^{\rho}(\Gamma)$ and its complexity

Our setting is as follows. Assume that for a pertinent edge $\Gamma \in \Delta$ we have performed the toric transformation to the system and have computed a real value $\rho$ resulting in a polynomial in $J_{\rho} \in \mathbb{Z}[\rho][y_1, y_2]$ the zero set of which is a curve $V_{\mathbb{R}}(J_{\rho}) = \text{AF}_{\mathbb{R}}^{\rho}(\Gamma) \subset \mathbb{R}^2$. Let us call this curve $C_{\rho}$. The degree of $J_{\rho}$, with respect to $y_1$ and $y_2$, is $O(d)$ and its coefficients are polynomials in $\rho$ of bitsize $\tilde{O}(d^3 + d^2\tau)$; also the $\rho$ is the real root of a polynomial of size $(O(d), \tilde{O}(d+\tau))$.

First, we check the condition of Thm. 4.22: We pick a point $p \in C_{\rho}$ and we compute the value $\delta := \mu_{\rho}(p) - \mu_{\rho}(0)$. Due to the preprocessing procedure, recall that $0 \notin \mathcal{J}_f$. If $\delta$ is odd, Thm. 4.22 shows that $C_{\rho} \subset \mathcal{J}_f$, and we are done. The complexity of this step is dominated by the complexity of the subsequent steps, so we do not elaborate further.

If Thm. 4.22 does not apply, then we need to consider the intersection points of $C_{\rho}$ with the discriminant of $f$, say $\mathcal{D}$. Recall that $\mathcal{D}$ is defined by a polynomial in $\mathbb{Z}[y_1, y_2]$ and has size $(\tilde{O}(d^2), \tilde{O}(d^2 + d\tau))$. Consequently, we partition $\mathcal{C}$ using these intersection points and we test which curve segments contribute to the Jelonek set of $f$.

To do so, we choose a generic point, say $p$, at each curve segment and we rely on the fact that the following two conditions are equivalent:
<caption>**Algorithm 4: MS_RESULTANT ($g_1, g_2, g, K$)**</caption>

**Input** : ($g_1, g_2) \in (\mathbb{Z}[y_1y_2])[z_1, z_2]$, $h \in \mathbb{Z}[z_1]$, $K \in \{\mathbb{R}, \mathbb{C}\}$
**Require:** The $g_1, g_2$ are the polynomials we obtain after we apply a toric change of variables to $f_1, f_2$, that corresponds to a pertinent edge $\Gamma$ of the Minkowski sum $\mathrm{NP}(f_1) \oplus \mathrm{NP}(f_2)$.
The distinct roots of $h$ are $\rho_1, \dots, \rho_r$, and $(\rho_i, 0)$ is a solution to the system $g_1 = g_2 = 0$, for all $i \in [r]$. Notice that $h(z_1) = c \prod_{i=1}^r (z_1 - \rho_i)^{\mu_i}$, where $c \in \mathbb{Z}$.
**Output**: The multiplicity set $M_f(\Gamma)$ corresponding to a pertinent edge $\Gamma$.

1 & $R_1 \leftarrow \mathrm{res}(g_1, g_2, z_2)$; \\
   & /* It holds $R_1 = R_{11}R_{12}, R_{11} \in \mathbb{Z}[z_1], R_{12} \in \mathbb{Z}[y_1, y_2][z_1]$ */ \\
   & /* In particular $R_{11}(z_1) = c_1 \prod_{i=1}^m (z_1 - \rho_i)^{\mu_{1,i}}$ and $c_1 \in \mathbb{Z}$. */
2 & $R_2 \leftarrow \mathrm{res}(g_1, g_2, z_1)$; \\
   & /* It holds $R_2 = R_{21}R_{22}, R_{21} \in \mathbb{Z}[z_2], R_{22} \in \mathbb{Z}[y_1, y_2][z_2]$ */ \\
   & /* In particular, $R_{21} = z_2^{\mu_2}$, for some $\delta_2 \in \mathbb{N}$. */
3 & $\mathrm{TF}_K(\Gamma) \leftarrow \emptyset$; \\
4 & **if** $K = \mathbb{R}$ **then** \\
   & 5 & **for** every real root $\varrho$ of $g$ **do** \\
   & 6 & & $J_1 \leftarrow \mathrm{subs}(z_1 = \varrho, R_{12})$; \\
   & 7 & & $J_2 \leftarrow \mathrm{subs}(z_2 = 0, R_{22})$; \\
   & 8 & & $J_\rho \leftarrow \mathrm{gcd}(J_1, J_2) \in \mathbb{Z}[\rho][y_1, y_2]$; \\
   & 9 & & Partition $\mathcal{V}(J_\rho)$ to curve segments based on its topology; \\
   & 10 & & Check which segments contributes to the Jelonek set; \\
   & 11 & **if** $K = \mathbb{C}$ **then** \\
   & 12 & & $H \leftarrow \mathrm{res}(R_{12}, g, z_1) = \prod_{g(\rho)=0} R_{12}(\varrho, y_1, y_2) \in \mathbb{Z}[y_1, y_2]$; \\
   & 13 & & $J \leftarrow \mathrm{gcd}(R_{22}, H) \in \mathbb{Z}[y_1, y_2]$; \\
   & 14 & & $\mathrm{TF}_K(\Gamma) \leftarrow \mathcal{V}(J)$; \\
   & 15 & **RETURN** $\mathrm{TF}_K(\Gamma)$;

(C1) The point $p$ is a generic point in $\mathcal{J}_f$.

(C2) There exists a point $q \notin \mathcal{J}_f$ outside a small-enough ball in $\mathbb{R}^2$ around $p$ such that the number of real solutions (counted with multiplicities) of $f - p = 0$ is smaller than the number of real solutions to $f - q = 0$.

**Partition $C_\rho$ to curve segments** Our strategy to partition $C_\rho$ is as follows. We compute the topology of $C_\rho$, that is an abstract graph that is isotopic to the curve in $\mathbb{R}^2$ [4, p. 184]. Then, we further refine the graph by considering the intersection points with $\mathcal{D}_f$. This algorithm also provides points on its of the corresponding curve segments.

To compute the topology of $C_\rho$ we employ the state-of-the-art algorithm in [10]. Unfortunately, this algorithm considers polynomials with integer coefficients, which is not our case. We notice that the bottleneck in the algorithm for the computing the topology is the projection on the coordinate axis and the solutions of univariate polynomials; the solution of which correspond to the coordinates of the critical points of the curve. The project $C_\rho$ on the $y_1$ (or $y_2$ axis) we consider the resultant of $\mathcal{J}_\rho$, and its derivative with respect to $y_1$, we eliminate $y_2$ and we obtain a polynomial in $y_1$. The projection costs $\tilde{\mathcal{O}}_B(d^6\tau)$ [12, Prop. 8]. This results a univariate polyno-
mial in $\mathbb{Z}[\rho][y_1]$ of size $(\tilde{O}(d^2), \tilde{O}(d\tau))$. We can solve this polynomial, that have coefficients in an extension field, in $\tilde{O}_B(d^{11}+d^{10}\tau)$ [40]. The latter bound dominates the complexity of computing the topology of $C_\rho$.

Then we need to consider the intersection points of $C_\rho$ and $\mathcal{D}_f$. This costs less that computing the topology of $C_\rho$ as the latter (implicitly) requires to solve the system of $\mathcal{J}_\rho$ and its derivatives and it involves polynomials of higher degree and bitsize than the polynomial defining $\mathcal{D}_f$.

At this point we can assume that we have partitioned $C_\rho$ to curve segments and we have computed a generic point at each, say $p$. One the coordinates is a rational number of bitsize at most $\tilde{O}(d^7 + d^6\tau)$.

Therefore, it suffices to test condition (C2) for a point $p$ in $C_\rho$. To do this, we perform the following steps.

(S1) We compute a point $q = (q_1, q_2) \in \mathbb{R}^2$ such that the segment from $p$ to $q$ does not intersect any other curve $C_{\rho'}$ and the discriminant curve of $f$. The curves $C_{\rho'}$ correspond to A-multiplicity sets emanating from other roots $\rho'$ and/or edges of $\mathrm{NP}(f)$. We obtain the discriminant curve by eliminating $x_1$ and $x_2$ from the equations $\{f_1(x_1, x_2) - y_1, f_2(x_1, x_2) - y_2, \det(\mathrm{Jac}(f_1, f_2))\}$.

(S2) We check whether the systems $f - p = 0$ and $f - q = 0$ have the same number of real solutions. If this is the case, then the curve segment of $C_\rho$ that $p$ belongs to does is not part of the multiplicity set $\mathrm{TF}_{\mathbb{R}}(\Gamma)$, following Def. 4.5.

The above three steps are enough for our purposes: The set $\mathbb{R}^2 \setminus \mathcal{D}_f \cup \mathcal{J}_f$ is a union of connected components, each of which has a constant number of real preimages under $f$. A ball $B$ small enough around a generic point $p \in C_\rho$ is either included in one of the components of $\mathbb{R}^2 \setminus \mathcal{D}_f \cup \mathcal{J}_f$ or intersects exactly two of them. Assume that $p \in \mathcal{D}_f$.

We conclude from condition (C2) that if we sample two points $q$ and $q'$, following (S1), then they belong to two different connected components of $\mathbb{R}^2 \setminus \mathcal{D}_f \cup \mathcal{J}_f$ adjacent to $\mathcal{J}_f$ if and only if the number of real solutions (counted with multiplicities) of the system $f - p = 0$ is smaller than that of either $f - q = 0$, or $f - q' = 0$.

There is a straightforward way of realizing the steps to test the where the corresponding curve segment contributes to the Jelonek set by solving various polynomial systems. Instead, we will avoid solving systems (as much as possible) and we will rely on (separation) bounds of their roots [14] to compute the points of interest.

The polynomial $J_\rho$ has degree $\mathcal{O}(d)$ with respect to $\rho$, $y_1$, and $y_2$ and its bitsize is $\mathcal{O}(d^3+d^2\tau)$ [30, 30]; the latter follows from the gcd computations in an extension field.

(S1) Compute the intermediate point $q$ One of the coordinates of $p$ is a rational number. Assume, without loss of generality that this is the second one and its value is $c$. That is $p = (p_1, c)$, where $p_1$ is a root of $J_{\rho,c} \in \mathbb{Z}[\rho][y_1]$ of degree $d$ and bitsize $\tilde{O}(d^8 + d^7\tau)$. Consider the line $y_2 = c$ and the intersection of this line with all the other curves, say $C_{\rho'}$ with equation $J_{\rho'}(y_1, y_2)$ that correspond to other multiplicity sets, and the discriminant curve of $f$. Let the closest intersection to $p$ be a point $p'$. Then it suffices to choose the middle point of the segment $pp'$. Even more, we can estimate, using root bounds how close to $p$ the point $p'$ could be in the worst case. Then choose a point $q$ that it closest to $p$ with respect to this worst case estimation. Using root bounds, there is no need to solve the corresponding equations.

Regarding the curves corresponding to multiplicity sets, the polynomials $J_{\rho'} \in \mathbb{Z}[\rho'][y_1, y_2]$ have degree $\mathcal{O}(d)$ and bitsize $\tilde{O}(d^3 + d^2\tau)$. Therefore, if we substitute $c$ for $y_2$, we end up with a polynomial in $J_{\rho',c} \in \mathbb{Z}[\rho'][y_1]$; it has degree $d$ and bitsize $\tilde{O}(d^8 + d^7\tau)$.
<figure><img src="image_8.png" /><figcaption>Figure 5: How to test a curve segment of $C_\rho$ contributes to the Jelonek set. The horizontal line $y_1 = p_1$ intersects the other curves of other multiplicity sets. If $p'$ is the closest intersection to $p$, then $q$ is a point in the segment $pp'$.</figcaption></figure>

Now, we consider the polynomial $J_{\rho,c} J_{\rho',c} \in \mathbb{Z}[\rho, \rho'][y_1]$. Then, among its roots are the $p_1$ and the first coordinate of the closest point of $C_{\rho'}$ to $p'$, say $p'_1$. Therefore, the separation bound $|p_1 - p'_1| \ge 2^{-\tilde{O}(d^{10} + d^9\tau)}$ [41] gives a way to choose (the first coordinate) of the intermediate point $q$. Hence, the bitsize of the coordinates of $q$ is $\tilde{O}(d^7 + d^6\tau)$.

Consider the system $f_1(x_1, x_2) - y_1 = f_2(x_1, x_2) - y_2 = \det(J_{ac}(f_1, f_2)) = 0$. This is a system of three equations in four variables. If we eliminate $x_1$ and $x_2$, then we obtain a polynomial $\mathcal{D} \in \mathbb{Z}[y_1, y_2]$ which is the discriminant of $f$. It has degree $\mathcal{O}(d^2)$ and its bitsize is $\tilde{O}(d^2\tau)$. Then, we work similarly as in the case of the curves that correspond to the multiplicity sets. The bounds for $q$ are similar.

To summarize, if we add a number of order $2^{\tilde{O}(d^{10}+d^9\tau)}$ to the coordinates of $p$, then we obtain a point $q$ such that the segment $pq$ does not intersect neither any other curve corresponding to another multiplicity set, nor the discriminant curve.

**(S2) Count the number of real roots** Having computed the points $p = (p_1, p_2) \in K_\rho$ and $q = (q_1, q_2)$ it remains to compute the real roots of the systems $f(x_1, x_2) - p = 0$ and $f(x_1, x_2) - q = 0$.

The second system consists of polynomials in $\mathbb{Z}[y_1, y_2]$ of degree $d$ and bitsize $\tilde{O}(d^{10} + d^9\tau)$.

Using [6], we can solve the system and thus compute its real roots in $\tilde{O}_B(d^{14.37} + d^{13.37}\tau)$, using the fastest algorithm for matrix multiplicaiton.

The polynomials of the first system have coefficients in an extension field. Recall that $p_1 = c \in \mathbb{Z}$, where $c \le 2^{\tilde{O}(d^7+d^6\tau)}$ and $p_2$ is a root of a polynomial $J_\rho(c, y_1) \in \mathbb{Z}[\rho][y_1]$ and $\rho$ is a real root of the polynomial $g(z_1) = 0$. Thus, we can compute the real roots of $f(y_1, y_2) - p = 0$ by computing the real solutions of the system

$$f_1(x_1, x_2) - y_1 = f_1(x_1, x_2) - c = J_{z_1}(c, y_1) = g(z_1) = 0.$$

This is a system of four equations in four unknowns, that is $x_1, x_2, y_1, z_1$. The degree of the polynomials is bounded by $\mathcal{O}(d)$ and their bitsize is $\tilde{O}(d^7 + d^6\tau)$. We can solve this system in $\tilde{O}_B(d^{22.11} + d^{21.11}\tau)$ [6]. The latter bound dominates the complexity of the overall procedure.

**Lemma 6.4.** *The complexity of testing emptiness of $\text{TF}_{\mathbb{R}}^\rho(\Gamma)$ is $\tilde{O}_B(d^{22.11} + d^{21.11}\tau)$.*
**Theorem 6.5 (Complexity of MS_RESULTANT over $\mathbb{R}$).** Consider the polynomials $g_1, g_2 \in \mathbb{Z}[y_1, y_2][z_1, z_2]$ which are of degree $d$ with respect to $z_1$ and $z_2$ and of degree $1$ with respect to $y_1$ and $y_2$. Let $g \in \mathbb{Z}[z_1]$ be of degree $d$ and bitsize $\tau$. The bit complexity of $\text{MS_RESULTANT}(g_1, g_2, g, \mathbb{R})$, Alg. 4, $\tilde{O}_B(d^{22.11} + d^{21.11}\tau)$.

# 7 Implementation

We have implemented in MAPLE a prototype version of our algorithm for computing the Jelonek set, SPARSEJELONEK-2 (Alg. 3). We have also implemented Jelonek's algorithm [21] (Alg. 2). Our code also uses CONVEX [17] to perform some polyhedral computations and to MULTIRES<fnref n="2" /> to perform some polynomial manipulations.

A sample use of our software to compute the Jelonek set of the polynomials $(f_1, f_2) = 1 + xy + 2x^2y^2 - 7x^2y/10 - 3x^3y^2, g := 1 + 3xy - 4x^2y^2 + 5x^3y^3 - 6x^4y^4 + 3^7x^{10}y^4/2^5 - 54x^6y^3 + 5103x^9y^3/320 + x^7y^2 + x^4y)$ is as follows:

```
restart;
libname := "path to convex library", libname:
with(convex):
read("/path to/multires.mpl");
read("/path to/Jelonek.mpl");
f := 1 + x*y + 2*x^2*y^2 - 7*x^2*y/10 - 3*x^3*y^2;
g := 1 + 3*x*y - 4*x^2*y^2 + 5*x^3*y^3 - 6*x^4*y^4 + 3^7*x^4*(10*y^4/2^5 - 54*x^4*y^3 + 5103*x^3*y^2 + 9*y^3/320 + x^7*y^2 + x^4*y);
SJ := Sparse_Jelonek_2;
SJ:=init([f, g]);
SJ:-compute();
```

The output is

$$-150304 + 349920y_1 = 32(10935y_1 - 4697)$$

To compute using Jelonek's algorithm, we type

```
Jelonek_2([f, g], u, v);
```

The output is

$$-\frac{1}{64000}(4428675 y_1 - 4071951)(729 y_1 - 761)(y_1 - 1)^2(10935 y_1 - 4697) \\ (9 y_1^4 - 32 y_1^3 + 12 y_1^2 y_2 + 5 y_1^2 + 19 y_1 y_2 + 4 y_2^2 - 35 y_1 - 25 y_2 + 43)$$

As we can see, it contains a superset of the Jelonek set.

**Acknowledgments** BEH is supported by the DFG Walter Benjamin Program grant EL 1092/1-1. Part of this work was supported by the Austrian Science Fund (FWF): P33003. This work was initiated while BEH was at the Institute of Mathematics at the Polish Academy of Sciences in Warsaw. Thanks to Zbigniew Jelonek for presenting the problem and to Piotr Migus for fruitful discussions. ET is supported by the ANR JCJC GALOP (ANR-17-CE40-0009), the PGMO grant ALMA, and the PHC GRAPE.

<footnote n="2">²http://www-sop.inria.fr/members/Bernard.Mourrain/multires.html</footnote>
References

[1] S. Basu, R. Pollack, and M-F.Roy. *Algorithms in Real Algebraic Geometry*, volume 10 of *Algorithms and Computation in Mathematics*. Springer-Verlag, 2003. ISBN 3-540-00973-6.

[2] D. N. Bernstein. The number of roots of a system of equations. *Funkcional. Anal. i Priložen.*, 9(3):1–4, 1975. ISSN 0374-1990.

[3] C. Bivià-Ausina. Injectivity of real polynomial maps and Łojasiewicz exponents at infinity. *Math. Z.*, 257(4):745–767, 2007.

[4] J.-D. Boissonnat and M. Teillaud. *Effective computational geometry for curves and surfaces*. Springer, 2007.

[5] Y. Bouzidi, S. Lazard, G. Moroz, M. Pouget, F. Rouillier, and M. Sagraloff. Solving bivariate systems using rational univariate representations. *Journal of Complexity*, 37:34–75, 2016.

[6] C. Brand and M. Sagraloff. On the complexity of solving zero-dimensional polynomial systems via projection. In *Proc. ACM on International Symposium on Symbolic and Algebraic Computation (ISSAC)*, pages 151–158, 2016.

[7] Y. Chen, L. R. G. Dias, K. Takeuchi, and M. Tibăr. Invertible polynomial mappings via newton non-degeneracy. In *Annales de l'Institut Fourier*, volume 64, pages 1807–1822, 2014.

[8] D. A. Cox, J. Little, and D. O'shea. *Using algebraic geometry*, volume 185. Springer, 2006.

[9] M. de Berg, O. Cheong, M. Van Kreveld, and M. Overmars. *Computational geometry algorithms and applications*. Springer, 3rd edition, 2008.

[10] D. N. Diatta, S. Diatta, F. Rouillier, M.-F. Roy, and M. Sagraloff. Bounds for polynomials on algebraic numbers and application to curve topology. *Discrete & Computational Geometry*, 67(3):631–697, 2022.

[11] A. Dickenstein. Biochemical reaction networks: an invitation for algebraic geometers. In *Mathematical Congress of the Americas*, volume 656 of *Contemp. Math.*, pages 65–83. Amer. Math. Soc., Providence, RI, 2016. doi: 10.1090/conm/656/13076. URL https://doi.org/10.1090/conm/656/13076.

[12] D. I. Diochnos, I. Z. Emiris, and E. P. Tsigaridas. On the asymptotic and practical complexity of solving bivariate systems over the reals. *Journal of Symbolic Computation*, 44(7):818–835, 2009.

[13] T. Duff, K. Kohn, A. Leykin, and T. Pajdla. Plmp-point-line minimal problems in complete multi-view visibility. In *Proceedings of the IEEE International Conference on Computer Vision*, pages 1675–1684, 2019.

[14] I. Emiris, B. Mourrain, and E. Tsigaridas. Separation bounds for polynomial systems. *Journal of Symbolic Computation*, 101:128–151, 2020. ISSN 0747-7171.

[15] A. Esterov. The discriminant of a system of equations. *Advances in Mathematics*, 245:534–572, 2013.

[16] J. F. Fernando and J. Gamboa. Polynomial images of $\mathbb{R}^n$. *J. Pure Appl. Algebra*, 179(3):241–254, 2003.
[17] M. Franz. Convex (1.2.0), 2016. URL https://math.sci.uwo.ca/~mfranz/convex/.

[18] J. Gwoździewicz. Real jacobian mates. *Annales Polonici Mathematici*, 117(3):207-213, 2016.

[19] Z. Jelonek. The set of points at which a polynomial map is not proper. In *Annales Polonici Mathematici*, volume 58, pages 259-266. Instytut Matematyczny Polskiej Akademii Nauk, 1993.

[20] Z. Jelonek. Testing sets for properness of polynomial mappings. *Mathematische Annalen*, 315(1):1-35, 1999.

[21] Z. Jelonek. Note about the set $S_f$ for a polynomial mapping $f: \mathbb{C}^2 \to \mathbb{C}^2$. *Bull. Polish Acad. Sci. Math.*, 49(1):67-72, 2001. ISSN 0239-7269.

[22] Z. Jelonek. Geometry of real polynomial mappings. *Mathematische Zeitschrift*, 239(2): 321-333, 2002.

[23] Z. Jelonek and K. Kurdyka. On asymptotic critical values of a complex polynomial. *J. Reine Angew. Math.*, 565:1-11, 2003. ISSN 0075-4102. doi: 10.1515/crll.2003.101. URL https://doi.org/10.1515/crll.2003.101.

[24] Z. Jelonek and M. Lasoń. The set of fixed points of a unipotent group. *J. Algebra*, 322 (6):2180-2185, 2009. ISSN 0021-8693. doi: 10.1016/j.jalgebra.2009.06.007. URL https://doi.org/10.1016/j.jalgebra.2009.06.007.

[25] Z. Jelonek and M. Lasoń. Quantitative properties of the non-properness set of a polynomial map. *Manuscripta Mathematica*, 156(3-4):383-397, 2018.

[26] Z. Jelonek and M. Tibăr. Detecting asymptotic non-regular values by polar curves. *International Mathematics Research Notices*, 2017(3):809-829, 2017.

[27] C. Katsamaki, F. Rouillier, E. P. Tsigaridas, and Z. Zafeirakopoulos. On the geometry and the topology of parametric curves. In I. Z. Emiris and L. Zhi, editors, *ISSAC '20: International Symposium on Symbolic and Algebraic Computation*, Kalamata, Greece, July 20-23, 2020, pages 281-288. ACM, 2020.

[28] A. G. Khovanskii. Newton polytopes and irreducible components of complete intersections. *Izvestiya: Mathematics*, 80(1):263, 2016.

[29] A. G. Kouchnirenko. Polyèdres de Newton et nombres de Milnor. *Invent. Math.*, 32(1):1-31, 1976.

[30] L. Langemyr. An asymptotically fast probabilistic algorithm for computing polynomial GCD's over an algebraic number field. In *International Symposium on Applied Algebra, Algebraic Algorithms, and Error-Correcting Codes*, pages 222-233. Springer, 1990.

[31] T. Lickteig and M.-F. Roy. Sylvester-Habicht sequences and fast Cauchy index computation. *J. Symb. Comput.*, 31(3):315-341, Mar. 2001. doi: 10.1006/jsco.2000.0427. URL https://doi.org/10.1006/jsco.2000.0427.

[32] A. Némethi and A. Zaharia. On the bifurcation set of a polynomial function and newton boundary. *Publications of the Research Institute for Mathematical Sciences*, 26(4):681-689, 1990.
[33] L. Pachter and B. Sturmfels, editors. *Algebraic statistics for computational biology*. Cambridge University Press, New York, 2005. ISBN 978-0-521-85700-0; 0-521-85700-7. doi: 10.1017/CBO9780511610684. URL https://doi.org/10.1017/CBO9780511610684.

[34] V. Y. Pan. Univariate polynomials: nearly optimal algorithms for numerical factorization and root-finding. *Journal of Symbolic Computation*, 33(5):701–733, 2002.

[35] F. Rouillier. Solving zero-dimensional systems through the rational univariate representation. *Applicable Algebra in Engineering, Communication and Computing*, 9(5):433–461, 1999.

[36] J. Schicho. And yet it moves: Paradoxically moving linkages in kinematics. *arXiv preprint arXiv:2004.12635*, 2020.

[37] A. Stasica. An effective description of the Jelonek set. *Journal of Pure and Applied Algebra*, 169(2-3):321–326, 2002.

[38] A. Stasica. Geometry of the Jelonek set. *Journal of Pure and Applied Algebra*, 198(1-3): 317–327, 2005.

[39] A. Storjohann. Near optimal algorithms for computing smith normal forms of integer matrices. In *Proceedings of the 1996 international symposium on Symbolic and algebraic computation*, pages 267–274, 1996.

[40] A. Strzebonski and E. Tsigaridas. Univariate real root isolation in an extension field and applications. *Journal of Symbolic Computation*, 92:31–51, 2019.

[41] A. Strzeboński and E. P. Tsigaridas. Univariate real root isolation in multiple extension fields. In *Proc. ACM on International Symposium on Symbolic and Algebraic Computation (ISSAC)*.

[42] N. T. Thao. A condition for the properness of polynomial maps. *Vietnam Journal of Mathematics*, 37(1):113–125, 2009.

[43] A. Valette-Stasica. Asymptotic values of polynomial mappings of the real plane. *Topology Appl.*, 154(2):443–448, 2007. ISSN 0166-8641. doi: 10.1016/j.topol.2006.06.001. URL https://doi.org/10.1016/j.topol.2006.06.001.

[44] A. Van den Essen. *Polynomial Automorphisms: and the Jacobian Conjecture*, volume 190. Birkhäuser, 2012. doi: 10.1007/978-3-0348-8440-2.

[45] C.-K. Yap. *Fundamental problems of algorithmic algebra*. Oxford University Press, New York, 2000. ISBN 978-0-19-512516-0.

[46] A. Zaharia. On the bifurcation set of a polynomial function and Newton boundary. II. *Kodai Math. J.*, 19(2):218–233, 1996. ISSN 0386-5991. doi: 10.2996/kmj/1138043601. URL https://doi.org/10.2996/kmj/1138043601.