1 Introduction

Continuous functions between digital images were introduced in [12] and have been explored in many subsequent papers. However, the notion of a continuous function f between digital images X and Y does not always yield results analogous to what might be expected from parallels with the Euclidean objects modeled by X and Y. For example, in Euclidean space, if X is a square and Y is an arc such that \(Y \subset X\), then Y is a continuous retract of X [1]. However, [2] gives an example of a digital square X containing a digital arc Y such that Y is not a continuous retract of X.

In order to address such anomalies, digitally continuous multivalued functions were introduced [6, 7]. These papers showed that in some ways, digitally continuous multivalued functions allow the digital world to model the Euclidean world better than digitally continuous single-valued functions. However, digitally continuous multivalued functions have their own anomalies, e.g., composition does not always preserve continuity among digitally continuous multivalued functions [8].

In this paper, we study connectivity preserving multivalued functions between digital images and show that these offer some advantages over continuous multivalued functions. One of these advantages is that the composition of connectivity preserving multivalued functions between digital images is connectivity preserving. Another advantage is that the concept of connectivity preservation of a map on a digital image can be defined without any reference to a particular realization of X as a subset of \({\mathbb {Z}}^n\); by contrast, an example discussed in Sect. 2 shows that continuity of a multivalued map on \((X,\kappa )\) is heavily influenced by how X is embedded in \({\mathbb {Z}}^n\). These advantages help us to generalize easily our definitions and results to images of any dimension and adjacency relations.

There are also disadvantages in the use of connectivity preserving multivalued functions as compared with the use of continuous multivalued functions. In Sect. 7, we show ways in which continuous multivalued functions better model retractions of Euclidean topology than do connectivity preserving multivalued functions.

2 Preliminaries

We will assume familiarity with the topological theory of digital images. See, e.g., [2] for the standard definitions. All digital images X are assumed to carry their own adjacency relations (which may differ from one image to another). When we wish to emphasize the particular adjacency relation we write the image as \((X,\kappa )\), where \(\kappa \) represents the adjacency relation.

Among the commonly used adjacencies are the \(c_u\)-adjacencies. Let \(x,y \in {\mathbb {Z}}^n\), \(x \ne y\). Let u be an integer, \(1 \le u \le n\). We say x and y are \(c_u\)-adjacent if

  • There are at most u indices i for which \(|x_i - y_i| = 1\).

  • For all indices j such that \(|x_j - y_j| \ne 1\), we have \(x_j=y_j\).

We often label a \(c_u\)-adjacency by the number of points adjacent to a given point in \({\mathbb {Z}}^n\) using this adjacency. For example,

  • In \({\mathbb {Z}}^1\), \(c_1\)-adjacency is 2-adjacency.

  • In \({\mathbb {Z}}^2\), \(c_1\)-adjacency is 4-adjacency and \(c_2\)-adjacency is 8-adjacency.

  • In \({\mathbb {Z}}^3\), \(c_1\)-adjacency is 6-adjacency, \(c_2\)-adjacency is 18-adjacency, and \(c_3\)-adjacency is 26-adjacency.

For much of the paper, we will not need to assume that \((X,\kappa )\) is embedded as a subset of \(({\mathbb {Z}}^n, \kappa )\) for some particular n.

A subset Y of a digital image \((X,\kappa )\) is \(\kappa \) -connected [12], or connected when \(\kappa \) is understood, if for every pair of points \(a,b \in Y\) there exists a sequence \(\{y_i\}_{i=0}^m \subset Y\) such that \(a=y_0\), \(b=y_m\), and \(y_i\) and \(y_{i+1}\) are \(\kappa \)-adjacent for \(0 \le i < m\). The following generalizes a definition of [12].

Definition 2.1

[3] Let \((X,\kappa )\) and \((Y,\lambda )\) be digital images. A function \(f: X \rightarrow Y\) is \((\kappa ,\lambda )\)-continuous if for every \(\kappa \)-connected \(A \subset X\) we have that f(A) is a \(\lambda \)-connected subset of Y.

When the adjacency relations are understood, we will simply say that f is continuous. Continuity can be reformulated in terms of adjacency of points:

Theorem 2.2

[3, 12] A function \(f:X\rightarrow Y\) is continuous if and only if, for any adjacent points \(x,x'\in X\), the points f(x) and \(f(x')\) are equal or adjacent. \(\square \)

For two subsets \(A,B\subset X\), we will say that A and B are adjacent when there exist points \(a\in A\) and \(b\in B\) such that a and b are equal or adjacent. Thus, sets with nonempty intersection are automatically adjacent, while disjoint sets may or may not be adjacent. It is easy to see that a union of connected adjacent sets is connected.

A multivalued function \(f:X\rightarrow Y\) assigns a subset of Y to each point of x. We will write \(f:X \multimap Y\). For \(A \subset X\) and a multivalued function \(f:X\multimap Y\), let \(f(A) = \bigcup _{x \in a} f(x)\).

Definition 2.3

[10] A multivalued function \(f:X\multimap Y\) is connectivity preserving if \(f(A)\subset Y\) is connected whenever \(A\subset X\) is connected.

As is the case with Definition 2.1, we can reformulate connectivity preservation in terms of adjacencies.

Theorem 2.4

A multivalued function \(f:X \multimap Y\) is connectivity preserving if and only if the following are satisfied:

  • For every \(x \in X\), f(x) is a connected subset of Y.

  • For any adjacent points \(x,x'\in X\), the sets f(x) and \(f(x')\) are adjacent.

Proof

First assume that f satisfies the two conditions above, let A be connected, and we will show that f(A) is connected. Take two points \(y,y' \in f(A)\), and we will find a connected subset \(B \subset f(A)\) containing y and \(y'\), and thus y and \(y'\) are connected by a path in f(A). Since \(y,y' \in f(A)\), there are points \(x,x'\in A\) with \(y\in f(x)\) and \(y'\in f(x')\). Since A is connected there is a path \(x=x_0, x_1,\dots , x_k=x'\) with \(x_i\in A\) and \(x_i\) adjacent to \(x_{i+1}\) for each i.

By our hypotheses, we have \(f(x_i)\) connected and \(f(x_i)\) adjacent to \(f(x_{i+1})\) for each i. Thus, the union

$$\begin{aligned} B = \bigcup _{i=0}^k f(x_i) \end{aligned}$$

is connected, since it is a union of connected adjacent sets. So \(B \subset f(A)\) is connected and contains y and \(y'\), which concludes the proof that f(A) is connected.

Now for the converse assume that f is connectivity preserving, and we will prove the two properties in the statement of the theorem. The first property is trivially satisfied since \(f(x) = f(\{x\})\) and \(\{x\}\) is connected. To prove the second property, assume that \(x,x'\in X\) are adjacent, and we will show that f(x) and \(f(x')\) are adjacent.

Since x and \(x'\) are adjacent, the set \(\{x,x'\}\) is connected and thus the set \(f(\{x,x'\}) = f(x) \cup f(x')\) is connected. Therefore, f(x) must be adjacent to \(f(x')\). \(\square \)

Definition 2.3 is related to a definition of multivalued continuity for subsets of \({\mathbb {Z}}^n\) given and explored by Escribano, Giraldo, and Sastre in [6, 7] based on subdivisions. (These papers make a small error with respect to compositions, which is corrected in [8].) Their definitions are as follows:

Definition 2.5

For any positive integer r, the rth subdivision of \({\mathbb {Z}}^n\) is

$$\begin{aligned} {\mathbb {Z}}_r^n = \{ (z_1/r, \dots , z_n/r) \mid z_i \in {\mathbb {Z}}\}. \end{aligned}$$

An adjacency relation \(\kappa \) on \({\mathbb {Z}}^n\) naturally induces an adjacency relation (which we also call \(\kappa \)) on \({\mathbb {Z}}_r^n\) as follows: \((z_1/r, \dots , z_n/r), (z'_1/r, \dots , z'_n/r)\) are adjacent in \({\mathbb {Z}}^n_r\) if and only if \((z_1, \dots , z_n)\) and \((z_1, \dots , z_n)\) are adjacent in \({\mathbb {Z}}^n\).

Given a digital image \((X,\kappa ) \subset ({\mathbb {Z}}^n,\kappa )\), the rth subdivision of X is

$$\begin{aligned} S(X,r) = \{ (x_1,\dots , x_n) \in {\mathbb {Z}}^n_r \mid (\lfloor x_1 \rfloor , \dots , \lfloor x_n \rfloor ) \in X \}. \end{aligned}$$

Let \(E_r:S(X,r) \rightarrow X\) be the natural map sending \((x_1,\dots ,x_n) \in S(X,r)\) to \((\lfloor x_1 \rfloor , \dots , \lfloor x_n \rfloor )\).

For a digital image \((X,\kappa ) \subset ({\mathbb {Z}}^n,\kappa )\), a function \(f:S(X,r) \rightarrow Y\) induces a multivalued function \(F:X\multimap Y\) as follows:

$$\begin{aligned} F(x) = \bigcup _{x' \in E^{-1}_r(x)} \{f(x')\}. \end{aligned}$$

A multivalued function \(F:X\multimap Y\) is called continuous when there is some r such that F is induced by some single-valued continuous function \(f:S(X,r) \rightarrow Y\).

An example of two spaces and their subdivisions is given in Fig. 1.

Fig. 1
figure 1

Two images X and Y with their second subdivisions

Note that the subdivision construction (and thus the notion of continuity) depends on the particular embedding of X as a subset of \({\mathbb {Z}}^n\). In particular, we may have \(X, Y \subset {\mathbb {Z}}^n\) with X isomorphic to Y but S(Xr) not isomorphic to S(Yr). This in fact is the case for the two images in Fig. 1, when we use 8-adjacency for all images. The spaces X and Y in the figure are isomorphic, each being a set of two adjacent points. But S(X, 2) and S(Y, 2) are not isomorphic, since S(X, 2) can be disconnected by removing a single point, while this is impossible in S(Y, 2).

The definition of connectivity preservation makes no reference to X as being embedded inside of any particular integer lattice \({\mathbb {Z}}^n\).

Proposition 2.6

[6, 7] Let \(F:X\multimap Y\) be a continuous multivalued function between digital images. Then

  • for all \(x \in X\), F(x) is connected and

  • for all connected subsets A of X, F(A) is connected.\(\square \)

Theorem 2.7

For \((X,\kappa ) \subset ({\mathbb {Z}}^n,\kappa )\), if \(F:X\multimap Y\) is a continuous multivalued function, then F is connectivity preserving.

Proof

By Proposition 2.6, for all connected subsets A of X, F(A) is connected. The assertion follows from Definition 2.3. \(\square \)

The subdivision machinery often makes it difficult to prove that a given multivalued function is continuous. By contrast, many maps can easily be shown to be connectivity preserving.

Proposition 2.8

Let X and Y be digital images. Suppose Y is connected. Then the multivalued function \(f: X \multimap Y\) defined by \(f(x)=Y\) for all \(x \in X\) is connectivity preserving.

Proof

This follows easily from Definition 2.3. \(\square \)

Proposition 2.9

Let \(F: (X,\kappa ) \multimap (Y,\lambda )\) be a multivalued surjection between digital images \((X,\kappa ),(Y,\kappa )\subset ({\mathbb {Z}}^n, \kappa )\). If X is finite and Y is infinite, then F is not continuous.

Proof

Since F is a surjection, X is finite, and Y is infinite, there exists \(x' \in X\) such that \(F(x')\) is an infinite set. Therefore, no continuous single-valued function \(f: S(X,r) \rightarrow Y\) induces F, since for such a function, \(\bigcup _{x \in E_r^{-1}(x')} \{f(x) \}\) is finite. \(\square \)

Corollary 2.10

Let \(F: X \multimap Y\) be the multivalued function between digital images defined by \(F(x)=Y\) for all \(x \in X\). If X is finite and Y is infinite and connected, then F is connectivity preserving but not continuous.

Proof

This follows from Propositions 2.8 and 2.9. \(\square \)

Examples of connectivity preserving but not continuous multivalued functions on finite spaces are harder to construct, since one must show that a given connectivity preserving map \(X \multimap Y\) cannot be induced by any map on any subdivision. After some more development, we will give such an example in Example 7.6.

Other terminology we use includes the following. Given a digital image \((X,\kappa ) \subset {\mathbb {Z}}^n\) and \(x \in X\), the set of points adjacent to \(x \in {\mathbb {Z}}^n\), the neighborhood of x in \({\mathbb {Z}}^n\), and the boundary of X in \({\mathbb {Z}}^n\) are, respectively,

$$\begin{aligned} N_{\kappa }(x)= & {} \{y \in {\mathbb {Z}}^n \, | \, y \text{ is } \kappa \text{-adjacent } \text{ to } x\},\\ N_{\kappa }^*(x)= & {} N_{\kappa }(x) \cup \{x\}, \end{aligned}$$

and

$$\begin{aligned} \delta _{\kappa }(X)=\{y \in X \, | \, N_{\kappa }(y) \setminus X \ne \emptyset \}. \end{aligned}$$

3 Other Notions of Multivalued Continuity

Other notions of continuity have been given for multivalued functions between graphs (equivalently, between digital images). We have the following.

Definition 3.1

[14] Let \(F: X \multimap Y\) be a multivalued function between digital images.

  • F has weak continuity if for each pair of adjacent \(x,y \in X\), f(x) and f(y) are adjacent subsets of Y.

  • F has strong continuity if for each pair of adjacent \(x,y \in X\), every point of f(x) is adjacent or equal to some point of f(y) and every point of f(y) is adjacent or equal to some point of f(x).\(\square \)

Proposition 3.2

Let \(F: X \multimap Y\) be a multivalued function between digital images. Then F is connectivity preserving if and only if F has weak continuity and for all \(x \in X\), F(x) is connected.

Proof

This follows from Theorem 2.4. \(\square \)

Example 3.3

If \(F: [0,1]_{{\mathbb {Z}}} \multimap [0,2]_{{\mathbb {Z}}}\) is defined by \(F(0)=\{0,2\}\), \(F(1)=\{1\}\), then F has both weak and strong continuity. Thus, a multivalued function between digital images that has weak or strong continuity need not have connected point images. By Theorem 2.4 and Proposition 2.6, it follows that neither having weak continuity nor having strong continuity implies that a multivalued function is connectivity preserving or continuous. \(\square \)

Example 3.4

Let \(F: [0,1]_{{\mathbb {Z}}} \multimap [0,2]_{{\mathbb {Z}}}\) be defined by \(F(0)=\{0,1\}\), \(F(1)=\{2\}\). Then F is continuous and has weak continuity but does not have strong continuity. \(\square \)

Proposition 3.5

Let \(F: X \multimap Y\) be a multivalued function between digital images. If F has strong continuity and for each \(x \in X\), F(x) is connected, then F is connectivity preserving.

Proof

The assertion follows from Definition 3.1 and Theorem 2.4. Alternately, it follows from Proposition 3.2, since strong continuity implies weak continuity. \(\square \)

The following shows that not requiring the images of points to be connected yields topologically unsatisfying consequences for weak and strong continuity.

Example 3.6

Let X and Y be nonempty digital images. Let the multivalued function \(f: X \multimap Y\) be defined by \(f(x)=Y\) for all \(x \in X\).

  • f has both weak and strong continuity.

  • f is connectivity preserving if and only if Y is connected.

Proof

That f has both weak and strong continuity is clear from Definition 3.1.

Suppose f is connectivity preserving. Then for \(x \in X\), \(f(x)=Y\) is connected. Conversely, if Y is connected, it follows easily from Definition 2.3 that f is connectivity preserving. \(\square \)

As a specific example consider \(X= \{0\} \subset {\mathbb {Z}}\) and \(Y = \{0,2\}\), all with \(c_1\) adjacency. Then the function \(F:X \multimap Y\) with \(F(0) = Y\) has both weak and strong continuity, even though it maps a connected image surjectively onto a disconnected image.

4 Composition

Connectivity preservation of multivalued functions is preserved by compositions. For two multivalued functions \(f:X\multimap Y\) and \(g:Y \multimap Z\), let \(g \circ f:X \multimap Z\) be defined by

$$\begin{aligned} g\circ f (x) = g(f(x)) = \bigcup _{y \in f(x)} g(y). \end{aligned}$$

Theorem 4.1

If \(f:X\multimap Y\) and \(g:Y \multimap Z\) are connectivity preserving, then \(g\circ f:X\multimap Z\) is connectivity preserving.

Proof

We must show that \(g\circ f(A) = g(f(A))\) is connected whenever A is connected. Since f is connectivity preserving we have f(A) connected, and then since g is connectivity preserving we have g(f(A)) connected.\(\square \)

By contrast with Theorem 4.1, Remark 4 of [8] shows that composition does not always preserve continuity in multivalued functions between digital images. The example given there has finite digital images XYZ in \({\mathbb {Z}}^2\) and multivalued functions \(F: X \rightarrow Y\), \(G: Y \rightarrow Z\) such that F is (4, k)-continuous and G is \((k,k')\)-continuous for \(\{k,k'\} \subset \{4,8\}\), but \(G \circ F: X \rightarrow Z\) is not \((4,k')\)-continuous. In fact, the example presented in [8] shows that even if F is a single-valued isomorphism, \(G \circ F\) need not be a continuous multivalued function. However, by Theorems 2.7 and 4.1, \(G \circ F\) is \((4,k')\)-connectivity preserving.

5 Shy Maps and Their Inverses

Definition 5.1

[4] Let \(f: X \rightarrow Y\) be a continuous surjection of digital images. We say f is shy if

  • for each \(y \in Y\), \(f^{-1}(y)\) is connected and

  • for every \(y_0,y_1 \in Y\) such that \(y_0\) and \(y_1\) are adjacent, \(f^{-1}(\{y_0,y_1\})\) is connected.

Shy maps induce surjections on fundamental groups [4]. Some relationships between shy maps f and their inverses \(f^{-1}\) as multivalued functions were studied in [5], including a restricted analog of Theorem 5.2 below. We have the following.

Theorem 5.2

Let \(f: X \rightarrow Y\) be a continuous surjection between digital images. Then f is shy if and only if \(f^{-1}: Y \multimap X\) is a connectivity preserving multivalued function.

Proof

This follows immediately from Theorem 2.4 and Definition 5.1. \(\square \)

6 Morphological Operators

In [6, 7], it was shown that several fundamental operations of mathematical morphology can be performed by using continuous multivalued functions on digital images. In this section, we obtain similar results using connectivity preserving multivalued functions. In order to define the morphological operators, we must assume in this section that all images X under consideration are embedded in \({\mathbb {Z}}^n\) for some n with a globally defined adjacency relation \(\kappa \). Thus, in this section, we always have \((X,\kappa ) \subset ({\mathbb {Z}}^n, \kappa )\). The work in [6, 7] focuses exclusively on \(n=2\), and \(\kappa \) being 4- or 8-adjacency. Our results have the advantage of being applicable in any dimensions and using any (globally defined) adjacency relation.

6.1 Dilation and Erosion

In the following, the use of \(k=4\) or \(k=8\) indicates 4-adjacency or 8-adjacency, respectively, in \({\mathbb {Z}}^2\).

Dilation [13] of a binary image can be regarded as a method of magnifying or swelling the image. A common method of performing a dilation of a digital image \((X,\kappa ) \subset ({\mathbb {Z}}^n,\kappa )\) is to take the dilation

$$\begin{aligned} D_{\kappa }(X) = \bigcup _{x \in X}N_{\kappa }^*(x). \end{aligned}$$

Theorem 6.1

([7]; proof corrected in [8]) Given \((X,k) \subset ({\mathbb {Z}}^2,k)\), the multivalued functions \(\tilde{D}_k: X \rightarrow D_k(X) \subset {\mathbb {Z}}^2\) defined by \(\tilde{D}_k(x) = N_k^*(x)\), where \(k \in \{4,8\}\), are both (4, 4)-continuous and (8, 8)-continuous. \(\square \)

Theorem 6.2

Given a digital image \((X,\kappa ) \subset ({\mathbb {Z}}^n,\kappa )\), the multivalued function \(\tilde{D}_{\kappa }: X \rightarrow D_{\kappa }(X) \subset {\mathbb {Z}}^n\) defined by \(\tilde{D}_{\kappa }(x) = N_{\kappa }^*(x)\) is connectivity preserving.

Proof

For every \(x \in X\), \(\tilde{D}_{\kappa }(x)\) is \(\kappa \)-connected. Given \(\kappa \)-adjacent points \(x,x' \in X\), we have \(x' \in \tilde{D}_{\kappa }(x)\), so \(\tilde{D}_{\kappa }(x)\) and \(\tilde{D}_{\kappa }(x')\) are \(\kappa \)-adjacent. The assertion follows from Theorem 2.4. \(\square \)

More general dilations are defined as follows. Let \(X \subset {\mathbb {Z}}^n\) be a digital image and let \(B \subset {\mathbb {Z}}^n\), with the origin of \({\mathbb {Z}}^n\) a member of B. We call B a structuring element. Given \(x \in {\mathbb {Z}}^n\), let \(t_x\) be the translation by x: \(t_x(y)=x+y\) for all \(y\in {\mathbb {Z}}^n\) . The dilation of X by B is

$$\begin{aligned} D_B(X)= \bigcup _{x \in X}t_x(B). \end{aligned}$$

We have the following.

Theorem 6.3

Let \(X \subset {\mathbb {Z}}^n\) be a digital image with \(c_u\)-adjacency for \(1 \le u \le n\) and let \(B \subset {\mathbb {Z}}^n\) be a structuring element. If B is \(c_u\)-connected, then the multivalued dilation function \(\tilde{D}_B: X \multimap D_B(X)\) defined by \(\tilde{D}_B(x) = t_x(B)\) is connectivity preserving.

Proof

Since B is \(c_u\)-connected and \(t_x\) is continuous, \(\tilde{D}_B(x)\) is connected for all \(x \in X\). If \(x_0\) and \(x_1\) are \(c_u\)-adjacent members of X and \(b \in B\), then \(x_0+b\) and \(x_1+b\) are \(c_u\)-adjacent, so \(\tilde{D}_B(x_0)\) and \(\tilde{D}_B(x_1)\) are \(c_u\)-adjacent. The assertion follows from Theorem 2.4. \(\square \)

Note that Theorem 6.3 is easily generalized to any adjacency that is preserved by translations.

There are nonequivalent definitions of the erosion operation in the literature. We will use the definition of [7]: the \(\kappa \)-erosion of \(X \subset {\mathbb {Z}}^n\) is

$$\begin{aligned} E_{\kappa }(X)={\mathbb {Z}}^n \setminus D_{\kappa }({\mathbb {Z}}^n \setminus X). \end{aligned}$$

In [7], we find the following.

The erosion operation cannot be adequately modeled as a digitally continuous multivalued function on the set of black pixels since it can transform a connected set into a disconnected set, or even delete it (for example, the erosion of a curve is the empty set and, in general, the erosion of two disks connected by a curve would be the disconnected union of two smaller disks). However, since the erosion of a set agrees with the dilation of its complement, the erosion operator can be modeled by a continuous multivalued function on the set of white pixels.

It follows from Theorem 6.2 that the erosion operator can be modeled by a connectivity preserving multivalued function on the set of white pixels. That is, as an analog of Corollary 6.4 below, we have Corollary 6.5 below. We use the notation \(\overline{E}_{\kappa }\) to suggest that the function’s image is the compliment of the erosion.

Corollary 6.4

([7]; proof corrected in [8]) Given \(X \subset {\mathbb {Z}}^n\), the multivalued function \(\overline{E}_k: {\mathbb {Z}}^2 \setminus X \rightarrow {\mathbb {Z}}^2\) given by \(\overline{E}_k(y)=N_k^*(y)\) for \(y \in {\mathbb {Z}}^2 \setminus X\) is both (4, 4)- and (8, 8)-continuous, where \(k \in \{4,8\}\). \(\square \)

Corollary 6.5

Given \((X, \kappa ) \subset ({\mathbb {Z}}^n,\kappa )\), the multivalued function \(\overline{E}_{\kappa }: {\mathbb {Z}}^n \setminus X \rightarrow {\mathbb {Z}}^n\) given by \(\overline{E}_\kappa (x)=N_{\kappa }^*(x)\) is connectivity preserving.

Proof

The assertion follows as in the proof of Theorem 6.2.

\(\square \)

6.2 Closing and Opening

Like dilation, closing (or computing the closure of) a digital image can be regarded as a way to swell the image.

The closure operator \(C_{\kappa }\) is the result of a dilation followed by an erosion. Since we have defined an erosion on X as a dilation on \({\mathbb {Z}}^n \setminus X\), we cannot say that \(C_{\kappa }\) is a composition of a dilation and an erosion, since the corresponding composition \(\overline{E}_{\kappa } \circ \tilde{D}_{\kappa }\) is not generally defined. However, from the definitions above, the closure of X can be defined as

$$\begin{aligned} C_{\kappa }(X)= {\mathbb {Z}}^n \setminus \tilde{D}_{\kappa }\big ({\mathbb {Z}}^n \Big \backslash \bigcup _{x \in X}N_{\kappa }^*(x)\big ). \end{aligned}$$

This yields the following results.

Theorem 6.6

[7] Given \(X \subset {\mathbb {Z}}^2\), the closure operator \(C_k\) is (kk)-continuous, \(k \in \{4,8\}\). \(\square \)

Theorem 6.7

Given a digital image \((X,\kappa ) \subset ({\mathbb {Z}}^n,\kappa )\), the closure operator \(C_{\kappa }\) is connectivity preserving.

Proof

Note we can define a multivalued function \(\tilde{C}_{\kappa }: X \multimap C_{\kappa }(X)\) by

$$\begin{aligned} \tilde{C}_{\kappa }(x)= \left\{ \begin{array}{ll} \{x\} &{} \text{ if }\quad x \in X \setminus \delta _{\kappa }(X); \\ N_{\kappa }^*(x) \cap C_{\kappa }(x) &{} \text{ if }\quad x \in \delta _{\kappa }(X). \end{array} \right. \end{aligned}$$

Since \(X \subset C_{\kappa }(X)\) and each point of \(N_{\kappa }^*(x)\) is \(\kappa \)-adjacent or equal to x, it follows that \(\tilde{C}_{\kappa }(x)\) is connected for all \(x \in X\). Further, for \(\kappa \)-adjacent \(x, x' \in X\), we have \(x \in \tilde{C}_{\kappa }(x)\) and \(x' \in \tilde{C}_{\kappa }(x')\), so f(x) and \(f(x')\) are adjacent. The assertion follows from Theorem 2.4. \(\square \)

We find in [7] the following.

As it happens in the case of the erosion, the opening operation (erosion composed with dilation) cannot be adequately modeled as a digitally continuous multivalued function on the set of black pixels (the same examples used for the erosion also work for the opening). However, since the opening of a set agrees with the closing of its complement [13], the k-opening operator can be modeled by a k-continuous multivalued function on the set of white pixels.

Thus, we define an opening operator for X as the closure operator on \({\mathbb {Z}}^n \setminus X\). Corresponding to Corollary 6.8 below, we have Corollary 6.9 below.

Corollary 6.8

[7] Given \(X \subset {\mathbb {Z}}^2\), the k-opening operation on X can be modeled as a (4, 4)- or (8, 8)-continuous function \(\overline{O}_k: {\mathbb {Z}}^2 \setminus X \rightarrow {\mathbb {Z}}^2\). \(\square \)

Corollary 6.9

Given \((X,\kappa ) \subset ({\mathbb {Z}}^n,\kappa )\), the \(\kappa \)-opening operation on X can be modeled as a connectivity preserving function \(\overline{O}_{\kappa }: {\mathbb {Z}}^n \setminus X \rightarrow {\mathbb {Z}}^n\).

Proof

The assertion follows from Theorem 6.7. \(\square \)

7 Retractions, Connectivity Preserving Multivalued Retractions, and Deletion of Subsets

A continuous single-valued or multivalued function, or a connectivity preserving multivalued function, r, from a set X to a subset Y of X is called a retraction [1], a multivalued retraction, or a connectivity preserving multivalued retraction, respectively, if \(r(y)=y\) (respectively, \(r(y)=\{y\}\)) for all \(y \in Y\). In this case we say Y is a retract of X, a multivalued retract of X, or a connectivity preserving multivalued retract of X, respectively. It is known [2] that the boundary of a digital square is not a retract of the square. By contrast, we have the following.

Example 7.1

Let \(X=[-1,1]_{\mathbb {Z}}^2\). Let \(Y=X \setminus \{(0,0)\}\). Then (Y, 8) is a connectivity preserving multivalued retract of (X, 8).

Proof

It is easy to see that the multivalued function \(r: X \multimap Y\) given by

$$\begin{aligned} r(x)=\left\{ \begin{array}{ll} Y &{} \text{ if }\quad x = (0,0); \\ \{x\} &{} \text{ if }\quad x \in Y, \end{array} \right. \end{aligned}$$

is a connectivity preserving multivalued retraction of (X, 8) onto (Y, 8). As we will see below, (Y, 8) is not a multivalued retract of (X, 8), and thus r is connectivity preserving but not continuous. \(\square \)

We can generalize the example given above in the following result. The existence of connectivity preserving multivalued retractions is easily formulated in terms of connected images:

Theorem 7.2

Let X be connected and let \(A\subset X\), \(A \ne \emptyset \). Then A is a connectivity preserving multivalued retract of X if and only if A is connected.

Proof

First assume that A is connected. Then define \(f:X\multimap A\) by

$$\begin{aligned} f(x) = {\left\{ \begin{array}{ll} \{x\} &{} {\text { if }}\quad x \in A, \\ A &{} {\text { if }} \quad x \not \in A. \end{array}\right. } \end{aligned}$$

f clearly has the retraction property that \(f(A)=A\) and \(f(x)=\{x\}\) for all \(x \in A\). To show connectivity preservation, let \(B\subset X\) be a connected set, and we will show that f(B) is connected. In the case that \(B \subset A\), we have \(f(B) = B\) is connected. Otherwise, \(B \setminus A \ne \emptyset \) so we have \(f(B) = A\) which was assumed to be connected. Thus, f is connectivity preserving, so A is a connectivity preserving multivalued retract of X as desired.

For the converse, assume that A is a connectivity preserving multivalued retract of X. Since X is connected, A must be connected. \(\square \)

Theorem 7.2 makes it easy to tell when one set is a connectivity preserving multivalued retract of another. The analogous question for continuous multivalued retracts is addressed in [7] (corrected in [8]), where the results are quite a bit more complicated, stated in terms of simple points, characterized by the following.

Definition 7.3

[9] Let \(X \subset {\mathbb {Z}}^2\). Let \(\{k,\overline{k}\}=\{4,8\}\). Let \(p \in X\). Then p is a k-boundary point of X if and only if \(N_{\overline{k}}(p) \setminus X \ne \emptyset \). \(\square \)

Theorem 7.4

[11] Let \(X \subset {\mathbb {Z}}^2\). Then \(p \in X\) is k-simple, \(k \in \{4,8\}\), if and only if p is a k-boundary point of X and the number of k-connected components of \(N_8(p) \cap X\) that are k-adjacent to p is equal to 1. \(\square \)

Continuous multivalued retracts relate to simple points as follows:

Theorem 7.5

[8, Theorem 5] Let \((X,8)\subset {\mathbb {Z}}^2\) be a connected digital image, and let \(p\in X\). Then \(X-\{p\}\) is a continuous multivalued retract of X if and only if p is a simple point. \(\square \)

The requirement that p be a simple point is a stronger condition than \(X-\{p\}\) being connected, the condition for our Theorem 7.2. The authors of [8] also obtain a similar result for 4-adjacency requiring additional hypotheses, and discuss removal of pairs of simple points. Their arguments become quite difficult and do not seem able to address removal of arbitrary subsets as in Theorem 7.2.

Contrasting the results of Theorems 7.2 and 7.5 gives examples of maps on finite spaces that are connectivity preserving but not continuous. In particular, we have the following.

Example 7.6

Let X and Y be the images in Example 7.1.

  • The point (0, 0) is not a simple point of X and thus, Y is not a continuous multivalued retract of X, although Y is a connectivity preserving multivalued retract of X.

  • The multivalued function r of Example 7.1 is connectivity preserving but not continuous.

Proof

We saw in Example 7.1 that r is connectivity preserving and that Y is a connectivity preserving multivalued retract of X.

  • Clearly, (0, 0) is not a simple point of X. From Theorem 7.5, Y is not a continuous multivalued retract of X.

  • Were r continuous then r would be a multivalued retraction, contrary to Theorem 7.5.\(\square \)

8 Further Remarks

We have studied connectivity preserving multivalued functions between digital images. This notion generalizes continuous multivalued functions. We have shown that composition, which does not preserve continuity for continuous multivalued functions, preserves connectivity preservation for multivalued functions between digital images. We have obtained a number of results for connectivity preserving multivalued functions between digital images, concerning weak and strong continuity, shy maps, morphological operators, and retractions; many of our results are suggested by analogs for continuous multivalued functions in [58].