Continuous functions between digital images were introduced in  and have been explored in many subsequent papers. However, the notion of a continuous function between digital images and does not always yield results analogous to what might be expected from parallels with the Euclidean objects modeled by and . For example, in Euclidean space, if is a square and is an arc such that , then is a continuous retract of . However,  gives an example of a digital square containing a digital arc such that is not a continuous retract of .
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 .
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 as a subset of ; by contrast, an example discussed in Section 2 shows that continuity of a multivalued map on is heavily influenced by how is embedded in . 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 continous multivalued functions. In section 7, we show ways in which continuous multivalued functions better model retractions of Euclidean topology than do connectivity preserving multivalued functions.
We will assume familiarity with the topological theory of digital images. See, e.g.,  for the standard definitions. All digital images 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 , where represents the adjacency relation.
Among the commonly used adjacencies are the -adjacencies. Let , . Let be an integer, . We say and are -adjacent if
There are at most indices for which .
For all indices such that we have .
We often label a -adjacency by the number of points adjacent to a given point in using this adjacency. E.g.,
In , -adjacency is 2-adjacency.
In , -adjacency is 4-adjacency and -adjacency is 8-adjacency.
In , -adjacency is 6-adjacency, -adjacency is 18-adjacency, and -adjacency is 26-adjacency.
For much of the paper, we will not need to assume that is embedded as a subset of for some particular .
A subset of a digital image is -connected , or connected when is understood, if for every pair of points there exists a sequence such that , , and and are -adjacent for . The following generalizes a definition of .
 Let and be digital images. A function is -continuous if for every -connected we have that is a -connected subset of .
When the adjacency relations are understood, we will simply say that is continuous. Continuity can be reformulated in terms of adjacency of points:
For two subsets , we will say that and are adjacent when there exist points and such that and 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 assigns a subset of to each point of . We will write . For and a multivalued function , let .
 A multivalued function is connectivity preserving if is connected whenever is connected.
As is the case with Definition 2.1, we can reformulate connectivity preservation in terms of adjacencies.
A multivalued function is connectivity preserving if and only if the following are satisfied:
For every , is a connected subset of .
For any adjacent points , the sets and are adjacent.
First assume that satisfies the two conditions above, let be connected, and we will show that is connected. Take two points , and we will find a connected subset containing and , and thus and are connected by a path in . Since , there are points with and . Since is connected there is a path with and adjacent to for each .
By our hypotheses, we have connected and adjacent to for each . Thus the union
is connected, since it is a union of connected adjacent sets. So is connected and contains and , which concludes the proof that is connected.
Now for the converse assume that is connectivity preserving, and we will prove the two properties in the statement of the theorem. The first property is trivially satisfied since and is connected. To prove the second property, assume that are adjacent, and we will show that and are adjacent.
Since and are adjacent, the set is connected and thus the set is connected. Therefore, must be adjacent to . ∎
Definition 2.3 is related to a definition of multivalued continuity for subsets of 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 .) Their definitions are as follows:
For any positive integer , the -th subdivision of is
An adjacency relation on naturally induces an adjacency relation (which we also call ) on as follows: are adjacent in if and only if and are adjacent in .
Given a digital image , the -th subdivision of is
Let be the natural map sending to .
For a digital image , a function induces a multivalued function as follows:
A multivalued function is called continuous when there is some such that is induced by some single valued continuous function .
An example of two spaces and their subdivisions is given in Figure 1.
Note that the subdivision construction (and thus the notion of continuity) depends on the particular embedding of as a subset of . In particular we may have with isomorphic to but not isomorphic to . This in fact is the case for the two images in Figure 1, when we use 8-adjacency for all images. The spaces and in the figure are isomorphic, each being a set of two adjacent points. But and are not isomorphic since can be disconnected by removing a single point, while this is impossible in .
The definition of connectivity preservation makes no reference to as being embedded inside of any particular integer lattice .
For , if is a continuous multivalued function, then is connectivity preserving.
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.
Let and be digital images. Suppose is connected. Then the multivalued function defined by for all is connectivity preserving.
This follows easily from Definition 2.3. ∎
Let be a multivalued surjection between digital images . If is finite and is infinite, then is not continuous.
Since is a surjection, is finite, and is infinite, there exists such that is an infinite set. Therefore, no continuous single-valued function induces , since for such a function, is finite. ∎
Let be the multivalued function between digital images defined by for all . If is finite and is infinite and connected, then is connectivity preserving but not continuous.
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 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 and , the set of points adjacent to , the neighborhood of in , and the boundary of in are, respectively,
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.
 Let be a multivalued function between digital images.
has weak continuity if for each pair of adjacent , and are adjacent subsets of .
has strong continuity if for each pair of adjacent , every point of is adjacent or equal to some point of and every point of is adjacent or equal to some point of . ∎
Let be a multivalued function between digital images. Then is connectivity preserving if and only if has weak continuity and for all , is connected.
This follows from Theorem 2.4. ∎
If is defined by , , then has both weak and strong continuity. Thus a multivalued function 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.
Let be defined by , . Then is continuous and has weak continuity but does not have strong continuity.
Let be a multivalued function between digital images. If has strong continuity and for each , is connected, then is connectivity preserving.
The following shows that not requiring the images of points to be connected yields topologically unsatisfying consequences for weak and strong continuity.
Let and be nonempty digital images. Let the multivalued function be defined by for all .
has both weak and strong continuity.
is connectivity preserving if and only if is connected.
That has both weak and strong continuity is clear from Definition 3.1.
Suppose is connectivity preserving. Then for , is connected. Conversely, if is connected, it follows easily from Definition 2.3 that is connectivity preserving. ∎
As a specific example consider and , all with adjacency. Then the function with has both weak and strong continuity, even though it maps a connected image surjectively onto a disconnected image.
Connectivity preservation of multivalued functions is preserved by compositions. For two multivalued functions and , let be defined by
If and are connectivity preserving, then is connectivity preserving.
We must show that is connected whenever is connected. Since is connectivity preserving we have connected, and then since is connectivity preserving we have connected. ∎
By contrast with Theorem 4.1, Remark 4 of  shows that composition does not always preserve continuity in multivalued functions between digital images. The example given there has finite digital images in and multivalued functions , such that is -continuous and is -continuous for , but is not -continuous. In fact, the example presented in  shows that even if is a single-valued isomorphism, need not be a continuous multivalued function. However, by Theorems 2.7 and 4.1, is -connectivity preserving.
5 Shy maps and their inverses
 Let be a continuous surjection of digital images. We say is shy if
for each , is connected, and
for every such that and are adjacent, is connected.
Shy maps induce surjections on fundamental groups . Some relationships between shy maps and their inverses as multivalued functions were studied in , including a restricted analog of Theorem 5.2 below. We have the following.
Let be a continuous surjection between digital images. Then is shy if and only if is a connectivity preserving multivalued function.
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 under consideration are embedded in for some with a globally defined adjacency relation . Thus in this section we always have . The work in [6, 7] focuses exclusively on , and 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 or indicates 4-adjacency or 8-adjacency, respectively, in .
Dilation  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 is to take the dilation
Given a digital image , the multivalued function defined by is connectivity preserving.
For every , is -connected. Given -adjacent points , we have , so and are -adjacent. The assertion follows from Theorem 2.4. ∎
More general dilations are defined as follows. Let be a digital image and let , with the origin of a member of . We call a structuring element. Given , let be the translation by : for all . The dilation of by is
We have the following.
Let be a digital image with -adjacency for and let be a structuring element. If is -connected, then the multivalued dilation function defined by is connectivity preserving.
Since is -connected and is continuous, is connected for all . If and are -adjacent members of and , then and are -adjacent, so and are -adjacent. The assertion follows from Theorem 2.4. ∎
Note that Theorem 6.3 is easily generalized to any adjacency that is preserved by translations.
There are non-equivalent definitions of the erosion operation in the literature. We will use the definition of : the -erosion of is
In , 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 discs connected by a curve would be the disconnected union of two smaller discs). 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. I.e., as an analog of Corollary 6.4 below, we have Corollary 6.5 below. We use the notation to suggest that the function’s image is the compliment of the erosion.
Given , the multivalued function given by is connectivity preserving.
The assertion follows as in the proof of Theorem 6.2. ∎
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 is the result of a dilation followed by an erosion. Since we have defined an erosion on as a dilation on , we cannot say that is a composition of a dilation and an erosion, since the corresponding composition is not generally defined. However, from the definitions above, the closure of can be defined as
This yields the following results.
 Given , the closure operator is -continuous, . ∎
Given a digital image , the closure operator is connectivity preserving.
Note we can define a multivalued function by
Since and each point of is -adjacent or equal to , it follows that is connected for all . Further, for -adjacent , we have and , so and are adjacent. The assertion follows from Theorem 2.4. ∎
We find in  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 , the k-opening operator can be modeled by a k-continuous multivalued function on the set of white pixels.
 Given , the -opening operation on can be modeled as a - or -continuous function . ∎
Given , the -opening operation on can be modeled as a connectivity preserving function .
The assertion follows from Theorem 6.7. ∎
7 Retractions, connectivity preserving multivalued retractions, and deletion of subsets
A continuous single-valued or multivalued function, or a connectivity preserving multivalued function, , from a set to a subset of is called a retraction , a multivalued retraction, or a connectivity preserving multivalued retraction, respectively, if (respectively, ) for all . In this case we say is a retract of , a multivalued retract of , or a connectivity preserving multivalued retract of , respectively. It is known  that the boundary of a digital square is not a retract of the square. By contrast, we have the following.
Let . Let . Then is a connectivity preserving multivalued retract of .
It is easy to see that the multivalued function given by
is a connectivity preserving multivalued retraction of onto . As we will see below, is not a multivalued retract of , and thus is connectivity preserving but not continuous. ∎
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:
Let be connected and let , . Then is a connectivity preserving multivalued retract of if and only if is connected.
First assume that is connected. Then define by:
clearly has the retraction property that and for all . To show connectivity preservation, let be a connected set, and we will show that is connected. In the case that we have is connected. Otherwise, so we have which was assumed to be connected. Thus is connectivity preserving, so is a connectivity preserving multivalued retract of as desired.
For the converse, assume that is a connectivity preserving multivalued retract of . Since is connected, must be connected. ∎
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  (corrected in ), where the results are quite a bit more complicated, stated in terms of simple points, characterized by the following.
 Let . Let . Let . Then is a -boundary point of if and only if .
 Let . Then is -simple, , if and only if is a -boundary point of and the number of -connected components of that are -adjacent to is equal to 1. ∎
Continuous multivalued retracts relate to simple points as follows:
[8, Theorem 5] Let be a connected digital image, and let . Then is a continuous multivalued retract of if and only if is a simple point. ∎
The requirement that be a simple point is a stronger condition than being connected, the condition for our Theorem 7.2. The authors of  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.
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 analogues for continuous multivalued functions in [6, 7, 8, 5].
We are grateful for the suggestions of the anonymous reviewers.
-  K. Borsuk, Theory of Retracts, Polish Scientific Publishers, Warsaw, 1967.
-  L. Boxer, Digitally Continuous Functions, Pattern Recognition Letters 15 (1994), 833-839.
-  L. Boxer, A Classical Construction for the Digital Fundamental Group, Pattern Recognition Letters 10 (1999), 51-62.
-  L. Boxer, Properties of Digital Homotopy, Journal of Mathematical Imaging and Vision 22 (2005), 19-26.
-  L. Boxer, Remarks on Digitally Continuous Multivalued Functions, Journal of Advances in Mathematics 9 (1) (2014), 1755-1762.
-  C. Escribano, A. Giraldo, and M. Sastre, “Digitally Continuous Multivalued Functions,” in Discrete Geometry for Computer Imagery, Lecture Notes in Computer Science, v. 4992, Springer, 2008, 81–92.
-  C. Escribano, A. Giraldo, and M. Sastre, “Digitally Continuous Multivalued Functions, Morphological Operations and Thinning Algorithms,” Journal of Mathematical Imaging and Vision 42 (2012), 76–91.
-  A. Giraldo and M. Sastre, On the Composition of Digitally Continuous Multivalued Functions, Journal of Mathematical Imaging and Vision, 58 (2015), 196–209.
-  T.Y. Kong and A. Rosenfeld, eds. Topological Algorithms for Digital Image Processing, Elsevier, 1996.
-  V.A. Kovalevsky, A new concept for digital geometry, Shape in Picture, Springer-Verlag, New York, 1994, pp. 37-51.
-  A. Rosenfeld, Digital Topology, American Mathematical Monthly 86 (1979), 621-630.
-  A. Rosenfeld, ‘Continuous’ Functions on Digital Images, Pattern Recognition Letters 4 (1987), 177-184.
Soille, P.: Morphological operators. In: J hne, B., et al. (eds.), Signal Processing and Pattern Recognition. Handbook of Computer Vision and Applications, vol. 2, pp. 627?682. Academic Press, San Diego (1999).
-  Tsaur, R., and Smyth, M.: “Continuous” multifunctions in discrete spaces with applications to fixed point theory. In: Bertrand, G., Imiya, A., Klette, R. (eds.), Digital and Image Geometry, Lecture Notes in Computer Science, vol. 2243, pp. 151-162. Springer Berlin / Heidelberg (2001), http://dx.doi.org/10.1007/3-540-45576-0 5, 10.1007/3-540-45576-0 5