1 Introduction

The medial axis, introduced by Blum in [1] as a central object in pattern recognition, emerges under various names in numerous mathematical and application problems. Lossless compression of data makes it an appealing object in tomography, robotics, or simulation. At the same time, its natural definition appears in various versions also in the fields of partial differential equations or convex analysis. Indeed, the medial axis is precisely the locus of points where the set distance function ceases to be differentiable. The distance function, on the other hand, is a viscosity solution for the most simple eikonal equation \(\Vert \nabla d\Vert =1\) with the zero Dirichlet condition [2]. While it is a first-order equation, it is natural to wonder where the solution is \(\mathscr {C}^1\)-smooth. A deep connection with the initial set geometry makes the medial axis an interesting object for investigating geometrical and topological properties such as sets singularities [3] or homotopy groups [4]. The object also attains increasing attention in the context of Riemannian manifolds, where sets closely related to medial axes are studied under the name of cut loci [5,6,7]. However, extreme attention to detail is advised while studying the Riemannian generalisation as one has to take notice of non-Euclidean phenomena such as the existence of conjugate points or several geodesics with common endpoints, which stirs up the cut locus definition.

As medial axes are closely related to the extensively developed notion of conflict sets, one can believe that most of the theorems concerning conflict sets should have their counterparts in the medial axis theory. Unfortunately, the medial axes are (in)famous for their instability [8,9,10]. Thus the proofs are seldom transferable between the theories concerning these two objects. The main result of the present paper is a proof of the medial axis analogue of [11] Theorem 2.2. Since the proof presented by Birbrair and Siersma depends heavily on the monotonicity of Conflict Sets—a phenomenon with no counterpart in the medial axis setting—we are forced to develop an entirely new approach to the problem based on an analysis of the graph of the distance function. A similar problem was studied in a slightly broader sense and on the grounds of the convex analysis in [12]. Focusing precisely on the medial axis, we are able to provide more rigid results and formulæ. An immediate application of the result answers the question about the dimension of a medial axis raised in [13, 14]. Later in the paper, potentially troublesome points of the medial axis’ frontier are characterised by a limiting directional reaching radius, an object combining the virtues of the Birbrair–Denkowski reaching radius [3] and Miura’s radius of curvature [15]. It is adapted for the study of sets with higher codimension, and it also provides insights into the Birbrair–Denkowski archetype.

In this paper we restrict our attention to sets that are definable in the o-minimal structures expanding the field of real numbers. Such an approach gives us a framework with a handful of valuable tools. Firstly, the Hausdorff dimension of a definable set is always an integer and corresponds with the highest dimensional real vector space possible to map injectively into the set. Furthermore, the Curve Selection Lemma holds, meaning that every point in the closure of a definable set can be approached by a curve contained in the set. At the same time, the setting chosen protects us from pathological Cantor-like sets while conserving the applicability of the setting. Readers who are not familiar with the notion of definable sets may think of them as semialgebraic sets. An excellent introduction to the notion is found in [16, 17].

Whenever in the paper the continuity (or upper- and lower limits) of a family of sets or a (multi-) function is mentioned, it refers to the continuity (or upper- and lower limits) in the Kuratowski sense (more on the Kuratowski convergence is found in the book [18], an introduction to its relation with medial axes is given in [19]). For a pair of vectors \(x,y\in {\mathbb {R}}^n\), we denote by [xy] the closed segment joining x and y, by \(\langle x,y\rangle \) their standard scalar product, and by \(\angle (x,y)\) the angle formed by these vectors, provided they are nonzero. A closed ball centred at a, of radius r, is denoted by \({\mathbb {B}}(a,r)\), and \({\mathbb {S}}(a,r)\) denotes its boundary—an \((n-1)\)-dimensional sphere of radius r centred at a.

For a closed, nonempty subset X of \({\mathbb {R}}^n\) endowed with the Euclidean norm, we define the distance of a point \(a\in {\mathbb {R}}^n\) to X by

$$\begin{aligned} d(a,X)=d_X(a):= \inf \{ \Vert a-x\Vert :\,x\in X\}, \end{aligned}$$

which allows us to introduce the set of closest points in X to a as

$$\begin{aligned} m_X(a):=\{ x\in X\mid d(a,X)=\Vert a-x\Vert \}. \end{aligned}$$

We will usually drop the indices of the (multi-)functions d and m.

The main object discussed in this paper is the medial axis of X denoted by \(M_X\), that is, the set of points of \({\mathbb {R}}^n\) admitting more than one closest point in the set X, namely

$$\begin{aligned} M_X:=\{ a\in {\mathbb {R}}^n\mid \# m(a)>1\}. \end{aligned}$$

A descriptive way, the most often invoked, to imagine the medial axis, brings an image of the propagation of a fire front starting at X. In this case, the medial axis of X is precisely the set of points where fronts originating from different starting points meet. This picturesque idea illustrates maybe the most profound feature of the medial axis—it collects exactly those points of the ambient space, at which the distance function is not differentiable (Fig. 1).

Fig. 1
figure 1

Examples of medial axes (in grey) of Euclidean plane subsets. A The graph of the function \(y=x^2\). B The graph of the function \(y=\sqrt{1-x^2}\). C The silhouette of Pikachu

As an introductory remark, it is worth recalling that, as was shown in [13], both the medial axis and the multifunction m(x) are definable in the same structure as X. Moreover, the multifunction m(x) is upper (outer) semi-continuous, meaning

$$\begin{aligned} \limsup _{A\ni a\rightarrow a_0} m(a)\subset m(a_0) \end{aligned}$$

for any set A with \(a_0\) in its closure.

2 The tangent cone of the medial axis

Let us begin by recalling that we have an explicit formula for the directional derivative of the distance function due to Richard von Mises [20] (most often misquoted as M. R. de Mises, the first ‘M.’ clearly standing for Monsieur, see also [21]).

Theorem 2.1

(R. von Mises) Let X be a closed, nonempty subset of \({\mathbb {R}}^n\), then for every point \(a\in {\mathbb {R}}^n\backslash X\) all one-sided directional derivatives of the distance function \(d_X\) exist and are equal to

$$\begin{aligned} D_v d_X(a)=\inf \left\{ -\left\langle v,\frac{x-a}{\Vert x-a\Vert }\right\rangle ,\, x\in m(a)\right\} . \end{aligned}$$

Proof

For any \(a,b\in {\mathbb {R}}^n\), there is \(\langle a,b\rangle =\Vert a\Vert \Vert b\Vert \cos \alpha \), where \(\alpha \) denotes the angle between a and b. Thus, for \(\Vert v\Vert =1\) the assertion can be written as

$$\begin{aligned} D_v d_X(a)=\inf \{ -\cos \alpha _x,\, x\in m(a)\}, \end{aligned}$$

where \(\alpha _x\) is the angle between \(x-a\) and v. Clearly, the value of \(-\cos \alpha \) will be the smallest for the smallest \(\alpha \). Without loss of generality, assume \(v=(1,0,\ldots ,0)\) and \(a=0\), then take \(x_0\in m(0)\) forming the smallest angle with v, and \(x_t\in m(tv)\) for \(t>0\). Since \(\Vert x_t-tv\Vert \le \Vert x_0-tv\Vert \) we obtain

$$\begin{aligned} \Vert x_t\Vert ^2-\Vert x_0\Vert ^2\le 2t(x_{t}^{(1)}-x_{0}^{(1)}), \end{aligned}$$

where \(x_{t}^{(1)}\) is the first coordinate of \(x_t\). Note, that since \(x_t\notin int \,{\mathbb {B}}(0,d(0))\), there is, in particular,

$$\begin{aligned} 0\le x_{t}^{(1)}-x_{0}^{(1)}. \end{aligned}$$

Denote now by \(\alpha _t\) the angle formed by v and \(x_t\). By the Cosinus Theorem applied to the triangle formed by \(tv,0,x_t\), we have

$$\begin{aligned} d(tv)^2=\Vert x_t\Vert ^2+t^2-2\Vert x_t\Vert t\cos \alpha _t. \end{aligned}$$

Keeping in mind \(d(0)=\Vert x_0\Vert \) we can clearly see that

$$\begin{aligned} \frac{d(tv)-d(0)}{t}=\frac{1}{d(tv)+d(0)} \left( \frac{\Vert x_t\Vert ^2-\Vert x_0\Vert ^2}{t}+t-2\Vert x_t\Vert \cos \alpha _t\right) . \end{aligned}$$

Both d(tv) and \(\Vert x_t\Vert \) converge to d(0) as \(t\rightarrow 0\), so the proof will be completed if only \(\alpha _t\rightarrow \alpha _0\) and \(\frac{\Vert x_t\Vert ^2-\Vert x_0\Vert ^2}{t}\rightarrow 0\). Actually, both claims can be derived from the closedness of X. Indeed, closedness guarantees that for any \(\varepsilon >0\), we can find such \(\delta >0\) that for all \(x\in X\) with the first coordinate greater than or equal to \(x_{0}^{(1)}\), there is \(x^{(1)}-x_{0}^{(1)}\le \varepsilon \) as long as \(\Vert x\Vert <d(0)+\delta \), otherwise \(x_0\) would not realise the smallest angle among those formed by v and \(x\in m(0)\). \(\square \)

Fig. 2
figure 2

A A graphic depiction of Theorem  2.1. B The graph \(\Gamma \) of the distance function for the set \(X=\partial ({\mathbb {B}}(0,2)\cup \{ x>0,\,|y|<1\})\) together with its medial axis

Remark 2.2

A more general version of von Mises theorem stated for semi-concave functions is found in [22, Theorem 3.3.6].

Assuming that m(0) is a subset of the unit sphere, we can use the polarization identity for the inner product to express \(D_v d(0,X)\) in the convenient form

$$\begin{aligned} \frac{1}{2}\inf \{ \Vert v-y\Vert ^2-\Vert v\Vert ^2-1,\, y\in m(0)\}. \end{aligned}$$

Since the infimum is attained at \(y\in m(0)\), which is closest to v, the formula simplifies even further down to

$$\begin{aligned} \frac{1}{2}(d(v,m(0))^2-\Vert v\Vert ^2-1). \end{aligned}$$

The appearance of \(d_{m(0)}\) in the formula for \(D_vd_X(0)\) brings along interesting consequences and possibilities to describe the medial axis’ cone within its category. However, our first result will be independent of the Mises Theorem, for the situation for the subsets of the sphere is more straightforward than the general one (Fig. 2).

In what follows \(C_aE\) denotes the classical Peano tangent cone of a set at its accumulation point a, i.e. the cone formed by all the directions \(v=\lim _{\nu \rightarrow \infty } t^{-1}_\nu (x_\nu -a)\), where \(E\ni x_\nu \rightarrow a\) and \(t_\nu \rightarrow 0^+\).

Proposition 2.3

Let \(Y\subset {\mathbb {R}}^n\) be a closed proper subset of the unit sphere \({\mathbb {S}}\). Then, \(M_Y\) is the cone spanned over \(M^{{\mathbb {S}}}_{Y}\) computed in \({\mathbb {S}}\) with respect to the induced metric. Moreover, in that case, \(C_0M_Y=\overline{M_Y}\).

Proof

Start by observing that since Y is a subset of \({\mathbb {S}}\) and an open ball in the induced metric is the intersection of a ball in \({\mathbb {R}}^n\) with \({\mathbb {S}}\), clearly \(M^{{\mathbb {S}}}_{Y}\subset M_Y\). To finish this part of the proof, we need to show that \(M_Y\) is a cone. This follows from the observation that the intersection of \({\mathbb {S}}\) and any ball \({\mathbb {B}}(x,d(x,m(x)))\), is always equal to a closed ball in \({\mathbb {S}}\) centered at \(x/\Vert x\Vert \) with radius \(d(x/\Vert x\Vert ,m(x))=d(x/\Vert x\Vert ,m(x/\Vert x\Vert )\).

The second part of the theorem is trivial, as \(M_Y\) is a cone, and every vector \(\lambda v,\) where \(\lambda \in {\mathbb {R}}_+, v\in M_Y,\) approximating an element of a tangent cone \(C_0M_Y\) belongs to \(M_Y\). \(\square \)

Even this simple situation demands some finesse. On the one hand, it is indeed necessary to take the closure of \(M_Y\) in Proposition 2.3. As seen for \(Y=\{ xy=0\}\cap {\mathbb {S}}\subset {\mathbb {R}}^3\), a point \(v=(0,0,1)\) lies in Y so it cannot belong to \(M_Y\). Nevertheless, it is easy to check that v is a point of the tangent cone at the origin of the medial axis. Additionally, since closed balls both in the spherical and in the induced metric are the same, the choice of the metric used to calculate \(M^{\mathbb {S}}_Y\) in Proposition 2.3 does not affect the assertion.

We will use the theorem of the Denkowskis [19].

Theorem 2.4

(A.Denkowska, M.Denkowski) Assume that \(X\subset {\mathbb {R}}_x^n\times {\mathbb {R}}_t^k\) is definable, has closed \(t-\)sections and \(X_t\rightarrow X_0\). Then for \(M=\{ (x,t)\mid \#m_{X_t}(x)>1\}\) we have

$$\begin{aligned} M_{0}\subset \liminf _{\pi (M)\ni t\rightarrow 0} M_{t} \end{aligned}$$

where \(\pi :(x,t)\rightarrow x\) and we posit \(\liminf M_t=\emptyset \) when \(0\notin \overline{\pi (M)\backslash \{ 0\}}.\)

Remark 2.5

One of the most important corollaries of Theorem 2.4 binds the tangent cone of the medial axis with the medial axis of a tangent cone for definable sets. Namely, in the definable setting, due to Curve Selection Lemma, the tangent cone \(C_0X\) of a set \(X\subset {\mathbb {R}}^n\) at a point \(X=0\) is given as the Kuratowski limit of the set dilatations

$$\begin{aligned} C_0X=\lim _{t\rightarrow 0}\, t^{-1}X. \end{aligned}$$

Since scaling the set scales its medial axis accordingly, Theorem 2.4 asserts that

$$\begin{aligned} M_{C_0X}\subset \liminf M_{t^{-1}X}=\lim \, t^{-1}M_X=C_0M_X. \end{aligned}$$

Even though the cone inclusion from the last remark looks promising to describe the tangent cone of a medial axis at an arbitrary point, one stumbles upon a gnawing obstacle while applying it to the problem. Since points of a medial axis \(M_X\) are separated from the set X, the lefthand side of the inclusion from Remark 2.5 becomes empty, and the approach fails to deliver any meaningful insight. Thus, to tackle the problem of the description of the tangent cone, we need to be a trifle more cunning. In fact, we require of a technical lemma which describes the geometry of the graph of the distance function.

Lemma 2.6

For any closed \(X\subset {\mathbb {R}}^n\), a graph

$$\begin{aligned} \Gamma :=\{(x,y)\in {\mathbb {R}}^n \times {\mathbb {R}}\mid y=d(x,X)\} \end{aligned}$$

has the following properties:

  1. 1.

    For any \( (a,d(a))\in \Gamma \),

    \(\{ (x,y)\in {\mathbb {R}}^n\times {\mathbb {R}}\mid |y-d(a)|>\Vert x-a\Vert \}\cap \Gamma =\emptyset \);

  2. 2.

    For any \( a\in {\mathbb {R}}^n\) and \(v\in m(a)\), \([(v,0),(a,d(a))]\subset \Gamma \);

  3. 3.

    For any \( (x,y)\in {\mathbb {R}}^n\times {\mathbb {R}}\) with \(y<d(x)\),

    \((x,y)\in M_\Gamma \iff x\in M_X\), in other words: the medial axis of the epigraph of d is equal to \(M_X\times {\mathbb {R}}\cap \{ (x,y)\mid y<d(x)\}.\)

Proof

  1. 1.

    is a consequence of the Lipschitz condition for the distance function.

  2. 2.

    comes from \(m(tv+(1-t)a)=\{ v\}\) for \(t\in (0,1],v\in m(a)\) together with

    $$\begin{aligned} \Vert tv+(1-t)a-v\Vert =\Vert (1-t)a-(1-t)v\Vert =(1-t)\Vert a-v\Vert . \end{aligned}$$
  3. 3.

    can be proved by observing that 1. and 2. give together:

    $$\begin{aligned} \{ (x,y)\in {\mathbb {R}}^n\times {\mathbb {R}}\mid y-d(a)\le -\Vert x-a\Vert \} \cap \Gamma =\bigcup _{v\in m(a)} [(v,0),(a,d(a))] \end{aligned}$$

    for every \((a,d(a))\in \Gamma \). Indeed, if \((x,y)\in \bigcup [(v,0),(a,d(a))]\), then (2) gives \((x,y)\in \Gamma \), moreover for a certain \(t\in [0,1]\), there is

    $$\begin{aligned} (x,y)=t(v,0)+(1-t)(a,d(a))=(tv+(1-t)a,(1-t)d(a)). \end{aligned}$$

    Thus,

    $$\begin{aligned} y-d(a)+\Vert x-a\Vert =-td(a)+\Vert tv-ta\Vert =t(-d(a)+\Vert a-v\Vert )\le 0, \end{aligned}$$

    as pleaded.

    On the other hand, taking \((x,y)\in \{ y-d(a)\le -\Vert x-a\Vert \}\cap \Gamma \) by (1), there is

    $$\begin{aligned} d(x)-d(a)=y-d(a)=- \Vert x-a\Vert . \end{aligned}$$

    Therefore, for any \(v\in m(a)\) and \(x'\in m(x)\), there is

    $$\begin{aligned} \Vert a-x'\Vert \le \Vert x-x'\Vert +\Vert x-a\Vert =\Vert a-v\Vert \end{aligned}$$

    Thus, \(m(x)\subset m(a)\) and since \(y<d(a)\) there must exist \(t\in [0,1]\) such that \((x,y)=(tv+(1-t)a,(1-t)d(a))\) for some \(v\in m(a)\).

It is easy to check now that for every point p of the axis of the cone

$$\begin{aligned} C(a):=\{ (x,y)\mid y-d(a)\le -\Vert x-a\Vert \}, \end{aligned}$$

the set \(m_\Gamma (p)\) has the same number of points as m(a). Indeed, whenever m(a) is a singleton, the intersection \(C(a)\cap \Gamma \) is a single segment on the boundary of C(a), thus \(m_\Gamma (p)=m_{C(a)\cap \Gamma }(p)\) must be a singleton as well. On the other hand, if m(a) consists of more than one point, then the intersection \(C(a)\cap \Gamma \) is a union of segments on the boundary of C(a) with endpoints—one at the vertex of C(a) and the other at a point of \(m(a)\times \{ 0\}\). Therefore,

$$\begin{aligned} m_\Gamma (p)={\left\{ \begin{array}{ll} \left( a+ \frac{d(a)-p^{(n+1)}}{2d(a)}(m(a)-a)\right) \times \left\{ \frac{d(a)+p^{(n+1)}}{2}\right\} , &{} p^{(n+1)}>-d(a),\\ m(a)\times \{ 0\}, &{} p^{(n+1)}\le -d(a) \end{array}\right. }, \end{aligned}$$

where \(p^{(n+1)}<d(a)\) denotes the last coordinate of p. \(\square \)

With the properties of the graph of the distance function at hand, we are ready to prove:

Theorem 2.7

For any closed definable \(X\subset {\mathbb {R}}^n\) with \(0\in \overline{M_X}\), there is

$$\begin{aligned} M_{m(0)}\subset C_0M_X. \end{aligned}$$

Proof

If \(0\in \overline{M_X}\backslash M_X\), the theorem is trivial as \(M_{m(0)}=\emptyset \). Assume then, without loss of generality, that \(0\in M_X\) and \(d(0)=1\). Denote by \(\Gamma \) the graph of the distance function d as was done in the previous lemma. According to Remark 2.5, \(M_{C_{(0,1)}\Gamma }\subset C_{(0,1)}M_\Gamma \). To prove the theorem, we will establish the relation between these sets and \(M_{m(0)}\) and \(C_0M_X\).

Let us begin with \(C_{(0,1)}M_\Gamma \). Since Lemma 2.6(3) gives

$$\begin{aligned} (M_\Gamma -(0,1))\cap \{ y\le -\Vert x\Vert \} = M_X\times {\mathbb {R}} \cap \{ y\le -\Vert x\Vert \}, \end{aligned}$$

the tangent cones of \(M_\Gamma -(0,1)\) and \(M_X\times {\mathbb {R}}\) must coincide in the cone \(\{ y\le \alpha \Vert x\Vert \}\) for any choice of \(\alpha <-1\). Because \({\mathbb {R}}\) is a cone, we further obtain the coincidence of \(C_{(0,1)}M_\Gamma \) and \(C_0 M_X\times {\mathbb {R}}\) in the aforementioned cone.

As it comes to \(M_{m(0)}\) and \(M_{C_{(0,1)}\Gamma }\), we will investigate first the set \(C_{(0,1)}\Gamma \). Since \(d_X\) is a Lipschitz function, the explicit formula for the directional derivative \(D_xd_X(0)\) allows us to express \(C_{(0,1)}\Gamma \) as the graph of the function

$$\begin{aligned} x\rightarrow D_xd_X(0)= \frac{1}{2}(d(x,m(0))^2-\Vert x\Vert ^2-1). \end{aligned}$$

Consider for a moment the graph \(\Gamma _1\) of the function \(x\rightarrow d(x,m(0))\). For \(\Vert x\Vert <1\), it has the structure of a cone with a vertex at (0, 1), furthermore the tangent cone \(C_{(0,1)}\Gamma _1\) can be expressed as the graph of the same function as in the case of \(\Gamma \), namely \(x\rightarrow D_xd_X(0)\). The medial axis of the epigraph of d(xm(0)) after the translation by \((0,-1)\) has to coincide with \(M_{C_{(0,1)}\Gamma }\), thus their intersections with the cone \(\{y\le \alpha \Vert x\Vert \}\) are also equal.

We have obtained

$$\begin{aligned} C_0M_X\times {\mathbb {R}}\cap \{ y\le \alpha \Vert x\Vert \}= C_{(0,1)} M_\Gamma \cap \{ y\le \alpha \Vert x\Vert \} \end{aligned}$$

and

$$\begin{aligned} M_{m(0)}\times {\mathbb {R}}\cap \{ y\le \alpha \Vert x\Vert \} =M_{C_{(0,1)}\Gamma }\cap \{ y\le \alpha \Vert x\Vert \}. \end{aligned}$$

Since, as we mentioned at the beginning, \(M_{C_{(0,1)}\Gamma }\subset C_{(0,1)}M_\Gamma \), the assertion follows. \(\square \)

As the following example shows, the equality between \(C_a M_{X}\) and \(M_{m(a)}\) cannot be expected in general.

Example

Let \(X=\{ (x,y,z)\in {\mathbb {R}}^3\mid x^2=1, (y+z)(y-z)=0 \,\}\), then there is

  • \(M_X=\{ (x,y,z)\in {\mathbb {R}}^3\mid yz=0,y\ne z\} \cup \{(x,y,z)\in {\mathbb {R}}^3\mid x=0\}\),

  • \(m(0)=\{ (1,0,0),(-1,0,0)\}\),

  • \(M_{m(0)}=\{ (x,y,z)\in {\mathbb {R}}^3\mid x=0\}\).

It is easy to check that indeed \(M_{m(0)}\) is a proper subset of \(C_0 M_X\) (Fig. 3).

Fig. 3
figure 3

Even though the medial axis of the black double cross consists of all of the visible surfaces, only the shaded one contributes to \(M_{m(0)}\)

The reconstruction of the whole tangent cone of \(M_X\) based solely on m(a) may not be possible due to sequences of points \(x_\nu \) in the medial axis with \(m(x_\nu )\) converging to a singleton. Assuming no such sequence can be found, we can prove the following.

Corollary 2.8

Assume that \(0\in M_X\) for a closed definable \(X\subset {\mathbb {R}}^n\). If there exists a neighbourhood of the origin U and \(r>0\) such that for any \(a\in U\cap M_X\), there is \(\text {diam } m(a)>r\), then \(C_0M_X=M_{m(0)}\).

Proof

Theorem 2.7 gives us one of the inclusions in question. To prove the other one, start by taking \(v\in C_0M_X\). By definition, we can find sequences \(\{ a_\nu \}\) in \(M_X\) and \(\{ \lambda _\nu \}\) in \({\mathbb {R}}_+\) such that

$$\begin{aligned} a_\nu \rightarrow 0,\, \lambda _\nu \rightarrow 0,\text { and } a_\nu / \lambda _\nu \rightarrow v. \end{aligned}$$

Take any convergent sequence of elements \(m(a_\nu )\ni x_\nu \rightarrow x\in m(0)\); we will show that \(x\in m_{m(0)}(v)\). Since the additional assumption on the diameter of \(m(a_\nu )\) ensures \(\text {diam } \limsup m(a_\nu )\ge r>0\) this will give \(v\in M_{m(0)}\).

Consider \({\mathbb {B}}(a_\nu ,d(a_\nu ))\cap {\mathbb {S}}(0,d(0))\). For \(\Vert a_\nu \Vert <d(0)\), it is a closed ball \(B_\nu \) in \({\mathbb {S}}(0,d(0))\) centered at \(a_\nu /\Vert a_\nu \Vert \). Moreover, \({\mathbb {B}}(a_\nu ,d(a_\nu ))\cap X= m(a_\nu )\) also ensures \(B_\nu \cap m(0)=m(a_\nu ) \cap m(0)\). Since \(x_\nu \rightarrow x\), the sequence of balls \(B_\nu \) converges to some closed ball B centered at v with x on its boundary. Of course, the interior of B has an empty intersection with m(0), as for every \(\varepsilon >0,\, {\mathbb {B}}(a_\nu , d(a_\nu ) - \varepsilon ) \cap X=\emptyset \), which proves that x is the closest point to v in m(0). \(\square \)

The author suspects, that the equality holds everywhere outside of \(\overline{\overline{M_X}\backslash M_X}\). However the proof does not seem to be simple.

As for the parts of the tangent cone at a point x of the medial axis which are not detected by m(x), it is still possible to distinguish parts of X contributing to \(C_xM_X\). While verifying whether \(v\in {\mathbb {S}}\) belongs to the tangent cone of \(M_X\), the investigation of X can be restricted to a neighbourhood of \(m_{m(0)}(v)\).

Proposition 2.9

Assume that \(0\in M_X\). For any \(v\in {\mathbb {S}}\) and \(\delta >0\), there exist \(r,\varepsilon >0\) such that for

$$\begin{aligned} C(v,r,\varepsilon ):=\{ a\in {\mathbb {R}}^n \mid \Vert a\Vert<r,\angle (a,v)<\varepsilon \}, \end{aligned}$$

there is \(M_X\cap C(v,r,\varepsilon )=M_{X\cap m_{m(0)}(v)^\delta }\cap C(v,r,\varepsilon )\).

Where \(m_{m(0)}(v)^\delta :=\{ x\in {\mathbb {R}}^n\mid d(x,m_{m(0)}(v))\le \delta \}\).

Proof

Without loss of generality we can assume that \(d(0,X)=1\). Denote

$$\begin{aligned} b(v):=\{ a\in {\mathbb {S}}\mid d(v,a)\le d(v,m(0))\}, \end{aligned}$$

we will show first that for an arbitrary \(\zeta >0\) we can find \(r,\varepsilon >0\) such that

$$\begin{aligned} M_X\cap C(v,r,\varepsilon )=M_{X\cap b(v)^{\zeta }}\cap C(v,r,\varepsilon ). \end{aligned}$$

Observe firstly that for \(a\in {\mathbb {R}}^n\) and \(y\in m_{m(0)}(v)\) an inequality holds

$$\begin{aligned} d(a,X)\le d(a,y)=\sqrt{1+\Vert a\Vert ^2-2\Vert a\Vert \cos \angle (a,y)}. \end{aligned}$$

Since the angle \(\angle (v,y)\) is strictly smaller than \(\pi \), we can choose a positive \(\varepsilon _0<\pi -\angle (v,y)\). Then for \(a\in {\mathbb {R}}^n\) forming an angle \(\angle (a,v)<\varepsilon _0\) we have

$$\begin{aligned} \angle (a,y)\le \angle (a,v)+\angle (v,y)<\pi \end{aligned}$$

which means

$$\begin{aligned} 1+\Vert a\Vert ^2-2\Vert a\Vert \cos \angle (a,y)\le 1 +\Vert a\Vert ^2-2\Vert a\Vert (\cos (\angle (v,y)+\varepsilon _0)). \end{aligned}$$

Now for any \(\eta >0\) we can shrink the \(\varepsilon _0\) down to \(\varepsilon _\eta \) to obtain

$$\begin{aligned} -\cos (\angle (v,y)+\varepsilon _\eta )<-(\cos \angle (v,y)-\eta ) \end{aligned}$$

and then pick \(r_\eta >0\) such that \(\Vert a\Vert <r_\eta \) implies

$$\begin{aligned} 1+\Vert a\Vert ^2-2\Vert a\Vert (\cos \angle (v,y)-\eta )\le (1-\Vert a\Vert (\cos \angle (v,y)-2\eta ))^2. \end{aligned}$$

Therefore it is possible to estimate

$$\begin{aligned} d(a,X)<1-\Vert a\Vert (\cos \angle (v,y)-2\eta )=:R_a \end{aligned}$$

with \(\eta \) arbitrary close to zero for \(a\in C(v,r,\varepsilon )\) with \(r<r_\eta ,\varepsilon <\varepsilon _\eta \).

To end the first part of the proof we need to show that for any \(a\in C(v,r,\varepsilon )\), we have \({\mathbb {B}}(a,R_a)\backslash int{\mathbb {B}}(0,1)\subset b(v)^\zeta \). First observe that by shrinking r and \(\eta \) we can obtain \({\mathbb {B}}(a,R_a)\subset {\mathbb {B}}(0,1+\zeta /2).\) Now we need to prove that \({\mathbb {B}}(a,R_a)\cap {\mathbb {S}}\subset b(v)^{\zeta /2}\) which is equivalent to \(d(v,{\mathbb {B}}(a,R_a)\cap {\mathbb {S}})<d(v,m_{m(0)}(v))+\zeta /2\) and can be verified in the plane spanned by v and a. However, the inequality holds uniformly for \(\eta , r, \varepsilon \) small enough in any such plane, due to Pythagorean Theorem.

Now, since X is closed and \(m(0)\cap b(v)=m_{m(0)}(v)\), for any \(\delta >0\) we can find a positive number \(\zeta \) such that

$$\begin{aligned} X\cap b(v)^{\zeta }\subset X\cap m_{m(0)}(v)^\delta . \end{aligned}$$

Since all points in \(C(v,r,\varepsilon )\) have their distance to X realised in \(b(v)^{\zeta }\), the assertion follows. \(\square \)

Theorem 2.7 yields two immediate yet worthwhile corollaries.

Corollary 2.10

In the considered situation, \(\dim _a M_X\ge \dim M_{m(a)}.\)

Where \(\dim _a M_X\) denotes the local dimension of \(M_X\) at a (see Definition 3.2).

Proof

From Theorem 2.7 the medial axis \(M_{m(a)}\) is a subset of the tangent cone \(C_a M_X\). Thus, its dimension is bounded by \(\dim C_a M_X\). Since \(M_X\) is definable, \(\dim M_X\) is always greater than or equal to \(\dim C_a M_X\), and the assertion follows. \(\square \)

The following result was known before (e.g. [12] Theorem 6.2 or [13] Theorem 4.10 for the subset of points in the medial axis with \(\dim m(a)=n-1\)), Theorem 2.7 yields a proof that is more natural in the medial axis category.

Corollary 2.11

Point \(a\in M_X\) is isolated in \(M_X\) if and only if m(a) is a whole sphere.

Proof

The sufficiency of the condition is apparent. For the proof of the necessity, suppose that m(a) does not fill the sphere \({\mathbb {S}}(a,d(a))\) entirely. It is easy to observe (for example, using the compactness of the sphere, the continuity of the distance function, and Theorem 2.3), that its medial axis is a cone of dimension \(\dim M_{m(a)}>0\). From Theorem 2.7 we derive that \(\dim C_aM_X>0\), hence a cannot be isolated. \(\square \)

In other words, every eyelet in m(a) enables an escape of \(M_X\) in its general direction.

In the plane, the situation is, as usual, more straightforward.

Theorem 2.12

For a closed definable \(X\subset {\mathbb {R}}^2\), there is always

$$\begin{aligned} C_aM_X=M_{m(a)}-a. \end{aligned}$$

Proof

Assume \(a=0\). Of course, given Theorem 2.7, the only strict inclusion possible is \(M_{m(0)}\subsetneq C_0M_X\). Take then \(v\in C_0M_X \backslash M_{m(0)}\) if such a point exists. Since \(M_X\) is definable, by the Curve Selection Lemma, there exists a continuous \(\gamma :[0,1]\rightarrow M_X\) with \(\gamma (0)=0\), tangential to v and such that \(0\notin \gamma ((0,1])\). Moreover, as for every \(x\in m(0)\) a segment (0, x] does not intersect \(M_X\), the image of \(\gamma \) and the set \((0,1]\cdot m(0)\) must be disjoint. Take now \(\nu \in M_{m(0)}\subset C_0M_X\) lying in the same connected component of \({\mathbb {R}}^2\backslash ({\mathbb {R}}_+\cdot m(0))\) as v and denote by \(\psi \) a curve in \(M_X\) tangential to \(\nu \). For a vector \(w\in {\mathbb {R}}^2\), there is \(\lim _{t\rightarrow 0^+}tw = 0\) and \(\limsup _{t\rightarrow 0^+} m(tw)\subset m(0)\). Therefore, for any w in a segment \((v,\nu )\) with an arbitrary choice of \(w_t\in m(tw)\), starting from a certain \(T>0\), a segment \([tw,w_t]\) has to intersect eventually either \(\gamma \) or \(\psi \), which ends in a contradiction. \(\square \)

Remark 2.13

The proof of Theorem 2.12 heavily depends on the Curve Selection Lemma, and the result is not valid outside of the o-minimal setting in general. Consider the set \(X:=(\{ x\mid x=\frac{1}{k},k\in {\mathbb {Z}}\backslash \{ 0\}\}\cup \{ 0 \})\times \{ y\mid y^2\ge 1\}\). Then the tangent cone to \(M_X\) at 0 is the whole plane, whereas the part visible from the analysis of m(0) consists precisely of the x-axis (Fig. 4).

Fig. 4
figure 4

Theorem 2.12. Starting from a certain \(T>0\), the segment \([tw,w_t]\) intersects either \(\gamma \) or \(\psi \)

A slight variation of the Theorem 2.12 proof shows that the planar medial axes cannot form cusps. This is a result analogous to the no cusp property of the conflict sets from [11].

Corollary 2.14

For a closed definable \(X\subset {\mathbb {R}}^2\) and \(a\in M_X\), the germ of \(M_X\) at a is a union of definable curves \(\gamma _1\ldots \gamma _s\) with distinct tangent cones at a.

Proof

Assume, for sake of contradiction, that two distinct curves \(\gamma _1,\gamma _2\) in the decomposition of the germ of \(M_X\) share the same tangent cone. The curves \(\gamma _1, \gamma _2\) are disjoint for t positive and small enough due to definability. Therefore, we can find a curve \(\varphi \) originating from zero and entirely included in the region bounded by \(\gamma _1,\gamma _2\). Then, for t small enough and \(v_t\in m(\varphi (t))\), we obtain an analogous contradictory intersection of \([\varphi (t),v_t]\) with one of the initial curves.

\(\square \)

Remark 2.15

Outside of the Euclidean plane the dimension of the medial axis tangent cone can be strictly smaller than the medial axis one. Indeed, consider

$$\begin{aligned} A:=\{(x,y,0)\in {\mathbb {R}}^3\mid |y|\le 4x^2,0\le x\} \end{aligned}$$

and define

$$\begin{aligned} X:= {\mathbb {R}}^3\backslash \bigcup \{ {\mathbb {B}}(a,1)\mid a\in A\}. \end{aligned}$$

Then \(M_X=A\), thus it is a pure two dimensional set whilst \(C_0M_X=\{ (t,0,0)\mid t\ge 0\}\).

Remark 2.16

The results in this section bear the same flavour as those provided by Albano and Cannarsa in [23], however, concentrating on the distance function rather than a general semi-concave function, we made our approach to the tangent cone more comprehensive. The simple lower bound estimate of Corollary 2.10 is slightly sharper than one obtained by Albano and Cannarsa. For an example of two circles of equal radius equidistant from the origin of \({\mathbb {R}}^3\), our method bounds the dimension of the medial axis by 2, whereas methods described in the cited paper allow to bound it only by 1. Furthermore, focusing on the distance function allowed us to derive the sufficient condition for the equality of the tangent cone and the medial axis of the closest points and several other plane-related results such as no cusp property.

3 The dimension of the medial axis

Our aim now is to use the established relation between the tangent cone of the medial axis at a point \(x\in M_X\) and the medial axis of m(x) to describe the dimension of the medial axis in a more refined way than Corollary 2.10. This result can be viewed as an answer to the conjecture posted in [13, 14].

We will use a notion of a cylindrical definable cell decomposition (cdcd) from the o-minimal geometry, cf. [16]; it serves the role of quasi-stratification of a definable set.

Definition 3.1

We call \(C\subset {\mathbb {R}}^n\) a definable cell if

\(n=1:\) C is either a singleton \(\{ a\}\) or an open interval (ab);

\(n>1:\) for \(\pi :{\mathbb {R}}^n\rightarrow {\mathbb {R}}^{n-1}\) the natural projection on first \((n-1)\) coordinates, \(\pi (C)\) is a cell in \({\mathbb {R}}^{n-1}\) and C is either a definable graph of a continuous function defined on \(\pi (C)\)

$$\begin{aligned} C=\{ (x,f(x)\mid x\in \pi (C)\}, \end{aligned}$$

or a definable band between two such functions

$$\begin{aligned} C=\{ (x,y)\mid x\in \pi (C),f_1(x)<y<f_2(x)\}. \end{aligned}$$

Without much effort and implications on what follows, functions defining cells can be assumed to be of class \(\mathscr {C}^k\) for an arbitrary \(k\in {\mathbb {N}}\). However, in this paper we will not need such smoothness, thus just the continuity of the functions is assumed.

Definition 3.2

We call a family of definable cells \({\mathcal {C}}\) a cylindrical definable cell decomposition (cdcd) of \({\mathbb {R}}^n\) if the family \({\mathcal {C}}\) is finite, the cells of \({\mathcal {C}}\) are pairwise disjoint, \(\bigcup {\mathcal {C}}={\mathbb {R}}^n\), and a collection of projections on the first \((n-1)\) coordinates \(\{ \pi (C), \, C\in {\mathcal {C}}\}\) is a cdcd of \({\mathbb {R}}^{n-1}\).

We say that a cdcd \({\mathcal {C}}\) is adapted to a finite collection of definable sets \( A_1,\ldots , A_k\), if \(A_i\) is the union of certain cells of \({\mathcal {C}}\) for all \(i\in \{ 1,\ldots ,k\}\). It is a standard result from o- minimal geometry that such adapted cdcd exists for any finite collection of definable sets [16]. Adapted cdcd serves to some extent the role of stratification known from semialgebraic or analytic geometry in the definable setting. Since every cell C of a cdcd is homeomorphic to a finite-dimensional real vector space, it follows that the dimension of a definable set A is equal to

$$\begin{aligned} \dim A=\max \{ \dim C\mid C\subset A\} \text { for a}\ {\textit{cdcd}}\ \text {adapted to } A, \end{aligned}$$

which does not depend on the choice of a cdcd. The local dimension of A at a point \(a\in A\) is defined then as

$$\begin{aligned} \dim _a A=\min \{\dim (A\cap U)\mid U -\text {a definable neighbourhood of }a\}. \end{aligned}$$

Recall again that the multifunction m(x) is definable if X is a definable set. By definition it means that the graph

$$\begin{aligned} \Gamma _m:=\{(x,y)\in {\mathbb {R}}^n\times {\mathbb {R}}^n\mid y\in m(x)\} \end{aligned}$$

is definable and thus there exists a cdcd \(\{ D_1,\ldots , D_\alpha \}\) of \({\mathbb {R}}^n\times {\mathbb {R}}^n\) adapted to the intersection \(\Gamma _m\cap (M_X\times {\mathbb {R}}^n)\). From the definition of cdcd, the collection of the projections of \(D_i\) onto the first n coordinates forms a cdcd of \({\mathbb {R}}^n\) adapted to \(M_X\). With this decomposition, we will prove further properties of the multifunction m(x), and as a consequence, we will obtain an explicit formula for the dimension of \(M_X\).

Definition 3.3

Let \({\mathcal {D}}\) be a cdcd of \({\mathbb {R}}^n\times {\mathbb {R}}^n\) adapted to \(\Gamma _m\). Denote by \({\mathcal {C}}\) the cdcd of \({\mathbb {R}}^n\) obtained from the projections of the cells in \({\mathcal {D}}\) onto the first n coordinates. We call \(x_0\in M_X\) an interior point of \(M_X\) with respect to \({\mathcal {D}}\), if there exists a neighbourhood \(U_0\) of \(x_0\) such that \(U_0\cap C = U_0 \cap M_X\), where C is the unique cell in \({\mathcal {C}}\) containing \(x_0\).

Remark 3.4

Mind that since every cell of a cdcd has pure dimension, the condition \(U_0\cap C=U_0\cap M_X\) implies \(\dim _{x_0}M_X = \dim C\).

Proposition 3.5

Let \({\mathcal {D}}\) be a cdcd of \({\mathbb {R}}^n\times {\mathbb {R}}^n\) adapted to \(\Gamma _m\) and \(M_X\times {\mathbb {R}}^n\). Assume that \(x_0 \in M_X\) is an interior point of \(M_X\) w.r.t. \({\mathcal {D}}\). Then the multifunction \(m|_{M_X}\) is continuous at \(x_0\).

Proof

It is known, cf. [3, 13], that the multifunction m(x) is upper semi-continuous along \(M_X\): for any \(x_0\in {\mathbb {R}}^n\), we have the inclusion \(\limsup _{M_X\ni x\rightarrow x_0}m(x)\subset m(x_0)\). To prove the continuity of \(m|_{M_X}\), we need to show that \(m(x_0)\) is a subset of the lower Kuratowski limit. Explicitly, we need to show that

$$\begin{aligned} \forall y\in m(x_0),\ \forall U\ni y,\ \exists V\ni x_0:\forall x\in V\cap M_X,\ m(x)\cap U\ne \emptyset , \end{aligned}$$

where UV are open sets.

Take \(y=(y_1,\ldots ,y_n)\in m(x_0)\) and a neighbourhood \(U_1\times \ldots \times U_n\) of y. Denote by D the cell in \({\mathcal {D}}\) containing \((x_0,y)\) and by C its projection on \({\mathbb {R}}^n\). We will show the continuity of \((\pi _i\circ m)(x)\) where \(\pi _i\) is the natural projection on the first i coordinates. Of course, \((\pi _n\circ m)(x)=m(x)\) and the assertion will follow.

For the first coordinate, observe that \(C_1:=(id_{{\mathbb {R}}^n}\times \pi _1) (D)\) is either a graph of a continuous function or a band between two such functions defined over C. In the first case, we can easily find a neighbourhood V of \(x_0\) in \(M_X\) such that \((\pi _1\circ m)(V)\subset U_1\) which implies \((\pi _1\circ m)(V)\cap U_1\ne \emptyset \). In the case \(C_1\) is a band between two functions \(f_-,f_+\), there must be \(f_-(x)<y_1<f_+(x)\). By continuity these inequalities must hold in a certain neighbourhood V of \(x_0\), resulting in

$$\begin{aligned} \sup _{x\in V}f_-(x)\le y_1\le \inf _{x\in V}f_+(x). \end{aligned}$$

Clearly, \((\pi _1\circ m)(V)\cap U_1\ne \emptyset \).

Assume now the composition \(\pi _k \circ m\) to be continuous for \(k<n\). Again, the cell \(C_{k+1}:=(id_{{\mathbb {R}}^n}\times \pi _{k+1}) (D)\) is either a graph of a continuous function \(f_{k+1}\) or a band between two such functions, this time defined over \(C_k\). In the first case, we can find a neighbourhood \(V=V_0\times \ldots \times V_{k}\) of \((x,y_1,\ldots ,y_k)\) such that \(f_{k+1}(V)\subset U_{k+1}\). As the composition \(\pi _k\circ m(x)\) is continuous, we can ensure \((x,y'_1,\ldots ,y'_k)\in V_0\times V_1\times \ldots \times V_k\) just by shrinking \(V_0\); by shrinking it even further, we can also ensure that \((y'_1,\ldots ,y'_k)\in U_1\times \ldots \times U_k\). By doing that, we obtain \(\pi _{k+1}\circ m(V_0)\subset U_1\times \ldots \times U_{k+1}\). The case of \(C_{k+1}\) being a band follows in the same manner.

As was mentioned earlier, the inclusion results in the continuity of \(m|_{M_X}\) at every point of C, in particular at \(x_0\). \(\square \)

The proof of Proposition 3.5 gives a soothing correlated result on the continuity of m(x). In the o-minimal setting, the set of points at which m(x) is discontinuous is always nowhere dense and is equal to the medial axis (see [24] for a counter-example outside of the o-minimal setting). Luckily enough, the restriction of m(x) to the medial axis exhibits an analogous behaviour. It is still continuous outside of a subset nowhere dense in the induced topology. Consequently, with \({\mathbb {R}}^n\) being locally compact, we have

Corollary 3.6

The set

$$\begin{aligned} \{ a\in M_X\mid C_a M_X = M_{m(a)}\} \end{aligned}$$

is open and dense in \(M_X\).

Proof

For any cell C of a cdcd adapted to the definable set \(M_X\), the points admitting a neighbourhood U such that \(U\cap C=U\cap M_X\) form an open and dense subset of \(M_X\). For any such point, we can find a relatively compact neighbourhood V contained in the cell to which the point belongs. The theorem now follows from Proposition 3.5 and Corollary 2.8, as \(diam\, m(x)\) is positive and continuous on V. \(\square \)

The main result of this paper, settling the question about the dimension of the medial axis in the definable case, is the following.

Theorem 3.7

Let \({\mathcal {D}}\) be a cdcd of \({\mathbb {R}}^n\times {\mathbb {R}}^n\) adapted to \(\Gamma _m\cap (M_X\times {\mathbb {R}}^n)\). If \(x_0 \in M_X\) is an interior point of \(M_X\) w.r.t. \({\mathcal {D}}\), then an equality occurs

$$\begin{aligned} \dim _{x_0} M_X + \dim m(x_0)=n-1. \end{aligned}$$

Proof

Without loss of generality, we can assume \(x_0=0\).

We will prove the theorem by induction on the dimension of C—the cell containing \(x_0\).

The case \(\dim C=0\) is already proved in Corollary 2.11.

Assume now that the dimension of C equals k, and the theorem holds for any cell \(C'\) of dimension smaller than k. Since 0 satisfies the assumptions of Proposition 3.5, we can think about \(C_0 M_X\) as the medial axis of m(0), then clearly

$$\begin{aligned} \dim _0 M_X=\dim C\ge \dim C_0C=\dim M_{m(0)}. \end{aligned}$$

Corollary 3.6 states that we can find \(0\ne v\in M_{m(0)}\) for which the tangent cone to \(C_0 M_X \) at v depends only on points in m(0) that are closest to v (and are collected in a set \(m_{m(0)}(v)\)). Therefore, for such v, after a suitable translation, there is again \(C_vM_{m(0)}=M_{m_{m(0)}(v)}\) and

$$\begin{aligned} \dim M_{m(0)}\ge \dim C_v M_{m(0)}=\dim M_{m(0)}. \end{aligned}$$

The set \(m_{m(0)}(v)\) is a subset of both \({\mathbb {S}}(0,d_X(0))\) and \({\mathbb {S}}(v,d_{m(0)}(v))\). Denote by L the unique \(n-1\) dimensional affine subspace of \({\mathbb {R}}^n\) containing the intersection of the mentioned spheres. It is immediate that the subspace L can be written as \(v^\perp +\alpha v\) for a certain \(\alpha \in {\mathbb {R}}\) and that \(m_{m(0)}(v)\) is a subset of L. Therefore, the medial axis of \(m_{m(0)}(v)\) in \({\mathbb {R}}^n\) is a Minkowski sum of \(v{\mathbb {R}}\) and the medial axis of \(L\cap m(0)\) computed in L (denoted by \(M^L_{m_{m(0)}(v)}\)) (Fig. f5).

Fig. 5
figure 5

Theorem 3.7. The set \(m_{m(0)}(v)\) is a subset of the affine space orthogonal to v

This means that \(\dim M_{m_{m(0)}(v)}=\dim M^L_{m_{m(0)}(v)}+1\) and, in particular, we have \(\dim M^L_{m_{m(0)}(v)} < k\). Due to the last inequality, every cell in the cdcd of L adapted to \(M^L_{m_{m(0)}(v)}\) has the dimension bounded by \(k-1\) and so, by the induction hypothesis, for a generic \(x\in M^L_{m_{m(0)}(v)}\), there is

$$\begin{aligned} \dim m_{m(0)\cap L}(x)=\dim L-1 - \dim M^L_{m_{m(0)}(v)}. \end{aligned}$$

Now, the set \(m_{m(0)\cap L}(x)\) is a subset of m(0), so its dimension cannot exceed \(\dim m(0)\). At the same time, on the right side of the equality we have obtained in fact \(n-1-\dim M_{m_{m(0)}(v)}\), which by our choice is greater than or equal to \(n-1-\dim M_X\).

The opposite inequality is far less complicated in proof. It suffices to observe that \(U\cap C = U\cap M_X\) is a warrant that the dimension of m(x) is constant in U. Consequently Theorem 4.13 from [13] ensures that the sum \(\dim _0 M_X+ \dim m(0)\) cannot exceed \(n-1\).

Finally, we obtain the desired \(\dim _0 M_X+ \dim m(0) = n-1\). \(\square \)

Surprisingly, the formula for a generic point is enough to describe the dimension at any point of \(M_X\). This strengthening of the results from [12, 13], and [25] solves the problem for sets definable in the o-minimal setting.

Theorem 3.8

For any point \(a\in M_X\), there is

$$\begin{aligned} \dim _a M_X+\min \{ k \mid a\in \overline{M^k}\}=n-1 \end{aligned}$$

where \(M^k=\{ a\in M_X\mid \dim m(a)=k\}\).

Proof

We will prove that

$$\begin{aligned} \min \{ k\mid a\in \overline{M^k}\} = n-1-\alpha \iff \dim _a M_X=\alpha \end{aligned}$$

holds for any \(\alpha \in {\mathbb {N}}\).

For \(\alpha =0\), one of the implications is precisely the statement of Corollary 2.11. The opposite one is given by Theorem 4.10 from [13].

Now assume the claim to be valid whenever \(\alpha <\alpha _0\). Mind that Theorem 4.13 from [13] states that for any \(x\in M_X\)

$$\begin{aligned} \dim m(x)+ \dim M^{\dim m(x)}\le n-1, \end{aligned}$$

thus it is easy to observe that

$$\begin{aligned} \min \{ k\mid a\in \overline{M^k}\} = n-1 -\alpha _0 \Rightarrow \dim _a M_X=\alpha _0. \end{aligned}$$

It remains to prove the opposite implication. Take any \(a\in M_X\) with \(\dim _a M_X=\alpha _0\). The claim for \(\alpha <\alpha _0\) allows us to analyse just the points in the vicinity of a where the local dimension of \(M_X\) equals \(\alpha _0\). Furthermore, only \(\dim m(a)\ge n-1-\alpha _0\) needs to be shown.

Assume otherwise: \(\dim m(a)<n-1-\alpha _0\). Surely, the dimension \(\dim m_{m(a)}(v)\) is smaller than \(n-1-\alpha _0\), for any \(v\in M_{m(a)}\) as well. Moreover, thanks to Corollary 3.6 we can find a point \(v\in M_{m(a)}\) with \(\dim _v M_{m(a)}+\dim m_{m(a)}(v)=n-1\). Now

$$\begin{aligned} \alpha _0<n-1-\dim m_{m(a)}(v)=\dim _v M_{m(a)} \le \dim _a M_X=\alpha _0 \end{aligned}$$

gives the contradiction sought for. \(\square \)

Let us remark that in order to describe the dimension of the medial axis \(M_X\) at a given point \(a_0\in M_X\), it is indeed necessary to find the minimum of the dimensions of m(a) for a in a sufficiently small neighbourhood U of \(a_0\). Unfortunately, the problem appears even in the seemingly simple case of planar subsets.

Example

(Wristwatch) Let \(X\subset {\mathbb {R}}^2\) be the boundary of \({\mathbb {B}}(0,2)\cup ((-1,1)\times {\mathbb {R}})\). Then

$$\begin{aligned} \dim _0 M_X +\dim m(0) =\dim (\{ 0\}\times {\mathbb {R}}) +\dim \{ x^2+y^2=2,|x|\ge 1\}=2. \end{aligned}$$
Fig. 6
figure 6

The wristwatch example

Finally, we give a global formula for the dimension of the medial axis (Fig. 6).

Corollary 3.9

For a closed definable set \(X\subset {\mathbb {R}}^n\),

$$\begin{aligned} \dim M_X=n-1-\min _{a\in M_X} \dim m(a). \end{aligned}$$

In particular,

$$\begin{aligned} \dim M_X\ge n-1-\dim X. \end{aligned}$$

Proof

Obvious from Theorem 3.8. \(\square \)

Remark 3.10

If X is a collection of isolated points, its medial axis \(M_X\) is exactly the conflict set of the singletons included in X (also called the Voronoi diagram of X). The dimension of m(a) equals zero for any point \(a\in {\mathbb {R}}^n\), and the global formula indeed gives \(\dim M_X=n-1\), as predicted by the theory of conflict sets [11]. Conversely the conflict set theory assures that the dimension \(\dim _a M_X = n-1\), whenever for a given \(a\in M_X\) the set m(a) is not connected. The general formula for the medial axis dimension concludes that in every neighbourhood of a, a point b of \(M_X\) must exist with m(b) finite.

Remark 3.11

The results of this section correspond to ones brought by Ambrosio, Cannarsa and Soner in [12] for singularities of semi-convex functions. Their methods concentrated on investigating the set \(S^k:=\{ x\in M_X\mid \dim conv(m(x))=k\}\). Localising the study in \({\mathbb {R}}^n\), they obtained the dimension formula \(\dim S^k=n-k\). In general, no easy transition between \(S^k\) and \(M^k\) exists. However, comparing the local dimension formulas, we can derive that for any \(a\in \overline{M_X}\), we necessarily have \(\min \{ k\mid a\in \overline{S^k}\}=\min \{ k\mid a\in \overline{M^k}\}+1\). Furthermore, for a generic point \(a\in M_X\), we have \(\min \{ k\mid a\in \overline{S^k}\}=\dim m(a)+1\).

4 The frontier of the medial axis

In [15] T.Miura proposed a characterisation of the medial axis boundary for hypersurfaces. Unfortunately, the introduced notion did not escape flaws. Foremost, it does not recognise the studied side of the hypersurface, which may result in misleading data. In this paper, we provide an improved definition, resulting in a generalisation of the claims from [15], proved with more straightforward reasoning.

To take notice of the direction of open balls used to investigate \(X\subset {\mathbb {R}}^n\), we assume the following definitions. Take any point \(a\in X\) and write

$$\begin{aligned} N_aX:=\{ v\in {\mathbb {R}}^n\mid \forall w \in C_aX, \langle w,v\rangle \le 0\} \end{aligned}$$

to be the normal cone to X at a. Then denote the set of directions normal to X at a by \(V_a:=N_aX\cap {\mathbb {S}}\) and limiting set of normal directions by

$$\begin{aligned} \widetilde{V}_a:=\limsup _{a_\nu \rightarrow a}V_{a_\nu }. \end{aligned}$$

Remark 4.1

If \(a\in X\) is a point of \(\mathscr {C}^1\)-smoothness, then, of course, the tangent spaces, and, what follows, the normal spaces are continuous at a. Therefore, the limiting set of normal directions is just the set of normal directions in such a case.

Using the introduced sets, for a point \(a\in X\) we consider the following definition.

Definition 4.2

For \(v\in V_a\), we define a directional reaching radius by

$$\begin{aligned} r_v(a):=\sup \{ t\ge 0\mid a\in m(a+tv)\}. \end{aligned}$$

Then for \(v\in \widetilde{V}_a\) we define a limiting directional reaching radius by

$$\begin{aligned} \tilde{r}_v(a):=\liminf \limits _{X\ni x\rightarrow a, V_x\ni v_x\rightarrow v \in \widetilde{V}_a}r_{v_x}(x), \end{aligned}$$

and finally the reaching radius at a is

$$\begin{aligned} r(a)=\inf _{v\in \widetilde{V}_a}\tilde{r}_v(a). \end{aligned}$$

Recall that for any \(v\in N_aX\), the point \(a+vr_v(a)\) is the centre of a maximal (in the sense of inclusion) ball contained in \({\mathbb {R}}^n\backslash X\). The set of centres of maximal balls are gathered in a set called the central set of X. It is known (cf. [3]) that the central set of a closed set lies between the medial axis of the set and its closure.

At first glance, the infimum in the definition of the reaching radius might seem dubious for points with an empty limiting set of normal directions. By definition of the infimum, we are inclined to posit an infinite value of the reaching radius for any such point. Luckily, in the o-minimal geometry, the points with an empty limiting set of normal directions prove to be precisely the interior points of a given set. Clearly, any interior point has an empty limiting set of normal directions. Conversely, every boundary point of a definable set can be reached by the regular part of the boundary. This is a consequence of the definability of the boundary and the nowhere density of the subset of singularities. Points of the regular part of the boundary of X have at least one normal direction. Thus, due to the compactness of the sphere, the limiting set of normal directions for the boundary points cannot be empty.

Remark 4.3

As is easily seen from their definitions, both \(\tilde{r}_{v}(a)\) and r(a) are lower semi-continuous functions. Moreover, for \(v\in \widetilde{V}_a\backslash V_a\) the limiting directional reaching radius equals zero.

Recall that \(Reg_k X\) denotes the set of points of X at which it is a \(\mathscr {C}^k\)-smooth submanifold. Accordingly, the \(\mathscr {C}^k\)-singularities are denoted by \(Sng_k X=X\setminus Reg_k X\).

The backbone of the just defined reaching radius lies in the same place as the reaching radius introduced in [3] as

$$\begin{aligned} \dot{r}(a)={\left\{ \begin{array}{ll} r'(a),&{} a\in Reg_2X,\\ \min \{ r'(a),\liminf \limits _{X\backslash \{ a\}\ni x\rightarrow a} r'(a)\}, &{} a\in Sng_2X \end{array}\right. }, \end{aligned}$$

where

$$\begin{aligned} r'(a)=\inf _{v\in V_a}r_v(a) \end{aligned}$$

is called weak reaching radius. One can perceive the difference between them as a sort of an order of taking limits problem. This paper emphasises the medial axis and a point directional arrangement, whereas Birbrair and Denkowski focused on their distance. Since the Birbrair–Denkowski reaching radius proved to be successful in describing \(\overline{M_X}\cap X\), it would be desirable to achieve at least a type of correspondence between these two notions. Fortunately, as we will see in Theorem 4.13, the final results of both constructions are equal. For the sake of the next preparatory proposition, recall that the normal set at \(a\in X\) defined in [3] as

$$\begin{aligned} {\mathcal {N}}(a):=\{ x\in {\mathbb {R}}\mid a\in m(x)\} \end{aligned}$$

is always convex and closed. Moreover, for a subset of a unit sphere A denote by \(\text {conv}_{\mathbb {S}}(A)\) its convex hull in the spherical norm.

Proposition 4.4

For any \(a\in X\), the function

$$\begin{aligned} \rho : V_a\ni v\rightarrow \rho (v) = r_v(a)\in [0,+\infty ] \end{aligned}$$

is upper semi-continuous on \(V_a\). Furthermore, it is continuous at \(v\in V_a\), if there exist \(r,\varepsilon >0\) such that \({\mathbb {B}}(v,r)\cap V_a=\text {conv}_{\mathbb {S}} ({\mathbb {S}}(v,r)\cap V_a)\) and \(v\notin \overline{\rho ^{-1}([0,\varepsilon ])}\).

Proof

Observe first that for an empty \(V_a\), the function \(\rho \) is continuous by definition. Therefore, assume for the rest of the proof that \(V_a\) is nonempty.

To prove the upper semi-continuity take \(v_0\in V_a\) and any sequence of \(v_\nu \rightarrow v_0\). Then, for any \(r< \rho (v_\nu )\) the point \((a+rv_\nu )\) lies in \({\mathcal {N}}(a)\). Therefore, from the closedness of \({\mathcal {N}}(a)\), the point \((a+rv)\) must lie in \({\mathcal {N}}(a)\) for every \(r<\limsup _{v\rightarrow v_0} \rho (v)\) . Moreover, \({\mathcal {N}}(a)\) is convex, so the whole segment \([a,a+rv_0]\) must be a subset of \({\mathcal {N}}(a)\) as well. This inclusion means that \(\rho (v_0)\ge \limsup _{v\rightarrow v_0}\rho (v)\).

For the sake of lower semi-continuity, assume that \(v\in V_a\backslash \overline{\rho ^{-1}([0,\varepsilon ])}\) for certain \(\varepsilon >0\). Now we can find \(r>0\) small enough that \(\rho (w)>\varepsilon \) for \(w\in {\mathbb {S}}(v,r)\cap {\mathcal {N}}(a)\). Since \({\mathbb {B}}(v,r)\cap {\mathcal {N}}(a)=\text {conv} {\mathbb {S}}(v,r)\cap {\mathcal {N}}(a)\), by the convexity of \({\mathcal {N}}(a)\), the value of \(\rho (x)\) for \(x=tv+(1-t)w\) is bounded from below by \(t\alpha +(1-t)\rho (w)\), for any \(\alpha <\rho (v)\). Therefore, at v the function \(\rho \) must be lower semi-continuous. \(\square \)

Mind that even though the normal set \({\mathcal {N}}(a)\) is convex for any \(a\in X\), it does not necessarily mean that an \(r>0\) satisfying \({\mathbb {B}}(v,r)\cap V_a=\text {conv}_{\mathbb {S}} ({\mathbb {S}}(v,r)\cap V_a)\) for every \(v\in V_a\) exists. Indeed, only an inclusion from right to left is automatic. Take, for example, \(X=\{ z=\sqrt{x^2+y^2}\}\). We can see that \(V_0=\{ z\le -\sqrt{x^2+y^2}\}\cap {\mathbb {S}}\), thus for \(v=(1,0,-1)\) and all \(r>0\), there is \({\mathbb {B}}(v,r)\cap V_0\supsetneq \text {conv}_{\mathbb {S}} ({\mathbb {S}}(v,r)\cap V_a)\).

Corollary 4.5

The function \(\rho : V_a\ni v\rightarrow \rho (v) = r_v(a) \in [0,+\infty ]\) is continuous for any \(a\in Reg_2 X\).

Proof

The Corollary follows easily from the fact that \(\overline{M_X}\cap Reg_2X=\emptyset \) (widely known as Nash Lemma). Clearly, there must exist such \(\varepsilon >0\) that \(\rho (v)>\varepsilon \) for every \(v\in V_a\). Furthermore, \(V_a\) is just an intersection of a unit sphere with a normal space \(N_aX\). Therefore, it is isomorphic to \({\mathbb {S}}^{\dim N_aX-1}\), thus

$$\begin{aligned} {\mathbb {B}}(v,r)\cap V_a=\text {conv}_{\mathbb {S}}({\mathbb {S}}(v,r)\cap V_a) \end{aligned}$$

for any \(r<2\). \(\square \)

Whenever the limiting directional reaching radius is positive, it can be seen as a limiting directional reaching radius transported from a \(\mathscr {C}^1\)-submanifold formed in a certain open set by \(d^{-1}(\varepsilon )\).

Lemma 4.6

For X a closed subset of \({\mathbb {R}}^n\) and \(\varepsilon >0\), denote

$$\begin{aligned} X^\varepsilon :=\{ x\in {\mathbb {R}}^n\mid d(x,X)\le \varepsilon \}. \end{aligned}$$

Then \(x\in M_{X^\varepsilon }\) if and only if \(x\in M_X\) and \(d(x,X)>\varepsilon \).

Proof

Surely \(x\in M_{X^\varepsilon }\) implies \(d(x,X)>\varepsilon \), otherwise x would be a point of \(X^\varepsilon \). Furthermore, for any point \(x\in {\mathbb {R}}^n\) with \(d(x,X)>\varepsilon \), there is

$$\begin{aligned} d(x,X)=d(x,X^\varepsilon )+\varepsilon . \end{aligned}$$

Now, for any point \(x\notin X^\varepsilon \) the set \(m_{X^\varepsilon }(x)\) is just \(m_X(x)\) scaled by a homothety of ratio \(\frac{d(x,X)-\varepsilon }{d(x,X)}\) centered at x. Therefore, \(m_{X^\varepsilon }(x)\) is a singleton if and only if \(m_X(x)\) is one as well. \(\square \)

Proposition 4.7

Take \(a\in X\) a point of a closed subset of \({\mathbb {R}}^n\), \(v\in V_a\), and \(\varepsilon >0\). Denote by \(\tilde{r}\) and \(\tilde{r}^\varepsilon \) the limiting reaching radius for X and \(X^\varepsilon \) respectively. Then \(\tilde{r}_v(a) =\tilde{r}^\varepsilon _v(a+\varepsilon v)+\varepsilon \) whenever \(\tilde{r}_v(a)>\varepsilon \).

Proof

Since \(\tilde{r}_v(a)>\varepsilon \), there exists U—a neighbourhood of (av) in

$$\begin{aligned} VX:=\{ (x, v)\mid x\in X, v\in V_x\} \end{aligned}$$

such that for any \((x,v_x)\in U\), there is \(r_{v_x}(x)>\epsilon +\delta \) for a small \(\delta >0\). It means that for \(a^\varepsilon :=(a+\varepsilon v)\), there exists a neighbourhood W in \({\mathbb {R}}^n\) such that \(\Gamma :=d^{-1}(\varepsilon )\cap W\) is a \(\mathscr {C}^1\)-smooth manifold. Moreover, we have a series of equalities:

$$\begin{aligned} N_{a^\varepsilon }\Gamma =(T_{a^\varepsilon }\Gamma )^\perp =(\nabla d) (a^\varepsilon )\cdot {\mathbb {R}}=\frac{a^\varepsilon - m (a^\varepsilon )}{\Vert a^\varepsilon - m(a^\varepsilon )\Vert } \cdot {\mathbb {R}} = (a^\varepsilon - a)\cdot {\mathbb {R}}=v{\mathbb {R}}, \end{aligned}$$

which proves that v is a normal vector to \(\Gamma \) at \(a^\varepsilon \). Therefore, it is indeed possible to calculate \(\tilde{r}_v^\varepsilon (a^\varepsilon )\).

According to Lemma 4.6, the medial axes of X and \(X^\varepsilon \) coincide in \({\mathbb {R}}^n\backslash X^\varepsilon \). Therefore, for \((x,v_x)\in U\), from \(x+r_{v_x}(x)v_x\in \overline{M_X}\cap (x+v_x{\mathbb {R}})\) we can easily derive

$$\begin{aligned} x+r_{v_x}(x)v_x\in \overline{M_{X^\varepsilon }}\cap (x+v_x{\mathbb {R}}) \text { and } ([\varepsilon ,r_{v_x}(x)) \cdot v_x+x)\cap M_{X^\varepsilon }=\emptyset . \end{aligned}$$

Thus for \((x,v_x)\in U\), there is \(r_{v_x}(x) =r_{v_x}^\varepsilon (x^\varepsilon )+\varepsilon \), where \(x^\varepsilon :=x+\varepsilon v_x\), and \(r^\varepsilon \) denotes the directional radius for \(\Gamma \) (an explanation behind \(v_x\in V_{x^\varepsilon }\) is the same as for a in the first part of the proof). Furthermore, a sequence of points \((x_\nu ,v_\nu )\in VX\) converges to (av) if and only if a sequence \((x^\varepsilon _\nu ,v_\nu )\in V\Gamma \) converges to \((a^\varepsilon ,v)\). Therefore, the appropriate limits in the definition of the limiting reaching radius are equal. \(\square \)

The main idea of the limiting directional reaching radius is to provide a suitable object for generalising the results from [15]. Indeed, the limiting directional reaching radius can be utilised to describe the frontier of the medial axis for a broader class of sets. Mind here that in contrast to the results from previous sections, the following ones do not assume the definability of a set X.

Theorem 4.8

Let X be a closed subset of \({\mathbb {R}}^n\). Pick \(x\in {\mathbb {R}}^n\backslash (X\cup M_X)\) and write \(m(x)=\{ a\}\), \(v=\frac{x-a}{\Vert x-a\Vert }\). Then for \(x\in \overline{M_X}\), there is \(d(x)\ge \tilde{r}_{v}(a)\). If additionally, \(\tilde{r}_v(a)>0\), then \(d(x)\ge \tilde{r}_{v}(a)\) implies \(x\in \overline{M_X}\).

Proof

Assume that \(x\in \overline{M_X}\backslash M_X\) and take a sequence of points \(M_X\ni x_\nu \rightarrow x\). Since the multifunction m(x) is upper semi-continuous, for an arbitrary choice of \(a_\nu \in m(x_\nu )\), we also have \(a_\nu \rightarrow a\). It of course means that \(x_\nu -a_\nu \rightarrow x-a\). Taking \(v_\nu =\frac{x_\nu -a_\nu }{\Vert x_\nu -a_\nu \Vert }\), we obtain by calculating the limiting directional reaching radius

$$\begin{aligned} \tilde{r}_{v}(a)\le \liminf _{\nu \rightarrow \infty } r_{v_\nu }(a_\nu )=\lim _{\nu \rightarrow \infty } d(x_\nu )=d(x). \end{aligned}$$

We will first prove the remaining part of the theorem with an additional assumption that X is a \(\mathscr {C}^1\)-smooth submanifold in the neighbourhood of a. Assume that \(\tilde{r}_v(a)>0\) and \(x\notin \overline{M_X}\) accordingly. We will show that \(d(x)<\tilde{r}_v(a)\).

At the very beginning, let us recall that outside of \(\overline{M_X}\cup X\), the function d(x) is of \(\mathscr {C}^1\) class. Therefore, we can find \(\varepsilon >0\) small enough that \(m(x+\varepsilon v)=m(x)\) and a neighbourhood U of \(x^\varepsilon :=(x+\varepsilon v)\) such that \(\Gamma := d^{-1}(d(x^\varepsilon ))\cap U\) is a \(\mathscr {C}^1\)-hypersurface disjoint from \(M_X\).

Now let us denote by \(\Gamma '\) the intersection of \(\Gamma \) and \((T_aX+{\mathbb {R}}v)\) translated by the vector a. The intersection is transversal, as \(v=\nabla d(x^\varepsilon )\), so \(\Gamma '\) is a (\(\dim X\))-dimensional \(\mathscr {C}^1\)-submanifold of \({\mathbb {R}}^n\). Mind that, in particular, tangent spaces to X at a and \(\Gamma '\) at \(x^\varepsilon \) are equal.

We claim that there exists an open neighbourhood \(U'\) of \(x^\varepsilon \) such that \(m|U'\cap \Gamma '\) is an injection. Suppose otherwise. Then there exists a sequence of pairs of distinct points \(x_\nu , y_\nu \in \Gamma '\) converging to \(x^\varepsilon \) such that \(m(x_\nu )=m(y_\nu )\). Since the multifunction m is univalued in U, we can write

$$\begin{aligned} \frac{x_\nu -y_\nu }{\Vert x_\nu -y_\nu \Vert } =\frac{1}{\Vert x_\nu -y_\nu \Vert } \left[ m(x_\nu )-d(x^\varepsilon )\nabla d(x_\nu )-(m(y_\nu ) -d(x^\varepsilon )\nabla d(y_\nu )) \right] . \end{aligned}$$

Now, since \(\Gamma '\) is \(\mathscr {C}^1\)-smooth, the left-hand side of the equation tends to a vector in \(T_{x^\varepsilon }\Gamma '=T_aX\) as \(\nu \rightarrow \infty \) (cf. [26]). At the same time, the square bracket on the right-hand side represents a difference of two vectors in \(N_{m(x_\nu )}X\), which by the \(\mathscr {C}^1\)-smoothness of X must tend to a vector in \(N_aX\). This is a contradiction as the limit cannot be equal to zero. Therefore, the claim is proved.

Now, Brouwer Domain Invariance theorem asserts that \(m|U'\cap \Gamma '\) is a homeomorphism. Thus, \(m(U'\cap \Gamma ')\) is an open neighbourhood of a in X. Moreover, for \(b\in m(U'\cap \Gamma ')\), we have found the normal vectors \(\eta _b\) such that \(r_{\eta _b}(b)>d(x^\varepsilon )=d(x)+\varepsilon \) and \(\eta _b\rightarrow v\,(b\rightarrow a)\). What is more, since \(\tilde{r}_v(a)>0\), all directional radii are continuous in a neighbourhood of (av). Since \(U'\cap \overline{M_X}=\emptyset \), this means that \(d(x)<\tilde{r}_v(a)\).

For \(a\notin Reg_1 X\), observe that for a positive \(\varepsilon <\tilde{r}_v(a)\), there exists a neighbourhood of \((a+\varepsilon v)\) such that \(d^{-1}(\varepsilon )\) is a \(\mathscr {C}^1\)-submanifold of \({\mathbb {R}}^n\). In such a case the distance d(xX) equals \(d(x,d^{-1}(\varepsilon ))+\varepsilon \), and the medial axis \(M_X\) coincides with \(M_{d^{-1}(\varepsilon )}\) in a certain neighbourhood of x. Moreover, for \((a_\nu ,v_\nu )\) sufficiently close to (av) the directional reaching radius \(r_{v_\nu }(a_\nu )\) calculated for X equals the directional reaching radius \(r_{v_\nu }(a_\nu +\varepsilon v_\nu )+\varepsilon \) computed for \(d^{-1}(\varepsilon )\). Therefore, we can apply the result for \(\mathscr {C}^1\)-submanifolds to \(d^{-1}(\varepsilon )\) to obtain the assertion. \(\square \)

Fig. 7
figure 7

A The intersection of \(\Gamma \) and \( T_aX +{\mathbb {R}}v\) from Theorem 4.8 is transversal. Hence the result forms a submanifold of dimension \(\dim _a X\). B The example by Chazal and Soufflet. Mark that, apart from the sphere’s centre, the points above the origin do not belong to the medial axis of X

In comparison to Miura’s results, the main asset of the reaching radius-based approach is a lack of non-spreading normal cones of X or the graph structure of X assumption. This generalisation gives a significantly broader application potential (Fig. 7).

Example

(Chazal, Soufflet [9]) Consider

$$\begin{aligned} X:=\partial \left( {\mathbb {B}}((0,0,2),2)\cup \{x>0,\, y^2+(z-1)^2<1\}\right) \subset {\mathbb {R}}^3. \end{aligned}$$

Then, for any point \(x_t=(0,0,t)\) with \(t\in [1,2)\), there is \(m(x_t)=\{ 0\}\). At the same time, \(\tilde{r}_{v}(0)\le \lim _{n\rightarrow \infty } r_v((1/n,0,0))=1\) where \(v=\frac{x_t}{\Vert x_t\Vert }\). Due to Theorem 4.8, there is \(x_t\in \overline{M_X}\backslash M_X\).

Remark 4.9

Theorem 4.8 can be further generalised with virtually no change in the proof if we observe that only the existence of a neighbourhood U of x yielding a positive limit inferior of directional radii taken by the sequences in m(U) is needed. With this approach, one can omit sequences of points that do not contribute actively to \(M_X\) near x (cf. the origin point of \(X=\{(y-x^2)(y-2x^2)=0\}\) and \(v=(0,1)\)).

Remark 4.10

Theorem 4.8 deserves an exposition in correspondence with our study of the tangent cone of the medial axes. Namely, for any \(a\in X, v\in V_a\) we always have

$$\begin{aligned} {[}a+\tilde{r}_v(a),a+r_v(a)]\subset \overline{M}_X. \end{aligned}$$

Even though the diameter of m(x) usually is not separated from zero in the neighbourhood of the medial axis boundary, for all x in an open segment \((a+r_v(a),a+\tilde{r}_v(a))\), we are able to find a line \(v{\mathbb {R}}\) in \(C_xM_X\). Stretching a little the definition of the medial axis for a single point on a sphere by putting \(M_{\{ v\}}:=\{ -v\}\), we can observe a Theorem 2.7 type inclusion for points on the medial axis frontier.

As an example of an application of Theorem 4.8, we will prove a new result on the Birbrair–Denkowski reaching radius.

Proposition 4.11

The weak reaching radius is continuous on \(Reg_2 X\).

Proof

Take \(a\in Reg_2X\). We will prove

$$\begin{aligned} \limsup _{X\backslash \{ a\} \ni x\rightarrow a} r'(x)\le r'(a) \le \liminf _{X\backslash \{ a\} \ni x\rightarrow a} r'(x). \end{aligned}$$

The function \(\rho (v)=r_v(a)\) is continuous on a compact set \(V_a\), therefore there exists \(v\in V_a\) with

$$\begin{aligned} r_v(a)=r'(a). \end{aligned}$$

Mind that, due to the smoothness class of X at a, for any sequence \(X\ni x_\nu \rightarrow a\), there exists a sequence of normal directions \(v_\nu \in V_{x_\nu }\) convergent to v. Now for any such sequence with \(r'(x_\nu )\) convergent to a certain r and \(v_\nu \in V_{x_\nu }\) convergent to v, we have

$$\begin{aligned} m(x_\nu +v_\nu r'(x_\nu ))\ni x_\nu \end{aligned}$$

and

$$\begin{aligned} x_\nu +v_\nu r'(x_\nu )\rightarrow a+vr. \end{aligned}$$

From the upper semi-continuity of m, we derive

$$\begin{aligned} \{a\}=\lim _{\nu \rightarrow \infty }\{ x_\nu \}\subset \limsup _{\nu \rightarrow \infty } m(x_\nu +v_\nu r'(x_\nu ))\subset m(a+vr). \end{aligned}$$

Thus, \(a\in m(a+vr)\), and consequently \(r\le r_v(a)\), which proves

$$\begin{aligned} \limsup _{X\backslash \{ a\} \ni x\rightarrow a} r'(x)\le r'(a). \end{aligned}$$

For the second inequality, write \(d=\dim _aX\) and take g a local parametrisation of X at a. That is, an immersion \(g:(G,0)\rightarrow (V\cap X,a)\) of \(\mathscr {C}^2\) class with GV open subsets of \({\mathbb {R}}^d,{\mathbb {R}}^n\), respectively.

Since V is open and m(x) is upper semi-continuous, for any positive \(r<r'(a)\) and \(v\in V_a\) there exists U an open neighbourhood of \(a+rv\) such that \(m(U)\subset V\). By summation, we can assume that \((a+rv)\in U\) for all \(r\in [0,r'(a))\).

Consider now

$$\begin{aligned} F:U\times G\ni (x,t)\rightarrow \left( \left\langle x-g(t), \frac{\partial g}{\partial t_i} (t)\right\rangle \right) ^d_{i=1} \in {\mathbb {R}}^d. \end{aligned}$$

The function F is \(\mathscr {C}^1\)-smooth, and since \(\{\frac{\partial g}{\partial t_i}(t)\}\) forms a base of \(T_{g(t)}X\), there is

$$\begin{aligned} F(x,t)=0\iff x-g(t)\in N_{g(t)}X. \end{aligned}$$

In particular, that brings \(F(a+rv,0)=0\). Our goal now is to use the implicit function theorem to prove that \(a+rv\) is separated from the medial axis. Even though the determinant \(\det \frac{\partial F}{\partial t}(a+rv,0)\) is not easily calculable, it is still a polynomial with respect to r and

$$\begin{aligned} \det \frac{\partial F}{\partial t}(a,0)=(-1)^d \sum \left( \det \frac{\partial (g_{i_1},\ldots , g_{i_d})}{\partial t}(0)\right) ^2\ne 0; \end{aligned}$$

hence it has only a finite number of zeros. Because of that, we can find r arbitrary close to \(r'(a)\) with \(\det \frac{\partial F}{\partial t}(a+rv,0)\ne 0\). Thus, from the implicit function theorem, there must exist \(W\times T\subset U\times G\) a neighbourhood of \((a+rv,0)\) and a \(\mathscr {C}^1\)-smooth function \(\tau :W\ni x\rightarrow \tau (x)\in T\) such that

$$\begin{aligned} (F(x,t)=0\text { and }(x,t)\in W\times T)\iff t=\tau (x). \end{aligned}$$

That means \(g(\tau (x))\) is a continuous selection from m(x) on W. Thus, m(x) is univalent on W, and as a consequence, \(a+rv\) is separated from \(M_X\). From Theorem 4.8, we obtain \(\tilde{r}_v(a)>d(a+rv)=r\), therefore

$$\begin{aligned} \forall v\in \tilde{V}_a=V_a:\; \tilde{r}_v(a)\ge r'(a). \end{aligned}$$

Take now a sequence \(X\ni x_\nu \rightarrow a\) with

$$\begin{aligned} \lim _{\nu \rightarrow \infty } r'(x_\nu )=\liminf _{X\backslash \{a\} \ni x\rightarrow a} r'(x) \end{aligned}$$

and a sequence of normal directions \(v_\nu \in V_{x_\nu }\) satisfying \(r_{v_\nu }(x_\nu )=r'(x_\nu )\). Assuming without loss of generality that \(\{ v_\nu \}\) is convergent to some vector \(v\in V_a\), we have then

$$\begin{aligned} \liminf _{X\backslash \{ a\} \ni x\rightarrow a} r'(x)=\lim _{\nu \rightarrow \infty } r'(x_\nu )=\lim _{\nu \rightarrow \infty } r_{v_\nu }(x_\nu )\ge \tilde{r}_v(a)\ge r'(a). \end{aligned}$$

\(\square \)

Remark 4.12

Proposition 4.11 not only provides insights about continuity of Birbrair–Denkowski reaching radius. What is more, it simplifies the very definition of the Birbrair–Denkowski reaching radius by taking directly

$$\begin{aligned} \dot{r}(a)=\liminf _{X\ni x\rightarrow a} r'(x). \end{aligned}$$

Theorem 4.13

For any \(a\in X\), the Birbrair–Denkowski reaching radius at a is equal to r(a).

Proof

Should \(r'(x)\equiv \infty \) in a certain neighbourhood of a, then all the directional reaching radii are infinite. In that case, all the directional limiting reaching radii at a are infinite. Thus, both reaching radii r(a) and \(\dot{r}(a)\) equal infinity as well. Therefore, for the rest of the proof, we can assume that there exists a sequence of points in X convergent to a with a finite weak reaching radius.

Take any sequence \(\{ x_\nu \} \subset X\) convergent to a with weak reaching radii convergent to \(\dot{r}(a)\). For every \(\nu \in {\mathbb {N}}\), take a sequence of \(v^\nu _\mu \in V_{x_\nu }\) approximating (sufficiently quickly) the weak reaching radius, say \(|r_{v_\mu ^\nu }(x_\nu )-r'(x_\nu )|<2^{-\mu }\). Selecting from the sequence \(\{ v_\nu ^\nu \}\) a subsequence convergent to a certain \(v\in \tilde{V}_a\subset {\mathbb {S}}\), we obtain

$$\begin{aligned} \tilde{r}_v(a)=\liminf \limits _{\begin{array}{c} X\ni x\rightarrow a\\ V_x\ni v_x\rightarrow v\in \tilde{V}_a \end{array}} r_{v_x}(x) \le \lim _{\nu \rightarrow \infty } r_{v_\nu ^\nu }(x_\nu )=\dot{r}(a). \end{aligned}$$

Of course, the value of \(\tilde{r}_v(a)\) is bigger than or equal to the infimum of the limiting directional radius over \(\widetilde{V}_a\). Thus, we obtain

$$\begin{aligned} r(a)\le \dot{r}(a). \end{aligned}$$

Assume now that \(r(a)< \dot{r}(a)\). Mind that, in particular, \(r(a)<\infty \). It is possible then to choose \(\varepsilon >0\) such that

$$\begin{aligned} r(a)+\varepsilon <\liminf _{x\rightarrow a} r'(x). \end{aligned}$$

Thus we can find U - such a neighbourhood of a that for any \(x\in U\cap X\),

$$\begin{aligned} r(a)+\varepsilon /2<r'(x)\le r_{v_x}(x),\;\forall v_x\in V_x. \end{aligned}$$

Then by taking a sequence \(\{v_\nu \} \subset \widetilde{V}_a\) realising an infimum in the definition of r(a), we obtain for x close enough to a

$$\begin{aligned} \tilde{r}_{v_\nu }(a)=\liminf \limits _{\begin{array}{c} X\ni x\rightarrow a\\ V_x\ni v_x\rightarrow v_\nu \in \tilde{V}_a \end{array}} r_{v_x}(x)> r(a)+\varepsilon /2. \end{aligned}$$

By passing with \(\nu \) to infinity, we obtain a contradiction

$$\begin{aligned} r(a)\ge r(a)+\varepsilon /2. \end{aligned}$$

\(\square \)

Remark 4.14

Theorem 4.13 and Proposition 4.11 give together the continuity of the reaching radius on \(Reg_2X\).