Keywords

1 Introduction

The space of one-sided infinite words plays a crucial rôle in several parts of Theoretical Computer Science (see the surveys [18, 23]). Usually, it is convenient to regard this space as a topological space provided with the Cantor topology. This topology can be also considered as the natural continuation of the left topology of the prefix relation on the space of finite words (cf. [3]).

It turned out that for several purposes other topologies on the space of infinite words are also useful [12, 16], e.g. for investigations in first-order logic [4], to characterise the set of random infinite words [2] or the set of disjunctive infinite words [20] and to describe the converging behaviour of not necessarily hyperbolic iterative function systems [6, 19].

Most of these approaches use topologies on the space of infinite words which are refinements of the Cantor topology showing a certain kind of shift invariance. In [14] a unified treatment of those shift invariant topologies is given, and here we built on this work, introducing two new topologies arising naturally from the consideration of finite subwords occurring in infinite words.

2 Notation and Preliminaries

We introduce the notation used throughout the paper. By \(\mathrm {I\!N}= \{0,1,2,\ldots \}\) we denote the set of natural numbers. Let X be a finite alphabet of cardinality \(|X|\ge 2\), and \(X^*\) be the set (monoid) of words on X, including the empty word e, and \(X^{\omega }\) be the set of infinite sequences (\(\omega \)-words) over X. For \(w\in X^*\) and \(\eta \in X^*\cup X^{\omega }\) let \(w \cdot {}\eta \) be their concatenation. This concatenation product extends in an obvious way to subsets \(W \subseteq X^*\) and \(P\subseteq X^*\cup X^{\omega }\). For a language W let \(W^* := \bigcup _{i \in \mathrm {I\!N}} W^i\) be the submonoid of \(X^*\) generated by W, and by \(W^\omega :=\{w_1\cdots w_i\cdots : w_i\in W\setminus \{e\}\}\) we denote the set of infinite strings formed by concatenating words in W. Furthermore |w| is the length of the word \(w\in X^*\) and \({\mathbf {pref}(P)}\) (\({\mathbf {infix}(P)}\)) is the set of all finite prefixes (infixes) of strings in \(P\subseteq X^*\cup X^\omega \), in particular, \({\mathbf {pref}(P)}\subseteq {\mathbf {infix}(P)}\). We shall abbreviate \(w\in {\mathbf {pref}(\eta )}\ (\eta \in X^*\cup X^\omega )\) by \(w\sqsubseteq \eta \). If \(\xi \in X^{\omega }\) by \({\mathsf {infix^\infty }(\xi )}\subseteq {\mathbf {infix}(\xi )}\) we denote the set of infixes occurring infinitely often in \(\xi \).

Further we denote by \(P/w:= \{\eta : w\cdot \eta \in P\}\) the left derivative or state of the set \(P\subseteq X^*\cup X^{\omega }\) generated by the word w. We refer to P as finite-state provided the set of states \(\{P/w: w\in X^{*}\}\) is finite. It is well-known that a language \(W\subseteq X^{*}\) is finite state if and only if it is accepted by a finite automaton, that is, it is a regular language.Footnote 1

In the case of \(\omega \)-languages regular \(\omega \) -languages, that is, \(\omega \)-languages accepted by finite automata, are the finite unions of sets of the form \(W\cdot {}V^\omega \), where W and V are regular languages (cf. e.g. [18]). Every regular \(\omega \)-language is finite-state, but, as it was observed in [25], not every finite-state \(\omega \)-language is regular (cf. also [15]).

It is well-known that the families of regular or finite-state \(\omega \)-languages are closed under Boolean operations (see [11, 18, 23, 24] or [15]).

3 The CANTOR Topology and Regular \(\omega \)-Languages

In this section we list some properties of the Cantor topology on \(X^{\omega }\) and regular \(\omega \)-languages (see [18, 23]).

3.1 Basic Properties of the CANTOR Topology

We consider the space of infinite words (\(\omega \)-words) \(X^{\omega }\) as a metric space with metric \(\rho \) defined as follows

$$\begin{aligned} \rho (\xi ,\eta ):= \sup \{r^{1-|w|}:w\in {\mathbf {pref}(\xi )}\,\mathsf {\Delta }\,{\mathbf {pref}(\eta )}\} \end{aligned}$$
(1)

Here \(r>1\) is a real numberFootnote 2, \(\,\mathsf {\Delta }\,\) denotes the symmetric difference of sets and we set \(\sup \emptyset :=0\), that is, \(\rho (\xi ,\eta )=0\) if and only of \(\xi =\eta \).

Since \({\mathbf {pref}(\xi )}\,\mathsf {\Delta }\,{\mathbf {pref}(\eta )}\subseteq \bigl ({\mathbf {pref}(\xi )}\,\mathsf {\Delta }\,{\mathbf {pref}(\zeta )}\bigr )\,\cup \,\bigl ({\mathbf {pref}(\zeta )}\,\mathsf {\Delta }\,{\mathbf {pref}(\eta )}\bigr )\), the metric \(\rho \) satisfies the ultra-metric inequality

$$\begin{aligned} \rho (\xi ,\eta )\le \max \{\rho (\xi ,\zeta ),\rho (\zeta ,\eta )\}\,. \end{aligned}$$

A subset \(E\subseteq X^{\omega }\) is open if for every \(\xi \in E\) there is an \(\epsilon >0\) such that \(\eta \in E\) for all \(\eta \) with \(\rho (\xi ,\eta )<\epsilon \). Complements of open sets are called closed. The smallest closed set containing a given set \(F\subseteq X^{\omega }\), \(\mathcal {C}(F)\), is referred to as the closure of F.

\(\mathbf {G}_{\delta }\)-sets are countable intersections of open sets and \(\mathbf {F}_{\sigma }\)-sets are countable unions of closed sets. In a metric space every open set is an \(\mathbf {F}_{\sigma }\)-set, and every closed set is a \(\mathbf {G}_{\delta }\)-set.

We list some further well-known properties of the metric space \((X^{\omega },\rho )\).

Property 1

The following is true.

  1. 1.

    The non-empty sets \(w\cdot X^{\omega }\) are open balls with radius \(r^{-|w|}\) in the metric space \((X^{\omega },\rho )\).Footnote 3 These balls are simultaneously closed.

  2. 2.

    Open sets in \((X^{\omega },\rho )\) are of the form \(W\cdot X^{\omega }\) where \(W\subseteq X^{*}\).

  3. 3.

    A subset \(E\subseteq X^{\omega }\) is open and closed (clopen) in \((X^{\omega },\rho )\) if and only if \(E= W\cdot X^{\omega }\) where \(W\subseteq X^{*}\) is finite.

  4. 4.

    A subset \(F\subseteq X^{\omega }\) is closed in \((X^{\omega },\rho )\) if and only if \(F=\{\xi :{\mathbf {pref}(\xi )}\subseteq {\mathbf {pref}(F)}\}\).

  5. 5.

    The closure of F satisfies \(\mathcal {C}(F):= \{\xi :\xi \in X^{\omega }\wedge {\mathbf {pref}(\xi )}\subseteq {\mathbf {pref}(F)}\}=\bigcap \limits _{n\in \mathrm {I\!N}}({\mathbf {pref}(F)}\cap X^{n})\cdot X^{\omega }\).

The space \((X^{\omega },\rho )\) is a complete space, that is, every sequenceFootnote 4 \((\xi _{i})_{i\in \mathrm {I\!N}}\) where \(\rho (\xi _{j},\xi _{k})< r^{-i}\) whenever \(i\le j,k\) converges to some \(\xi \in X^\omega \). Moreover, \((X^{\omega },\rho )\) is a compact space, that is, for every family of open sets \((E_{i})_{i\in J}\) such that \(\bigcup _{i\in J}E_{i}=X^{\omega }\) there is a finite sub-family \((E_{i})_{i\in J'}\) satisfying \(\bigcup _{i\in J'}E_{i}=X^{\omega }\).

3.2 Regular \(\omega \)-Languages

As a last part of this section we mention some facts on regular \(\omega \)-languages known from the literature, e.g. [11, 18, 23]. Regular \(\omega \)-languages are well-known for being the \(\omega \)-languages definable by finite automata. We will not refer to this feature, instead we list some basic properties of this family of \(\omega \)-languages.

The first one shows among other properties the importance of ultimately periodic \(\omega \)-words. Denote by \(\mathsf {Ult}:=\{w\cdot v^{\omega }:w,v\in X^{*}\setminus \{e\}\}\) the set of ultimately periodic \(\omega \)-words.

Theorem 1

(Büchi [1]). The family of regular \(\omega \)-languages is a Boolean algebra, and if \(F\subseteq X^{\omega }\) is regular, then \(u\cdot F\) and F / w are also regular.

Every non-empty regular \(\omega \)-language contains an ultimately periodic \(\omega \)-word, and regular \(\omega \)-languages \(E,F\subseteq X^{\omega }\) coincide if and only if \(E\cap \mathsf {Ult}=F\cap \mathsf {Ult}\).

For regular \(\omega \)-languages we have the following topological characterisations analogous to Property 1.

Property 2

Let \(F\subseteq X^{\omega }\) be regular and \(E\subseteq X^{\omega }\) be finite-state. Then in Cantor topology the following hold true.

  1. 1.

    F is open if and only if \(F=W\cdot X^{\omega }\) where \(W\subseteq X^{*}\) is a regular language.

  2. 2.

    \(F\subseteq X^{\omega }\) is closed if and only if \(F= \{\xi : {\mathbf {pref}(\xi )}\subseteq {\mathbf {pref}(F)}\}\) and \({\mathbf {pref}(F)}\) is regular.

  3. 3.

    \({\mathbf {pref}(E)}\) is a regular language.

  4. 4.

    \(\mathcal {C}(E)\) is a regular \(\omega \)-language.

Finally, we provide an example of a regular \(\omega \)-language which is not a \(\mathbf {G}_{\delta }\)-set and a necessary and sufficient topological condition when finite-state \(\omega \)-languages are regular.

Example 1

(Landweber [8]). For \(u\in X^{*}\setminus \{e\}\) the \(\omega \)-language \(X^{*}\cdot u^{\omega }\) is regular, an \(\mathbf {F}_{\sigma }\)-set but not a \(\mathbf {G}_{\delta }\)-set.\(\square \)

Theorem 2

([15]). Every finite-state \(\omega \)-language in the class \(\mathbf {F}_{\sigma }\cap \mathbf {G}_{\delta }\) is a Boolean combination of regular \(\omega \)-languages open in \((X^\omega ,\rho )\), thus, in particular, a regular \(\omega \)-language.

4 Topologies Defined by Subword Metrics

It was shown that regular \(\omega \)-languages are closely related to the (asymptotic) subword complexity of infinite words (cf. [17, Sect. 5] and [21]). Therefore, as other refinements of the Cantor topology we introduce two topologies defined via metrics on \(X^{\omega }\) which are based on the sets of subwords occurring or occurring infinitely often in the \(\omega \)-words, respectively.

Definition 1

(Subword metrics)

$$\begin{aligned} \begin{array}{r@{\,}c@{\,}l} \rho _{I}(\xi ,\eta )&{}:=&{} \sup \{r^{1-|w|}:w\in ({\mathbf {pref}(\xi )}\,\mathsf {\Delta }\,{\mathbf {pref}(\eta )})\cup ({\mathbf {infix}(\xi )}\,\mathsf {\Delta }\,{\mathbf {infix}(\eta )})\}\\ \rho _{\infty }(\xi ,\eta )&{}:=&{} \sup \{r^{1-|w|}:w\in ({\mathbf {pref}(\xi )}\,\mathsf {\Delta }\,{\mathbf {pref}(\eta )})\cup ({\mathsf {infix^\infty }(\xi )}\,\mathsf {\Delta }\,{\mathsf {infix^\infty }(\eta )})\} \end{array} \end{aligned}$$

These metrics respect except for the length of a shortest non-common prefix of \(\xi \) and \(\eta \) also the length of a shortest non-common subword (non-common subword occurring infinitely often). Thus

$$\begin{aligned} \rho _{I}(\xi ,\eta )\ge & {} \rho (\xi ,\eta ) \text{ and } \rho _{\infty }(\xi ,\eta )\ge \rho (\xi ,\eta ), \end{aligned}$$
(2)
$$\begin{aligned} \rho _{I}(\xi ,\eta )= & {} \max \bigl \{\rho (\xi ,\eta ),\, \sup \{r^{1-|u|}:u\in {\mathbf {infix}(\xi )}\,\mathsf {\Delta }\,{\mathbf {infix}(\eta )}\}\bigr \}, \text{ and } \end{aligned}$$
(3)
$$\begin{aligned} \rho _{\infty }(\xi ,\eta )= & {} \max \bigl \{\rho (\xi ,\eta ),\, \sup \{r^{1-|u|}:u\in {\mathsf {infix^\infty }(\xi )}\,\mathsf {\Delta }\,{\mathsf {infix^\infty }(\eta )}\}\bigr \}. \end{aligned}$$
(4)

Similar to the case of \(\rho \) one can verify that \(\rho _{I}\) and \(\rho _{\infty }\) satisfy the ultra-metric inequality. Therefore, balls in the metric spaces \((X^{\omega },\rho _{I})\) and \((X^{\omega },\rho _{\infty })\) are simultaneously open and closed. Moreover, Eq. (2) shows that both topologies refine the Cantor topology of \(X^{\omega }\), that is, \(\omega \)-languages open (closed) in Cantor topology are likewise open (closed, respectively) in both spaces \((X^{\omega },\rho _{I})\) and \((X^{\omega },\rho _{\infty })\).

4.1 Shift-Invariance

We call a metric space \((X^{\omega },\rho ')\) shift invariant if for every open set \(E\subseteq X^{\omega }\) and every word \(w\in X^{*}\) the sets \(w\cdot E\) and E / w are also open. In this part we show that the metric spaces \((X^\omega ,\rho _\infty )\) and \((X^\omega ,\rho _I)\) are shift-invariant. According to Corollary 2 of [14] this property guarantees that the closure of a finite-state \(\omega \)-language is again finite-state (cf. the stronger Property 2.4 for the Cantor topology).

To this end we derive some simple properties of the metrics.

Lemma 1

Let \(u\in X^{*}\) and \(v,w\in X^{m}\). Then

$$\begin{aligned} \rho _{\infty }(u\cdot \xi ,u\cdot \eta )\le & {} \rho _{\infty }(\xi ,\eta ), \end{aligned}$$
(5)
$$\begin{aligned} \rho _{\infty }(\xi ,\eta )\le & {} r^{m}\cdot \rho _{\infty }(w\cdot \xi ,v\cdot \eta ), \end{aligned}$$
(6)
$$\begin{aligned} \rho _{I}(u\cdot \xi ,u\cdot \eta )\le & {} \rho _{I}(\xi ,\eta ),\text{ and } \end{aligned}$$
(7)
$$\begin{aligned} \rho _{I}(\xi ,\eta )\le & {} r^{m}\cdot \rho _{I}(w\cdot \xi ,v\cdot \eta ). \end{aligned}$$
(8)

Proof

All inequalities are trivially satisfied if \(\xi =\eta \). So, in the following, we may assume \(\xi \ne \eta \).

As \({\mathsf {infix^\infty }(\xi )}= {\mathsf {infix^\infty }(u\cdot \xi )}\), Eqs. (5) and (6) follow from Eq. (4) and the respective properties of the metric \(\rho \) of the Cantor topology \(\rho (u\cdot \xi ,u\cdot \eta )\le \rho (\xi ,\eta )\) and \(\rho (w\cdot \xi ,v\cdot \eta )\ge \rho (w\cdot \xi ,w\cdot \eta )= r^{-|w|}\cdot \rho (\xi ,\eta )\).

Let \(\rho _{I}(\xi ,\eta )=r^{-n}\), that is, \({\mathbf {infix}(\xi )}\cap X^{n}={\mathbf {infix}(\eta )}\cap X^{n}\) and \(w\sqsubset \xi \) and \(w\sqsubset \eta \) for some \(w\in X^{n}\). Then, obviously, \(v\sqsubset u\cdot \xi \) and \(v\sqsubset u\cdot \eta \) for some \(v\in X^{n}\). Moreover, \({\mathbf {infix}(u\cdot \xi )}\cap X^{n}=({\mathbf {infix}(u\cdot w)}\cap X^{n})\cup ({\mathbf {infix}(\xi )}\cap X^{n})={\mathbf {infix}(u\cdot \eta )}\cap X^{n}\). This proves Eq. (7).

If \(w\ne v\) then in view of \(\rho (w\cdot \xi ,v\cdot \eta )\ge r^{-(m-1)}\), Eq. (8) is obvious. Let \(w=v\) and \(\rho _{I}(\xi ,\eta ) = r^{-n}\) for some \(n\in \mathrm {I\!N}\). We have to show that \(\rho _{I}(w\cdot \xi ,w\cdot \eta ) \ge r^{-(n+m)}\).

If \(\rho (\xi ,\eta )= r^{-n}\) then \(\rho (w\cdot \xi ,w\cdot \eta )= r^{-(n+m)}\) and Eq. (3) proves \(\rho _{I}(w\cdot \xi ,w\cdot \eta )\ge r^{-(n+m)}\).

If \(\rho (\xi ,\eta )< r^{-n}\) in view of \(\rho _{I}(\xi ,\eta ) = r^{-n}\) we have \(({\mathbf {infix}(\xi )}\,\mathsf {\Delta }\,{\mathbf {infix}(\eta )})\cap X^{n+1}\ne \emptyset \), that is, \(u\in ({\mathbf {infix}(\xi )}\,\mathsf {\Delta }\,{\mathbf {infix}(\eta )})\cap X^{n+1}\) for some \(u\in {\mathbf {infix}(\xi )}\), say. Now, it suffices to show \(({\mathbf {infix}(w\xi )}\,\mathsf {\Delta }\,{\mathbf {infix}(w\eta )})\cap X^{n+m+1}\ne \emptyset \). Assume \(v'u \notin {\mathbf {infix}(w\xi )}\,\mathsf {\Delta }\,{\mathbf {infix}(w\eta )}\) for all \(v'\in X^{m}\). Then \(u\in {\mathbf {infix}(\xi )}\) implies \(v'u\in {\mathbf {infix}(w\xi )}\cap {\mathbf {infix}(w\eta )}\) for some \(v'\in X^{m}\). Since \(|w|=|v'|=m\), we have \(u\in {\mathbf {infix}(\eta )}\), a contradiction. \(\square \)

As a consequence we obtain our result.

Corollary 1

The topologies \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\) are shift invariant.

Proof

We use the fact that, in view of Lemma 1, the mappings \(\varPhi _{u}\) and \(\varPhi _{m}\) defined by \(\varPhi _{u}(\xi ):= u\cdot \xi \) and \(\varPhi _{m}(w\cdot \xi ):=\xi \) for \(w\in X^{m}\) are continuous w.r.t. the metrics \(\rho _{I}\) and \(\rho _{\infty }\), respectively.

Thus, if \(F\subseteq X^{\omega }\) is open in \((X^\omega ,\rho _I)\) or \((X^\omega ,\rho _\infty )\) the preimage \(\varPhi _{u}^{-1}(F)= F/u\) and, for \(m=|w|\), also \(w\cdot F=\varPhi _{m}^{-1}(F)\cap w\cdot X^{\omega }\) are open sets. \(\square \)

4.2 Balls in \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\)

Denote by \(K_{I}(\xi ,r^{-n})\) and \(K_{\infty }(\xi ,r^{-n})\) the open ballsFootnote 5 of radius \(r^{-n}\) around \(\xi \) in the spaces \((X^{\omega },\rho _{I})\) and \((X^{\omega },\rho _{\infty })\), respectively. For \(w\sqsubset \xi \) with \(|w|=n+1\) and \(W:= X^{n+1}\cap {\mathbf {infix}(\xi )}\), \(V:= X^{n+1}\cap {\mathsf {infix^\infty }(\xi )}\), \(\overline{W}:= X^{n+1}\setminus {\mathbf {infix}(\xi )}\) and \(\overline{V}:= X^{n+1}\setminus {\mathsf {infix^\infty }(\xi )}\) we obtain the following description of balls via regular \(\omega \)-languages.

$$\begin{aligned} K_{I}(\xi ,r^{-n})= & {} w\cdot X^{\omega }\cap {\textstyle \bigcap \limits _{u\in W}}X^{*}\cdot u\cdot X^{\omega }\setminus {\textstyle \bigcup \limits _{u\in \overline{W}}}X^{*}\cdot u\cdot X^{\omega }, \text{ and } \end{aligned}$$
(9)
$$\begin{aligned} K_{\infty }(\xi ,r^{-n})= & {} w\cdot X^{\omega }\cap X^{*}\cdot \bigl (({\textstyle \prod \limits _{u\in V}}X^{*}\cdot u)^{\omega }\setminus {\textstyle \bigcup \limits _{u\in \overline{V}}}X^{*}\cdot u\cdot X^{\omega }\bigr ). \end{aligned}$$
(10)

In Eq. (10) the order of the words \(u\in V\) can be arbitrarily chosen. In particular, Eqs. (9) and (10) show that balls in \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\) are regular \(\omega \)-languages. Thus every non-empty open subset in each of the spaces contains an ultimately periodic \(\omega \)-word.

An immediate consequence of the representations in Eqs. (9) and (10) is the following relation between the space \((X^\omega ,\rho _I)\) and the Cantor space \((X^\omega ,\rho )\).

Lemma 2

  1. 1.

    Every ball \(K_{I}(\xi ,r^{-n})\) is a Boolean combination of regular \(\omega \)-languages open in \((X^{\omega },\rho )\), therefore, simultaneously an \(\mathbf {F}_{\sigma }\)- and a \(\mathbf {G}_{\delta }\)-set in Cantor topology.

  2. 2.

    Every open set in \((X^\omega ,\rho _I)\) is an \(\mathbf {F}_{\sigma }\)-set in Cantor topology.

Proof

  1. 1.

    It is well-known know that open sets in a metric space are simultaneously \(\mathbf {F}_{\sigma }\)- and \(\mathbf {G}_{\delta }\)-sets. Then, according to Property 1, the set \(K_{I}(\xi ,r^{-n})\) is simultaneously an \(\mathbf {F}_{\sigma }\)- and \(\mathbf {G}_{\delta }\)-set in the Cantor topology.

  2. 2.

    is a consequence of 1 and the fact that there are only countably many open balls in \((X^\omega ,\rho _I)\).\(\square \)

Equations (9) and (10) and Lemma 2 show a connection between certain regular \(\omega \)-languages and the open sets in \((X^\omega ,\rho _I)\). It would be interesting if we could characterise some regular \(\omega \)-languages open in \((X^\omega ,\rho _I)\) using Cantor topology. The next example considering the simple case of closed sets, however, shows that not every regular \(\omega \)-language closed in Cantor topology is open in \((X^\omega ,\rho _I)\).

Example 2

( [7]). Consider the regular \(\omega \)-language \(F=\{1,00\}^{\omega }\subseteq \{0,1\}^{\omega }\) which is closed in the Cantor topology. Assume F to be open in \((X^\omega ,\rho _I)\). Then \(\eta = \prod _{i\in \mathrm {I\!N}}10^{2i}\in F\) and, therefore, \(K_{I}(\eta ,r^{-n})\subseteq F\) for some \(n\in \mathrm {I\!N},\, n\ge 1\).

Consider \(\xi = \prod _{i=0}^{n}10^{2i}\cdot \prod _{i=2n+1}^{\infty }10^{i}\notin F\). Then we have \(\prod _{i=0}^{n}10^{2i}\sqsubset \eta \), \(\prod _{i=0}^{n}10^{2i}\sqsubset \xi \) and, moreover,

$$\begin{aligned} \begin{array}{rcl} {\mathbf {infix}(\xi )}\cap \{0,1\}^{2n}&{}=&{}\bigl ({\mathbf {infix}(\prod _{i=0}^{n}10^{2i})}\cup 0^{*}\cdot 1\cdot 0^{*}\cup 0^{*}\bigr )\cap \{0,1\}^{2n}\\ &{}=&{}{\mathbf {infix}(\eta )}\cap \{0,1\}^{2n}. \end{array} \end{aligned}$$

It follows \(\rho _{I}(\xi ,\eta )\le r^{-2n}\), that is, \(\xi \in {K}_{I}(\eta ,r^{-n})\subseteq \{1,00\}^{\omega }\), a contradiction.   \(\square \)

Using the Morse-Hedlund Theorem (cf. also the proof of Theorem 1.3.13 of [9]) one obtains special representations of small balls containing ultimately periodic \(\omega \)-words. To this end we derive the following lemma.

Lemma 3

Let \(w,u\in X^{*}, u\ne e\) and \(\xi \in X^{\omega }\). Then \(w\cdot u\sqsubset \xi \) and \({\mathbf {infix}(\xi )}\cap X^{|w\cdot u|}= {\mathbf {infix}(w\cdot u^{\omega })}\cap X^{|w\cdot u|}\) imply \(\xi =w\cdot u^{\omega }\).

Proof

First observe that \(|{\mathbf {infix}(w\cdot u^{\omega })}\cap X^{|w\cdot u|}|= |{\mathbf {infix}(w\cdot u^{\omega })}\cap X^{|w\cdot u|+1}|\). Thus, for every \(v\in {\mathbf {infix}(w\cdot u^{\omega })}\cap X^{|w\cdot u|}\), there is a unique \(v'\in {\mathbf {infix}(w\cdot u^{\omega })}\cap X^{|w\cdot u|}\) such that \(v\sqsubset a\cdot v'\) for some \(a\in X\). Consequently, the \(\omega \)-word \(\xi \in X^{\omega }\) with \(w\cdot u\sqsubset \xi \) and \({\mathbf {infix}(\xi )}\cap X^{|w\cdot u|}= {\mathbf {infix}(w\cdot u^{\omega })}\cap X^{|w\cdot u|}\) is uniquely specified.

Lemma 4

Let \(w\cdot u^{\omega }\in X^{\omega }\) where \(|w|\le |u|, |u|>0,\) and let \(m> |w|+|u|\) and \(n> |u|\). Then

$$\begin{aligned} K_{I}(w\cdot u^{\omega },r^{-m})= & {} \{w\cdot u^{\omega }\}, \text{ and } \end{aligned}$$
(11)
$$\begin{aligned} K_{\infty }(w\cdot u^{\omega },r^{-n})= & {} w'\cdot X^{*}\cdot u^{\omega } \text{ where } w'\sqsubset w\cdot u^{n} \text{ and } |w'|=n. \end{aligned}$$
(12)

Proof

Every \(\xi \in K_{I}(w\cdot u^{\omega },r^{-m})\) satisfies \(w\cdot u\sqsubset \xi \) and \({\mathbf {infix}(\xi )}\cap X^{m}= {\mathbf {infix}(w\cdot u^{\omega })}\cap X^{m}\), and the assertion of Eq. (11) follows from Lemma 3.

If \(\xi \in K_{\infty }(w\cdot u^{\omega },r^{-n})\) then there is a tail \(\xi '\) of \(\xi \) such that \(u\sqsubset \xi '\) and \({\mathsf {infix^\infty }(\xi )}\cap X^{n}={\mathbf {infix}(\xi ')}\cap X^{n}= {\mathbf {infix}(u^\omega )}\cap X^{n}\) whence, again by Lemma 3, \(\xi '=u^\omega \). \(\square \)

This allows us to state the following property concerning isolated pointsFootnote 6 in the spaces \((X^{\omega },\rho _{I})\) and \((X^{\omega },\rho _{\infty })\). The additional Item 3 in connection with Lemma 2.2 shows a further difference between both spaces.

Corollary 2

  1. 1.

    The set of isolated points of the space \((X^{\omega },\rho _{I})\) is \(\mathsf {Ult}\).

  2. 2.

    The space \((X^{\omega },\rho _{\infty })\) has no isolated points and all sets of the form \(X^{*}\cdot u^{\omega }\) are simultaneously closed and open.

  3. 3.

    In the space \((X^{\omega },\rho _{\infty })\) there are open sets which are not \(\mathbf {F}_{\sigma }\)-sets in Cantor topology.

Proof

Since every non-empty open subset of \((X^{\omega },\rho _{I})\) and also \((X^{\omega },\rho _{\infty })\) contains an ultimately periodic \(\omega \)-word, every isolated point has to be ultimately periodic. Now Eq. (11) shows that every \(w\cdot u^{\omega }\) is an isolated point in \((X^{\omega },\rho _{I})\), and Eq. (12) proves that \((X^{\omega },\rho _{\infty })\) has no isolated points. The remaining part of Item 2 follows from Eq. (12) and \(X^{*}\cdot u^{\omega }=\bigcup _{w\in X^{n}}w\cdot X^{*}\cdot u^{\omega }\).

Finally, it is known that \(X^{\omega }\setminus X^{*}\cdot u^{\omega }\) is not an \(\mathbf {F}_{\sigma }\)-set in Cantor topology (cf. Example 1).\(\square \)

4.3 Non-Preservation of Regular \(\omega \)-Languages

In this section we investigate whether similar to the Cantor topology the closure of a finite-state \(\omega \)-language is always regular in the spaces \((X^{\omega },\rho _{I})\) and \((X^{\omega },\rho _{\infty })\).

In contrast to the Cantor topology it is, however, not true that the closure of finite-state \(\omega \)-languages are regular. We can even show that in both spaces \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\) there are regular \(\omega \)-languages with non-regular closures.

Since we do not have a characterisation like the Property 1.5 for the closures \(\mathcal {C}_{I}\) and \(\mathcal {C}_{\infty }\) in the spaces \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\), respectivly, we circumvent this obstacle by presenting examples where the closure \(\mathcal {C}_{I}(F)\) or \(\mathcal {C}_{\infty }(F)\) of a regular \(\omega \)-language F is shown to be larger than F but does not contain more ultimately periodic \(\omega \)-words than F. In view of Theorem 1 this implies that the closures cannot be regular \(\omega \)-languages.

For the closure \(\mathcal {C}_{I}\) we use that, according to Example 1 the \(\omega \)-language \(\{0,1\}^*\cdot 0^{\omega }\) is no \(\mathbf {G}_{\delta }\)-set in the Cantor topology, thus in view of Lemma 2.2 not closed in \((X^{\omega }, \rho _I)\).

Example 3

We show that \(\mathcal {C}_{I}(\{0,1\}^{*}\cdot 0^{\omega })\cap \mathsf {Ult}= \{0,1\}^{*}\cdot 0^{\omega }\). Let \(w\cdot u^{\omega }\notin \{0,1\}^{*}\cdot 0^{\omega }\). Then \(u\notin \{0\}^{*}\) and \(0^{|w\cdot u|}\notin {\mathbf {infix}(w\cdot u^{\omega })}\). Now Eq. (9) yields \(K_{I}(w\cdot u^{\omega },r^{-|w\cdot u|})\cap X^{*}\cdot 0^{|w\cdot u|}\cdot X^{\omega }=\emptyset \). Thus \(\rho _{I}(w\cdot u^{\omega },v\cdot 0^{\omega })\ge r^{-|w\cdot u|}\) for all \(v\in X^{*}\) whence \(w\cdot u^{\omega }\notin \mathcal {C}_{I}(\{0,1\}^{*}\cdot 0^{\omega })\). The other inclusion being trivial.

Assume \(\mathcal {C}_I(\{0,1\}^{*}\cdot 0^{\omega })\) were a regular \(\omega \)-language. Then Theorem 1 implies \(\mathcal {C}_{I}(\{0,1\}^{*}\cdot 0^{\omega })= \{0,1\}^{*}\cdot 0^{\omega }\), that is, \(\{0,1\}^{*}\cdot 0^{\omega }\) is closed in \((X^{\omega }, \rho _I)\), a contradiction to Lemma 2.2 \(\square \)

Since \(\{0,1\}^{*}\cdot 0^{\omega }\) is closed in \((X^\omega ,\rho _\infty )\), we cannot use this \(\omega \)-language in that case.

Example 4

Let \(F:= \{0,1\}^{*}\cdot ((00)^{*}1)^{\omega }\). As explained above, it suffices to show that \(\mathcal {C}_{\infty }(F)\cap \mathsf {Ult}= F\cap \mathsf {Ult}\) and \(\mathcal {C}_{\infty }(F)\supset F\).

Let \(w\cdot u^{\omega }\in \mathcal {C}_{\infty }(F)\). Then there is a \(\xi \in F\) such that \(\rho _{\infty }(w\cdot u^{\omega },\xi )< r^{-|wu|}\). According to Lemma 4 we have \(\xi \in w\cdot X^{*}\cdot u^{\omega }\). Thus \(u^{\omega } = u'\cdot \eta \) where \(\eta \in ((00)^{*}1)^{\omega }\) whence \(w\cdot u^{\omega }= w\cdot u'\cdot \eta \in F\).

Finally, consider \(\zeta = \prod _{j=0}^{\infty }10^{j}=110100\cdots \). Since \(\zeta \) has infinitely many infixes \(10^{j}1\) where j is odd, \(\zeta \notin F\). Moreover, \({\mathsf {infix^\infty }(\zeta )}\cap X^{n}=\{0^{n}\}\cap \{0^{j}\cdot 1\cdot 0^{n-j-1}:0\le j< n\}\). Consider the \(\omega \)-words \(\xi _{i}:= \prod _{j=0}^{2i}10^{j}\cdot (1\cdot 0^{2i})^{\omega }\in F\). It holds \({\mathbf {pref}(\xi _{i})}\cap X^{n}={\mathbf {pref}(\zeta )}\cap X^{n}\) and \({\mathsf {infix^\infty }(\xi _{i})}\cap X^{n}={\mathsf {infix^\infty }(\zeta )}\cap X^{n}\) for \(n\le 2i+1\). This implies \(\rho _{\infty }(\xi _{i},\zeta )\le r^{-2i}\), that is, \(\lim _{i\rightarrow \infty }\xi _{i}=\zeta \in \mathcal {C}_{\infty }(F)\) in \((X^{\omega },\rho _{\infty })\).\(\square \)

5 Completeness and Compactness

Here we show that the spaces \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\) are neither complete nor compact.

To show that they are not complete we consider the sequence \((\xi _{i})_{i\in \mathrm {I\!N}}\) where \(\xi _{i}:= \prod _{j=i}^{\infty }0^{j}1\). This sequence converges in Cantor topology to the limit point \(0^{\omega }\). Since \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\) refine \((X^\omega ,\rho )\), the limit points, if they exist, should be the same. But \({\mathbf {infix}(\xi _{i})}\) and \({\mathsf {infix^\infty }(\xi _{i})}\) both contain the word 1 which is not in \({\mathbf {infix}(0^\omega )}={\mathsf {infix^\infty }(0^\omega )}\). Thus \(\rho _{I}(\xi _{i},0^\omega )=\rho _{\infty }(\xi _{i},0^\omega )=1\).

It remains to show that the sequence \((\xi _{i})_{i\in \mathrm {I\!N}}\) fulfils the Cauchy property. To this end we observe that for \(j\ge i\) we have \(0^{i}\sqsubset \xi _{j}\) and \({\mathbf {infix}(\xi _{j})}\cap X^{i}={\mathsf {infix^\infty }(\xi _{j})}\cap X^{i}=\{0^{i}\}\cup \{0^{m}10^{i-m-1}: 0\le m <i\}\). Thus \(\rho _{I}(\xi _{j},\xi _{k})\le r^{-i}\) and \(\rho _{\infty }(\xi _{j},\xi _{k})\le r^{-i}\) for \(j,k\ge i\).

In general it holds that no topology refining the Cantor topology is compact. A proof uses Corollary 3.1.14 in [5]. Here we provide the more illustrative and seemingly stronger examples of partitions of the whole space \(X^{\omega }\) into infinitely many open subsets.

Example 5

Let \(X=\{0,1\}\). Then the sets \(0^{i}1\cdot X^{\omega }\) for \(i\in \mathrm {I\!N}\) are open in the Cantor topology, hence open in \((X^\omega ,\rho _I)\) and according to Corollary 2.1 the set \(\{0^\omega \}\) is also open \((X^\omega ,\rho _I)\).

Then \(\bigl \{\{0^\omega \}\bigr \}\cup \bigl \{0^{i}1\cdot X^{\omega }:i\in \mathrm {I\!N}\bigr \}\) is a partition of \(X^{\omega }\) into sets open in \((X^\omega ,\rho _I)\).\(\square \)

Example 6

Let \(X=\{0,1\}\). Then the sets \(0^{i}1\cdot X^{\omega }\) for \(i\in \mathrm {I\!N}\) are open in the Cantor topology, hence open in \((X^\omega ,\rho _\infty )\) and according to Corollary 2.2 the set \(X^{*}\cdot 0^\omega \) is open and closed in \((X^\omega ,\rho _\infty )\).

Then \(\bigl \{X^{*}\cdot 0^\omega \bigr \}\cup \bigl \{0^{i}1\cdot X^{\omega }\setminus X^{*}\cdot 0^\omega :i\in \mathrm {I\!N}\bigr \}\) is a partition of \(X^{\omega }\) into sets open in \((X^\omega ,\rho _\infty )\).\(\square \)

6 Subword Complexity

In Sect. 4 we mentioned that regular \(\omega \)-languages are closely related to the (asymptotic) subword complexity of infinite words. Adapting the metrics \(\rho _{I}\) and \(\rho _{\infty }\) to subwords we may draw some connections to the level sets \(F^{(\tau )}_{\gamma }\) of the asymptotic subword complexity (see [17, 21]).

First we introduce the concept of asymptotic subword complexity.

Definition 2

(Asymptotic subword complexity). \(\tau (\xi ):= \lim \limits _{n\rightarrow \infty }\frac{\log _{|X|}|\mathbf {infix}(\xi )\cap X^{n}|}{n}\)

Using the inequality \(|{\mathbf {infix}(\xi )}\cap X^{n+m}|\le |{\mathbf {infix}(\xi )}\cap X^{n}|\cdot |{\mathbf {infix}(\xi )}\cap X^{m}|\) it is easy to see that the limit in Definition 2 exists and

$$\begin{aligned} \tau (\xi )= \inf \Bigl \{\frac{\log _{|X|}|\mathbf {infix}(\xi )\cap X^{n}|}{n}:n\in \mathrm {I\!N}\wedge n\ge 1 \Bigr \}\, . \end{aligned}$$
(13)

Equation (5.2) of [17] shows that in Definition 2 and Eq. (13) one can replace the term \({\mathbf {infix}(\xi )}\) by \({\mathsf {infix^\infty }(\xi )}\).

Let, for \(0< \gamma \le 1\), \(F^{(\tau )}_{\gamma }:= \{\xi : \xi \in X^{\omega }\wedge \tau (\xi )<\gamma \}\) be the lower level sets of the asymptotic subword complexity. For \(\gamma =0\) we set \(F^{(\tau )}_0:= \mathsf {Ult}\) (instead of \(F^{(\tau )}_0=\emptyset \)). We want to show that these sets are open in \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\). As a preparatory result we derive the subsequent Lemma 5.

Let \(E_{n}(\xi ):= \{\eta : {\mathbf {infix}(\eta )}\cap X^{n}\subseteq {\mathbf {infix}(\xi )}\}\) and \(E'_{n}(\xi ):= \{\eta : {\mathsf {infix^\infty }(\eta )}\cap X^{n}\subseteq {\mathsf {infix^\infty }(\xi )}\}\) be the sets of \(\omega \)-words having only infixes or infixes occurring infinitely often of length n of \(\xi \), respectively. These sets can be equivalently described as

$$\begin{aligned} \begin{array}{rcl} E_{n}(\xi )&{}=&{}X^{\omega }\setminus X^{*}\cdot (X^{n}\setminus {\mathbf {infix}(\xi )})\cdot X^{\omega } \ \text{ and }\\ E'_{n}(\xi )&{}=&{} X^{*}\cdot \bigl (X^{\omega }\setminus X^{*}\cdot (X^{n}\setminus {\mathsf {infix^\infty }(\xi )})\cdot X^{\omega }\bigr ), \text{ respectively } \end{array} \end{aligned}$$

which resembles in some sense the characterisation of open balls in Eqs. (9) and (10). In fact, it appears that the sets \(E_{n}(\xi )\) and \(E'_{n}(\xi )\) are open in the respective spaces \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\).

Lemma 5

Let \(\xi \in X^{\omega }\). Then \(\xi \in E_{n}(\xi )\cap E'_{n}(\xi )\), the set \(E_{n}(\xi )\) is open in \((X^\omega ,\rho _I)\) and the set \(E'_{n}(\xi )\) is open in \((X^\omega ,\rho _\infty )\).

Proof

The first assertion is obvious. For a proof of the second one we show that \(\eta \in E_{n}(\xi )\) implies that the ball \(K_{I}(\eta ,r^{-n})\) is contained in \(E_{n}(\xi )\).

Let \(\eta \in E_{n}(\xi )\) and \(\zeta \in K_{I}(\eta ,r^{-n})\). Then, \(\rho _{I}(\eta ,\zeta )< r^{-n}\), that is, in particular, \({\mathbf {infix}(\eta )}\cap X^{n}= {\mathbf {infix}(\zeta )}\cap X^{n}\), whence \(\zeta \in E_{n}(\xi )\).

The proof for \(E'_{n}(\xi )\) is similar.\(\square \)

This much preparation enables us to show that the level sets are open sets.

Theorem 3

Let \(0\le \gamma \le 1\). Then the sets \(F^{(\tau )}_{\gamma }\) are open in \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\).

Proof

For \(\gamma =0\) we have \(F^{(\tau )}_{\gamma }=\mathsf {Ult}\) which, according to Corollary 2, is open in \((X^\omega ,\rho _I)\) as well as in \((X^\omega ,\rho _\infty )\).

Let \(\gamma > 0\) and \(\tau (\xi )<\gamma \). We show that then \(E_{n}(\xi )\subseteq F^{(\tau )}_{\gamma }\) and \(E'_{n}(\xi )\subseteq F^{(\tau )}_{\gamma }\) for some \(n\in \mathrm {I\!N}\). Together with Lemma 5 this shows that \(F^{(\tau )}_{\gamma }\) contains, with every \(\xi \), open sets containing this \(\xi \).

If \(\tau (\xi )<\gamma \) then in view of Eq. (13) we have \(\frac{\log _{|X|}|\mathbf {infix}(\xi )\cap X^{n}|}{n}<\gamma \) for some \(n\in \mathrm {I\!N}\). Then for every \(\eta \in E_{n}(\xi )\) it holds \(\tau (\eta )\le \frac{\log _{|X|}|\mathbf {infix}(\xi )\cap X^{n}|}{n}<\gamma \) and, consequently, \(E_{n}(\xi )\subseteq F^{(\tau )}_{\gamma }\).

The proof for \((X^\omega ,\rho _\infty )\) is similar using \(\mathsf {infix}^{(\infty )}\) instead of \(\mathbf {infix}\) and the respective modification of Eq. (13) whose validity was mentioned above.\(\square \)

The proof shows also that \(\xi \in F^{(\tau )}_{\gamma }\) implies that \(X^{\omega }\setminus X^{*}\cdot (X^{n}\setminus {\mathbf {infix}(\xi )})\cdot X^{\omega }\subseteq F^{(\tau )}_{\gamma }\) for some \(n>0\). Thus \(F^{(\tau )}_{\gamma }\) is a countable union of regular \(\omega \)-languages closed in Cantor topology, hence an \(\mathbf {F}_{\sigma }\)-set in Cantor topology. The sets \(F^{(\tau )}_{\gamma }\) are finite-stateFootnote 7 non-regular \(\omega \)-languages because their complement \(X^{\omega }\setminus F^{(\tau )}_{\gamma }\) is non-empty and does not contain any ultimately periodic \(\omega \)-word. Thus, in view of Theorem 2, they are not \(\mathbf {G}_{\delta }\)-sets in Cantor-space and they are examples of sets open in \((X^\omega ,\rho _I)\) and \((X^\omega ,\rho _\infty )\) which are non-regular \(\mathbf {F}_{\sigma }\)-sets in Cantor-space.