1 Introduction

Exhibition of chaotic behavior is one of the important properties for dynamical systems. Phenomena such as strange attractor, period doubling, and period of recurrence have drawn a lot of attention. Frequently used for the investigation of chaotic systems, the study of the associated conjugate or seimconjugate symbolic systems has turned out to be more and more important in the past decades. Shifts of finite types (SFTs) on \({\mathbb {N}}^n\) (on \({\mathbb {Z}}^n\)) are spaces consisting of configurations (or colorings) which avoid a prescribed finite collection of patterns. While the investigation into the graph representations of one-dimensional SFTs uncovers crucial properties such as irreducibility, mixing, and the existence of periodic points, contrary results have been obtained when dealing with multi-dimensional cases. For instance, the emptiness problem is undecidable for two-dimensional SFTs; there is an aperiodic SFT which has positive topological entropy, and there is a nonempty SFT which exhibits nonextensible local patterns [6,7,8,9,10,11, 14, 17, 18].

The differences between one- and multi-dimensional SFTs might come from the structure of the underlying spaces; \({\mathbb {N}}\) (resp. \({\mathbb {Z}}\)) is a free group (resp. semigroup) with one generator while \({\mathbb {N}}^n\) (resp. \({\mathbb {Z}}^n\)), \(n \ge 2\), is an abelian group with n generators. Aubrun and Béal introduced shift spaces over free semigroups, called tree shifts [1, 2]. Tree SFTs (TSFTs) are more complicated than \({\mathbb {N}}\)-SFTs while still possess a natural one-dimensional structure of symbolic dynamical systems equipped with multiple shift maps. For instance, the emptiness problem is decidable, and the local pattern is extensible if the adjacency matrices are essential [3]. Besides the fundamental problems mentioned above, extensive investigations into topological properties are contributed by researchers. Analogous to the classical result that conjugacy problem is decidable for mixing \({\mathbb {N}}\)-SFTs, it is also decidable for CPC-irreducible TSFTs [1, 19]. Ban and Chang demonstrated that CPC-irreducible TSFTs are chaotic in the sense of Devaney; that is, such a TSFT is transitive and sensitive, and the CPC-periodic configurations are dense [4].

Since the irreducibility of \({\mathbb {N}}\)- and \({\mathbb {Z}}\)-SFTs is decidable and there is no algorithm for multi-dimensional cases (cf. [12, 13]), it is natural to consider whether CPC-irreducibility of SFTs over free semigroups and groups is decidable. Ban et al. [5] introduced extended directed graph representation for TSFTs (i.e., SFTs over free semigroup) and demonstrated the decidability of CPC-irreducible TSFTs. In the same work, they also iteratively deduced a hom-TSFT for any TSFT, and obtained the equivalence in irreducibility between the derived hom-TSFT and the original TSFT. Furthermore, the properties mentioned are especially important in the Markov hom-tree shifts [15, 16], in which the authors showed that the entropy of TSFT can be approximated by the growth rate of number of patterns with any given symbol if the adjacency matrix is irreducible, or equivalently, the TSFT is CPC-irreducible.

This paper aims at the decidability of CPC-irreducible SFTs over free groups. As the irreducibility of \({\mathbb {N}}\)- and \({\mathbb {Z}}\)-SFTs can be determined via the same argument, it is reasonable that the extended directed graph representations for TSFTs can be used to determine whether an SFT over free group is CPC-irreducible, only a minor modification needed probably. Nevertheless, as pointed out in the article, a novel methodology different from the discussion of TSFTs is required for the investigation of CPC-irreducibility of SFTs over free groups. After extending the decidability of CPC-irreducibility in TSFTs with two generators to ones with an arbitrary number of generators (Theorem 3.1), Proposition 3.4 addresses an alternative statement of the \(({\textsf{d}}, {\textsf{c}})\)-reduction, the crucial technique for the determination of CPC-irreducibility, that enriches the application. On the other hand, we provide an example to show that the decidability of CPC-irreducibility of SFTs over free groups cannot be seen as a problem in TSFTs (see Example 3.6). As the main contribution of this paper, Theorem 3.7 provides an transformation on the adjacency matrices of a 1-step SFT by which the CPC-irreducibility is preserved, and Theorem 3.8 addresses that the number of steps in the criterion only depends on the cardinality of the alphabet. The two theorems above together yield an upper bound of the complexity of the algorithm examining CPC-irreducibility of an SFT over a free group.

2 Notation and terminology

Let G be a finitely generated free semigroup with generating set \(\Sigma =\{s_1, s_2, \ldots , s_k \}\) in which the identity element is included. Herein, the generating set \(\Sigma \) is assumed to be symmetric, i.e., \(s \in \Sigma \Leftrightarrow s^{-1} \in \Sigma \), whenever G is a group unless otherwise specified. Each \(g \in G\) has a unique minimal representation (with respect to \(\Sigma \)) \(g=s_1 s_2 \ldots s_n\) such that \(s_i \in \Sigma \), and that every substring \(s_i s_{i+1} \ldots s_{j}\) of g is not equal to the identity \(\epsilon \). Denote by \(\left|g\right|=n\) the length of the word g. Define the set \(\Sigma ^n:=\{g \in G: \left|g\right| = n\}\). In particular, \(\Sigma ^0=\{\epsilon \}\) and \(\Sigma ^1=\Sigma \).

A subset \(P \subset G\) is called a prefix set if none of the word in P is a prefix of one another. A complete prefix code is a finite prefix set P such that if a word \(w \in G\) satisfies \(\left|w\right| \ge \max _{z \in P} \left|z\right|\), then there exists a prefix \(w'\) of w lying in P. In particular, \(\Sigma ^n\) is a complete prefix code for every \(n \in {\mathbb {N}}\). Define the set \(\Delta _n:= \cup _{n \le i \le 0} \Sigma ^i\). A set \(L \subseteq G\) is called prefix-closed if every prefix of L lies in L. The boundary \(\partial L\) of L is the set \(\{g \in L: g \Sigma \cap L^c \ne \emptyset \}\). In particular, \(\Delta _n\) is prefix-closed and \(\partial \Delta _n = \Sigma ^n\).

Let \({\mathcal {A}}\) be a finite labeling set. A configuration is a function \(x: G \rightarrow {\mathcal {A}}\). For each \(g \in G\), denote by \(x_g = x(g)\) the label attached to x at g. The shift transformation \(\sigma : G \times {\mathcal {A}}^G \rightarrow {\mathcal {A}}^G\) is defined as \(\sigma (w,x)_g=(\sigma _w x)_g=x_{w g}\) for all \(w, g \in G\). A block (or more specifically, an n-block) is a function \(u: \Delta _n \rightarrow {\mathcal {A}}\). A pattern is a function \(u: L \rightarrow {\mathcal {A}}\) for some finite prefix-closed set \(L \subset G\), and the support s(u) of u is the set L.

A G-shift \(X \subseteq {\mathcal {A}}^G\) is the set of all configurations that avoid a certain set of blocks \({\mathcal {F}}\), written as \(X={\textsf{X}}_{{\mathcal {F}}}\). A G-shift of finite type (G-SFT) is a G-shift \(X={\textsf{X}}_{{\mathcal {F}}}\) with \({\mathcal {F}}\) a finite set. For simplicity, we also refer to G-shift as tree-shift and to G-SFT as tree-SFT (TSFT) if G is a strict semigroup, i.e., G is a semigroup but not a group. A block u is said to be admissible in X if there exist \(x \in X\) and \(w \in G\) such that \((\sigma _w x)|_{s(u)} = u\); otherwise, it is forbidden. An admissible pattern is defined in the similar way. The set of all admissible n-blocks is denoted by \(B_n(X)\) and the set of all admissible blocks is denoted by B(X). Note that a G-SFT \(X = {\textsf{X}}_{\mathcal {F}}\) with \({\mathcal {F}} \subseteq {\mathcal {A}}^{\Delta _n}\) can also be defined by its admissible n-blocks, for which we call such shifts the n-step G-SFT. In the following passage, a pattern or a configuration u is seen as a subset of \(G \times {\mathcal {A}}\). That is, if \(g \in G\) and \(\alpha \in {\mathcal {A}}\). Then, \(u_g=\alpha \) if and only if \((g,\alpha )\in u\).

A tree-shift X is said to be irreducible on complete prefix code (CPC-irreducible) if for any admissible blocks uv, there exist an \(x \in X\) and a collection of complete prefix codes \(\left\{ P_g\right\} _{g \in \partial s(u)}\) such that \(x|_{s(u)}=u\) and \((\sigma _{g w} x)|_{s(v)}=v\) for each \(g \in \partial s(u), w \in P_g\). This definition could be understood as a version of topological transitivity for tree-shifts in the sense that a one-sided shift space \(X \subset {\mathcal {A}}^{{\mathbb {Z}}_+}\), i.e. a degenerate tree-shift with \(\Sigma =\{s_1\}\), is topologically transitive if and only if it is CPC-irreducible. More precisely, if any \(u \in B_n(X) \subset {\mathcal {A}}^{n+1}\) and \(v \in B_m(X) \subset {\mathcal {A}}^{m+1}\) altogether admit a configuration \(x \in X\) and an integer N such that \(x_{[0,n]}=u\) and \(x_{[n+N,n+N+m]}=v\), it can be rephrased in terms of CPC-irreducibility by noting that \(s(u)=[0,n]\), that \(s(v)=[0,m]\), that \(\partial s(u)=\{n\}\), and that \(P_n=\{N\}\). On the other hand, since CPC-irreducibility, like topological transitivity, is a conjugacy invariant for tree-shifts (which follows immediately from definition), the discussions regarding the property can be reduced to the class of 1-step TSFTs. In fact, for 1-step TSFTs over infinite binary trees, CPC-irreducibility is shown to be characterized by the associated extended directed graph in [5], which is naturally generalized to the following definition.

Definition 2.1

(extended directed graph) Let \(k \in {\mathbb {N}}\) be given. An extended directed graph is an ordered triplet \({\mathcal {G}}=(V, E_c, E_d)\) defined as follows:

  1. (1)

    V is called the vertex set. The divergent-edge set \(E_d\subseteq V^{k+1}\) consists of \((a, b_1, b_2, \ldots , b_k)\) with non-identical \(b_i \in {\mathcal {A}}\). Denote \({(a, b_1, b_2, \ldots , b_k) \in E_d}\) as \({a \rightarrow (b_1,b_2, \ldots , b_k)} \in E_d\).

  2. (2)

    The convergent-edge set \(E_c\subseteq V\times V\) consists of \({(a, b) \in E_c}\), which is also denoted as \({a \rightarrow (b, \ldots , b)} \in E_c\) for consistency.

The ordered pair of extended directed graph \({\mathcal {G}}\), \((V, E_c)\) is a directed graph, called the intrinsic graph of \({\mathcal {G}}\) and denoted by \({\mathcal {G}}^c\).

The definition above actually mimics the classical graph representation of a 1-step shift of finite type, and indeed induces a 1-step TSFT whose forbidden set consists of all 1-blocks \(a \rightarrow (b_1,b_2, \ldots , b_k) \in {\mathcal {A}}^{\Delta _1}\) which do not lie in \(E_c \cup E_d\). Nevertheless, such a graph representation may not be unique for a 1-step TSFT, and thus we in this article consider only its “simpplest” graph representation, which is defined as follows.

Definition 2.2

Let X be a 1-step TSFT with the set of admissible 1-blocks \(B \subseteq {\mathcal {A}}^{\Delta _1}\), and \({\mathcal {G}}=(V, E_c, E_d)\) be an extended directed graph. \({\mathcal {G}}\) is said to be an extended graph representation of X if \({\mathcal {G}}\) is defined in the following manner:

  1. (1)

    \(V={\mathcal {A}}\)

  2. (2)

    \(E_c = \{(a, b) \in {\mathcal {A}} \times {\mathcal {A}}: a \rightarrow (b, b, \ldots , b) \in B\}\)

  3. (3)

    \(E_d = \{(a, b_1, \ldots , b_k) \in {\mathcal {A}}^{k+1}: b_i \in {\mathcal {A}} \text { are not identical }, {a \rightarrow (b_1, \ldots , b_k)} \in B\}\)

Suppose X is a 1-step TSFT and \({\mathcal {G}}\) is the extended graph representation of X. The CPC-irreducibility of X is closely related to the connectivity of \({\mathcal {G}}\). More specifically, it is shown in Sect. 3 that the ultimate intrinsic graph derived through any of the following reduction processes is strongly connected if and only if X is CPC-irreducible.

Definition 2.3

(\(({\textsf{d}},{\textsf{c}})\)-reduction) Let \({\mathcal {G}}=(V,E_c,E_d)\) be an extended directed graph. Suppose \({\textsf{c}}:=(a,b_j) \notin E_c\) and \({\textsf{d}}:= a \rightarrow (b_1, b_2, \ldots , b_k) \in E_d\) such that for every \(b_i \ne b_j\) there exist a path in \({\mathcal {G}}^c\), \(b_i \beta _1 \beta _2 \ldots \beta _k b_j\). Denote \({\mathcal {H}}:=(V, E_c \cup \{{\textsf{c}}\}, E_d)\). Here, \({\mathcal {G}}\) is called \(({\textsf{d}},{\textsf{c}})\)-reducible, and \({\mathcal {H}}\) is called a \(({\textsf{d}},{\textsf{c}})\)-reduction of \({\mathcal {G}}\), denoted \({\mathcal {G}} \preceq {\mathcal {H}}\). If \({\mathcal {G}} \preceq {\mathcal {G}}_1 \preceq {\mathcal {G}}_2 \ldots \preceq {\mathcal {G}}_N\) and \({\mathcal {G}}_N\) is not \(({\textsf{d}},{\textsf{c}})\)-reducible, then \({\mathcal {G}}_N\) is called the full reduction of \({\mathcal {G}}\) and is denoted as \(\overline{{\mathcal {G}}}\).

The spirit behind the above reduction process is to simplify the extended directed graph of X while preserving the CPC-irreducibility at the same time. For this purpose, we can also adopt the following alternative reduction process, in which the full reduction coincides with its intrinsic graph if X is CPC-irreducible.

Definition 2.4

(enhanced \(({\textsf{d}},{\textsf{c}})\)-reduction) Let \({\mathcal {G}}=(V,E_c,E_d)\) be an extended directed graph. Suppose \({\textsf{c}}:=(a,b_j) \notin E_c\) and \({\textsf{d}}:= a \rightarrow (b_1, b_2, \ldots , b_k) \in E_d\) such that for every \(b_i \ne b_j\) there exists a path in \({\mathcal {G}}^c\), \(b_i \beta _1 \beta _2 \ldots \beta _k b_j\). Denote \({\mathcal {H}}:=(V, E_c \cup \{{\textsf{c}}\}, E_d {\setminus } \{{\textsf{d}}\})\). Then, \({\mathcal {G}}\) is called enhanced \(({\textsf{d}},{\textsf{c}})\)-reducible and \({\mathcal {H}}\) is called an enhanced \(({\textsf{d}},{\textsf{c}})\)-reduction of \({\mathcal {G}}\).

Besides the two reduction processes above, the grouping reduction in the following definition exploits the connected components in the intrinsic graph for the same task of determination of CPC-irreducibility. Even though it yields the same results as above, it is this process that exclusively provides an overview of the extended directed graph in terms of the connected components.

Definition 2.5

(grouping reduction) Let \({\mathcal {G}}=(V,E_c,E_d)\) be an extended directed graph, \(V=V_1 \cup V_2 \cup \ldots V_N\) such that \({{\mathcal {G}}^c}|_{V_i}\) is a strongly connected component and that \({\mathcal {G}}^c|_{\cup _{\ell =1}^{N_1} V_{i_\ell }}\) is not strongly connected for \(N_1 > 1\) and \(V_{i_\ell }\) all distinct. The grouping reduction of \({\mathcal {G}}\), \({\mathcal {H}}=({\widetilde{V}},\widetilde{E_c},\widetilde{E_d})\), is defined as follows:

  1. (1)

    \({\widetilde{V}}=\left\{ V_1,\ldots ,V_N\right\} \)

  2. (2)

    \(\widetilde{E_c}=\left\{ (V_i, V_j): \exists a \in V_i, b_{j_n} \in V_j, \alpha \rightarrow (b_{j_1}, b_{j_2}, \ldots , b_{j_k}) \in E_c \cup E_d\right\} \)

  3. (3)

    \(\widetilde{E_d}=\left\{ (V_i,\! V_{j_1}, \ldots ,\! V_{j_{k}}):\! \exists j_\ell \ne j_1, \!\exists a\! \in \! V_i, b_{j_n} \in V_{j_n}, \!a \rightarrow (b_{j_1}, \!\ldots , b_{j_k}) \!\in \!E_d\right\} \)

Fig. 1
figure 1

The illustration of the \(({\textsf{d}},{\textsf{c}})\)-reduction, enhanced \(({\textsf{d}},{\textsf{c}})\)-reduction, and grouping reduction of extended directed graph for \(k=2\)

Example 2.6

Definitions 2.32.4, and 2.5 are illustrated in Fig. 1. In the left column of the figure, the divergent edge \({\textsf{d}}\) colored in cyan and the convergent edge \({\textsf{c}}\) colored in red altogether induce the blue convergent edge (and the green vertex as well in the case of grouping reduction) in the corresponding figure in the right column.

3 Decidability of CPC-irreducibility

3.1 Decidability of CPC-irreducibility of 1-step TSFTs

The following passage is devoted to the demonstration of the equivalence of CPC-irreducibility and the strong connectedness of the intrinsic graph of a full reduction through the reduction processes. We first consider the \(({\textsf{d}},{\textsf{c}})\)-reduction and the enhanced \(({\textsf{d}},{\textsf{c}})\)-reduction. Let X be a 1-step TSFT with \(B=B_1(X) \subset {\mathcal {A}}^{\Delta _1}\) the set of admissible 1-blocks. Suppose \(u:=a \rightarrow (b_1, b_2, \ldots , b_k) \in B\) such that \(b_1, b_2, \ldots , b_k\) are not identical, and that there exist \(1 \le i \ne j \le k\), \(x\in X\) and a CPC P such that \(x_\epsilon = b_i\), \(x_g = b_j\) for all \(g \in P\). Let \(v:=a \rightarrow (b_1, b_2, \ldots ,b_{i-1},b_j,b_{i+1},\ldots , b_k)\), \(B':= (B {\setminus } \{u\}) \cup \{v\}\), \(B'':= B \cup \{v\}\), Y is induced by \(B'\), and Z is induced by \(B''\). This means, intuitively speaking, if there exists a pattern with \(b_i\) at its root and \(b_j\) on all its boundary, then we may add/replace by the shortcut \({b_i \rightarrow (b_j, \ldots , b_j)}\) while having CPC-irreducibility preserved. Indeed, the following theorem shows that the CPC-irreducibility is preserved under the \(({\textsf{d}},{\textsf{c}})\)-reduction or the enhanced \(({\textsf{d}},{\textsf{c}})\)-reduction.

Theorem 3.1

Let X be a 1-step TSFT induced by some admissible set \(B \subseteq {\mathcal {A}}^{\Delta _1}\), and Y and Z are derived through the enhanced \(({\textsf{d}},{\textsf{c}})\)-reduction and the \(({\textsf{d}},{\textsf{c}})\)-reduction, respectively, as above. Then, X is CPC-irreducible if and only if Y is CPC-irreducible. Similarly, X is CPC-irreducible if and only if Z is CPC-irreducible.

Proof

The proof is similar to [5, Theorem 4.4]. A sketch of the proof is given as follows for the compactness and self-containedness of this paper. To begin with, note that we may assume without loss of generality the pattern u does not appear in \(x|_{R}\) if we denote by R the minimal prefix-closed set containing P with \(\partial R=P\).

To prove the necessity, we show that given \(\alpha ,\beta \in {\mathcal {A}}\) there exist \(y \in Y\) and a complete prefix code \(P_Y\) such that \(y_\epsilon = \alpha \) and \(y_g=\beta \) for all \(g \in P_{Y}\). The proof of the existence of y is based on the existence of \(x \in X\) and a complete prefix code \(P_X\) such that \(x_\epsilon = \alpha \) and \(x_g=\beta \) for all \(g \in P_{X}\), which follows immediately from the the fact X is irreducible. The desired y is derived by recursively replacing every appearance of u in x by v. More specifically, if the yellow block in Fig. 2  denotes u in which the blue node denotes \(b_j\) and green node denotes \(b_i\), then by replacing all the nodes below the green node by the green blocks, u is replaced by v, the pink block, and is an admissible pattern by Y. The proof for Z is similar.

We now prove the sufficiency by showing that given \(\alpha ,\beta \in {\mathcal {A}}\) there exist \(z \in X\) and a complete prefix code \(P_X\) such that \(z_\epsilon = \alpha \) and \(z_g=\beta \) for all \(g \in P_{X}\), for which an illustration is provided in Fig. 3. Following the existence of a \(y \in Y\) and a complete prefix code \(P_Y\) such that \(y_\epsilon = \alpha \) and \(y_g=\beta \) for all \(g \in P_{Y}\), and z is obtained by recursively replacing every appearance of u (pink block) in z by v (yellow block) followed by \(x|_{R}\) (cyan block). This finishes the proof.

Fig. 2
figure 2

Illustration of the proof of the necessity of Theorem 3.1

Fig. 3
figure 3

Illustration of the proof of the sufficiency of Theorem 3.1

\(\square \)

The following lemma, which unveils an “extended” meaning of \(({\textsf{d}}, {\textsf{c}})\)-reduction, addresses that the reduction applies to irreducible components of the corresponding graph. The proof is obtained routinely via analogous discussion of [5, Lemma 6.3], thus it is omitted.

Lemma 3.2

Let X be a CPC-irreducible TSFT induced by some admissible set \(B \subseteq {\mathcal {A}}^{\Delta _1}\). Suppose \({\mathcal {G}}\) is the extended directed graph representation of X. Let \(V = V_1 \cup V_2 \cup \ldots \cup V_N\) with \(N \ge 2\), upon which strongly connected component decomposition is defined, then,

  1. (1)

    for each \(V_i\), there exist \(b_1, \ldots , b_k \in V_i\), \(a \in V_j\) (\(i \ne j\)) such that \(a \rightarrow (b_1,\ldots ,b_k) \in E_c \cup E_d\). Denote \(V_j \xrightarrow [(b_1,\ldots ,b_k)]{a} V_i\).

  2. (2)

    there exist distinct \(V_{i_1}, \ldots , V_{i_M}\), where \(1 \le i_1 \le \cdots \le i_M \le N\), and \(a_{i_{j}}, b_{i_{j},k} \in V_{i_{j}}\) such that

    $$\begin{aligned} V_{i_1} \xrightarrow [(b_{i_{M},1},\ldots ,b_{i_{M},n})]{a_{i_{1}}} V_{i_M} \xrightarrow [(b_{i_{M-1},1},\ldots ,b_{i_{M-1},n})]{a_{i_{M}}}\ldots \xrightarrow [(b_{i_2,1},\ldots , b_{i_2,1})]{a_{i_3}} V_{i_2} \xrightarrow [(b_{i_1,1},\ldots ,b_{i_1,1})]{a_{i_2}} V_{i_1} \end{aligned}$$

    Note that there exists at least one divergent edge among the edges given above.

The following theorem comes immediately from Theorem 3.1 and Lemma 3.2.

Theorem 3.3

Let X be a 1-step TSFT and \({\mathcal {G}}\) its extended directed graph representation. Then, X is CPC-irreducible if and only if the grouping reduction of \({\mathcal {G}}\) is strongly connected.

The sketch of the proof, by utilizing the \(({\textsf{d}},{\textsf{c}})\)-reduction, is described as in the following steps and illustrated in Fig. 4:

  1. (1)

    For every G-SFT, X, an extended directed graph \({\mathcal {G}}\) can be defined, which is provided in Fig. 4 Step 1. Denote \(X_0=X\).

  2. (2)

    The intrinsic graph of the extended directed graph defined above can be decomposed into strongly connected components by Lemma 3.2, which are indicated by circles in Fig. 4 Step 2.

  3. (3)

    By applying Theorem 3.1 and Lemma 3.2, any CPC-irreducible \(X_i\), either \({\mathcal {G}}_i\) has strongly connected intrinsic graph \({\mathcal {G}}_i^c\), or \({\mathcal {G}}_i\) is \(({\textsf{d}},{\textsf{c}})\)-reducible (or enhanced \(({\textsf{d}},{\textsf{c}})\)-reducible) with the \(({\textsf{d}},{\textsf{c}})\)-reduction \({\mathcal {G}}_{i+1}\) inducing a CPC-irreducible 1-step TSFT \(X_{i+1}\). In Fig. 1, the divergent edge colored in cyan has both its destination in the same component and thus a convergent edge colored in blue is induced.

  4. (4)

    As a result, if \({\mathcal {G}}_i\) is not (dc)-reducible (or enhanced \(({\textsf{d}},{\textsf{c}})\)-reducible), then \({\mathcal {G}}_i^c\) is strongly connected if and only if \(X_i\) is CPC-irreducible. By Theorem 3.1, this is also equivalent to the CPC-irreducibility of X.

Fig. 4
figure 4

Outline of the proof of Theorem 3.3

Based on Lemma 3.2, we consider the following alternative reduction process to the ones mentioned in Sect. 2, which relaxes the requirement in the \(({\textsf{d}},{\textsf{c}})\)-reduction.

Proposition 3.4

Suppose X is a TSFT induced by admissible 1-blocks B, and \(a \rightarrow (b_1, b_2, \ldots b_{i-1}, b_i,b_{i+1} \ldots , b_k), b_i \rightarrow (c, \ldots , c) \in B\). Let Y be the TSFT induced by admissible set \(B \cup \{a \rightarrow (b_1, \ldots b_{i-1}, c,b_{i+1},\ldots , b_k)\}\). Then, X is CPC-irreducible if and only if Y is CPC-irreducible.

Proof

The necessity is clear. The sufficiency can be proved using the same techniques as in Theorem 3.1 and as Fig. 3. Suppose the cyan 1-block in the figure corresponds to \(b_i \rightarrow (c, \ldots , c)\), and \(a \rightarrow (b_1, b_2, \ldots b_{i-1}, b_i,b_{i+1} \ldots , b_k)\) corresponds to the yellow block. Under the assumption of CPC-irreducibility, for every \(d \in {\mathcal {A}}\), there exist an \(x \in X\) and a complete prefix code P such that \(x_{\epsilon }=c\) and \(x_g=d\) for each \(g \in P\). Thus, given any pattern in Y, we can replace every appearance of pink block by the yellow block so that the pattern after replacement is a pattern in X and the CPC-irreducibility is maintained during the process. \(\square \)

It is not hard to verify that the above reduction process is capable of determining the CPC-irreducibility of X. To be more precise, X is CPC-irreducible if and only if the intrinsic graph of the full reduction of the corresponding graph representation \({\mathcal {G}}\) is strongly connected, and an example is given as follows.

Example 3.5

Suppose X is a 1-step TSFT with the extended directed graph \({\mathcal {G}}=(V,E_c,E_d)\) defined as follows:

$$\begin{aligned} V&=\{1,2,3,4\}, \\ E_c&= \{2 \rightarrow (4, 4),4 \rightarrow (3, 3),3 \rightarrow (2, 2)\}, \\ E_d&= \{1 \rightarrow (2, 3)\}. \end{aligned}$$

Then, with respect to the path 243 consisting of convergent edges, the \(({\textsf{d}},{\textsf{c}})\)-reduction \({\mathcal {G}}'=(V',E'_c,E'_d)\) of \({\mathcal {G}}\) is defined as

$$\begin{aligned} V'&=\{1,2,3,4\}, \\ E'_c&= \{2 \rightarrow (4, 4),4 \rightarrow (3, 3),3 \rightarrow (2, 2), 1 \rightarrow (3, 3)\}, \\ E'_d&= \{1 \rightarrow (2, 3)\}, \end{aligned}$$

and the enhanced \(({\textsf{d}},{\textsf{c}})\)-reduction \({\mathcal {G}}''=(V'',E''_c,E''_d)\) of \({\mathcal {G}}\) is defined as

$$\begin{aligned} V''&=\{1,2,3,4\}, \\ E''_c&= \{2 \rightarrow (4, 4),4 \rightarrow (3, 3),3 \rightarrow (2, 2), 1 \rightarrow (3, 3)\}, \\ E''_d&= \emptyset . \end{aligned}$$

On the other hand, with respect to the convergent edges \((2,4) \in E_c\) and \((4,3) \in E_c\), the reduced graph representation \({\mathcal {G}}'''=(V''',E'''_c,E'''_d)\) following Proposition 3.4 is given as

$$\begin{aligned} V'''&=\{1,2,3,4\}, \\ E'''_c&= \{2 \rightarrow (4, 4),4 \rightarrow (3, 3),3 \rightarrow (2, 2), 1 \rightarrow (3, 3)\}, \\ E'''_d&= \{1 \rightarrow (2, 3),1 \rightarrow (4, 3)\}. \end{aligned}$$

It is seen from the reduced graph representations above that X is not CPC-irreducible.

3.2 Decidability of CPC-irreducibility of 1-step G-SFTs

Suppose G is a free group of k generators. Then, G has the Cayley graph as shown in Fig. 5. Graphically, this Cayley graph is almost the same as that of the free semigroup described above, except the degree of the identity element is the same as that of any of the rest element in G. Therefore, the generalization of CPC-irreducibility to G-shifts is natural. A 1-step G-SFT X is said to be irreducible on complete prefix code (CPC-irreducible) if for any two symbols \(a,b \in {\mathcal {A}}\), there exist an \(x \in X\) and a complete prefix code P such that \(x_{\epsilon }=a\) and \(x_g=b\) for each \(g \in P\). Suppose u is a pattern with \(\partial s(u)=P\), then u is said to connect a and b in the CPC sense. Even though the discussions of the above definition can be generalized to G with an arbitrary number k of generators, in this paper we focus on the case \(k=2\) for simplicity.

Despite the fact the definition of CPC-irreducibility seems natural and the structure of the free group and the free semigroup are similar, they exhibit very different behavior on the CPC-irreducibility. In fact, the reason why we restrict the definition to the case of 0-blocks (namely, symbols) is that if we replace ab in the definition by the patterns uv and P by \(\{P_g\}_{g \in s(u)}\) as that for TSFTs, then hardly is any G-SFT X irreducible in this sense due to the possible overlaps of ghs(v) and \(g h' s(v)\) for \(h, h' \in P_g\), even in some very naive cases such as the higher block representations of full shifts. Hence, it is not even a topological invariant.

Fig. 5
figure 5

Cayley graph for free group with 2 generators \(\{s_1,s_2\}\)

The following example exhibits the decidability of CPC-irreducibility of SFTs over free groups cannot be seen as a problem in TSFT. In other words, the theorems derived for 1-step TSFTs are not applicable to 1-step G-SFTs.

Example 3.6

Let G be a free group with two generators, and X be a 1-step G-SFT defined by the following adjacency matrices:

$$\begin{aligned} A_1=\begin{bmatrix} 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 \\ 1 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 1 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 1 \\ 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 \\ \end{bmatrix},\qquad A_2=\begin{bmatrix} 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 1 \\ 1 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 1 \\ 1 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 \end{bmatrix}. \end{aligned}$$

That is, \(x \in X\) if and only if for all \(g \in G\),

$$\begin{aligned} (A_1)_{x_{g}, x_{g s_1}} = (A_1)_{x_{g s_1^{-1}}, x_{g}} = (A_2)_{x_{g}, x_{g s_2}} = (A_2)_{x_{g s_2^{-1}}, x_{g}}. \end{aligned}$$

Even though one may also define an extended directed graph for X with its edge set consisting of \(B_1(X)\), the \(({\textsf{d}},{\textsf{c}})\)-reduction process no longer preserves CPC-irreducibility as in TSFTs. Indeed, X is CPC-irreducible since the patterns of the form in Fig. 6 is admissible for every letter i.

Fig. 6
figure 6

Admissible pattern in X of Example 3.6

Nevertheless, neither the intrinsic graph is strongly connected, nor the extended directed graph itself is \(({\textsf{d}},{\textsf{c}})\)-reducible. In particular, the set of convergent edges is empty in this case.

Despite the ineffectiveness of the extended directed graph, the CPC-irreducibility is decidable in general, which is proved in the following theorems.

Theorem 3.7

Suppose X is a 1-step G-SFT (resp. TSFT) induced by \(A_1, A_2\) and Y is a 1-step G-SFT (resp. TSFT) induced by \(B_1, B_2\) with

$$\begin{aligned} (B_\ell )_{i,j} = {\left\{ \begin{array}{ll} 1 &{} \quad \text {if } i = j\\ (A_{\ell })_{i,j} &{} \quad \text {if } i \ne j \end{array}\right. } \end{aligned}$$

for \(\ell =1,2\). Then, X is CPC-irreducible if and only if Y is CPC-irreducible.

Proof

We prove the case of 1-step G-SFTs, and the case of 1-step TSFTs is similar.

The necessity is clear. The converse holds from the following iterative replacement argument. Suppose \(v_0=v\) is a pattern in Y such that v connects a and b in the CPC sense, i.e., \(\partial s(u)\) is a CPC, \(v_\epsilon = a\) and \(v_w = b\) for all \(w \in s(u)\). Consider the set \(S(v_0):=\{w \in s(u): \exists z \in \Sigma , c \in {\mathcal {A}}, (v_0)_w=(v_0)_{w z}=i, (A_{\ell })_{i,i}=0, (B_{\ell })_{i,i}=1 \text { for some } \ell \}\). Pick any \(w_0 \in S(v_0)\), \(z_0 \in \Sigma \) satisfy the requirement of \(S(v_0)\) and define the pattern \(v_1\) as

$$\begin{aligned} (v_1)_w:={\left\{ \begin{array}{ll} (v_0)_w, &{} \quad \text {if } w_0 \text { is not a prefix of } w; \\ (v_0)_{w_0 z}, &{} \quad \text {if } w=w_0 z_0 z. \end{array}\right. } \end{aligned}$$

It is clear that \(v_1\) is a pattern in Y that connects a and b in the CPC sense. Also, \(\left|S(v_1)\right| = \left|S(v_0)\right| - 1\). Hence, by repeating the process for \(\left|S(v_0)\right|\) times, we derive a pattern \(v_{\left|S(v_0)\right|}\) in Y that connects a and b in the CPC sense with \(\left|S(v_{\left|S(v_0)\right|})\right| = 0\). It proves that \(v_{\left|S(v_0)\right|}\) is also a pattern in X. \(\square \)

In fact, we prove can prove a bit more in the following theorem.

Theorem 3.8

Suppose X is a 1-step G-SFT induced by \(A_1, A_2\), \(a \in {\mathcal {A}}\), and \({\mathcal {B}}_1,{\mathcal {B}}_1 \subset {\mathcal {A}}\). Then, if there exists a pattern v with s(v) a such that \(v_\epsilon \in {\mathcal {B}}_1\) and \(v_g \in {\mathcal {B}}_2\) for all \(g \in \partial s(v)\), then there exists a pattern u with s(u) a CPC such that \(u_\epsilon \in {\mathcal {B}}_1\) and \(u_g \in {\mathcal {B}}_2\) for all \(g \in \partial s(u)\) that such that \(\max _{w \in s(u)} \left|w\right| \le 2\left|{\mathcal {A}}\right|\).

Proof

Suppose \(w=w_0 w_1 w_2 \ldots w_n \in G\) with \(w_0 = \epsilon \). Denote \(w^{[i]} = w_0 w_1 \ldots w_i\) in the rest of the proof. Let \({\mathcal {B}}_1,{\mathcal {B}}_1 \subseteq {\mathcal {A}}\) be as stated. We then derive a (probably not unique) desired u from v by an iterative replacement.

Let \(u_0=v\). Now if \(\max _{w \in s(u_i)} \left|w\right| \le 2\left|{\mathcal {A}}\right|\), then the theorem is automatic. Otherwise, we may pick \(w \in \partial s(u_i)\) such that \(\left|w\right|=\max _{w' \in s(u_i)} \left|w'\right|\) and that there exist some distinct \(0 < n_1, n_2, n_3 \le \left|w\right|\) such that \(u_{w^{[n_1]}} = u_{w^{[n_2]}} = u_{w^{[n_3]}}\), as is given in the following graph.

figure a

Under the circumstances, we define an admissible pattern \(u_{i+1}\) with its support a CPC such that \(\left|s(u_{i+1})\right| < \left|s(u_{i})\right|\) such that \((u_{i+1})_\epsilon \in {\mathcal {B}}_1\) and that \((u_{i+1})_g \in {\mathcal {B}}_2\) for all \(g \in \partial s(u_{i+1})\). To this end, we consider the following two cases:

1. If any two of \(w_{n_1}, w_{n_2}, w_{n_3}\) are equal, say \(w_{n_1} = w_{n_2}\) holds, then so do \(w_{n_1+1} = w_{n_2+1}\), \(w_{n_1+1}' = w_{n_2+1}'\) and \(w_{n_1+1}'' = w_{n_2+1}''\). Define the pattern \(u_{i+1}\) as

$$\begin{aligned} (u_{i+1})_z:={\left\{ \begin{array}{ll} (u_{i})_z &{} \quad \text {if } w^{[n_1]} \text { is not a prefix of } z \\ (u_{i})_{w z''} &{} \quad \text {if } z=w^{[n_1]} z'' \text { and } w^{[n_2]} z'' \in s(u_i) \end{array}\right. } \end{aligned}$$

From the definition it is clear that \(\left|s(u_{i+1})\right| < \left|s(u_i)\right|\) is a CPC.

2. If \(w_{n_1}, w_{n_2}, w_{n_3}\) are all distinct, then

$$\begin{aligned} \{w_{n_2+1}, w_{n_2+1}', w_{n_2+1}'', w_{n_3+1}, w_{n_3+1}', w_{n_3+1}''\} = \Sigma . \end{aligned}$$

Hence, without loss of generality, we may assume \(w_{n_1+1} = w_{n_2+1}'\). Define the pattern \(u_{i+1}\) as

$$\begin{aligned} (u_{i+1})_z:={\left\{ \begin{array}{ll} (u_{i})_z &{} \quad \text {if } w^{[n_1+1]} \text { is not a prefix of } z \\ (u_{i})_{w z''} &{} \quad \text {if } z=w^{[n_1+1]} z'' \text { and } w^{[n_2]} w_{n_2}' z'' \in s(u_i) \end{array}\right. } \end{aligned}$$

From the definition it is clear that \(\left|s(u_{i+1})\right| < \left|s(u_i)\right|\) is a CPC.

The above process can be proceeded unless no such \(w \in G\) exists. In particular, this process terminates after a finite time, say N, since \(s(u_0)\) is a finite set. By definition, \(u_N\) is a pattern with its support a CPC such that \(u_\epsilon =a\) and that \(u_g \in {\mathcal {B}}\) for all \(g \in \partial s(u_N)\). On the other hand, we observe that for each \(w \in \partial s(u_N)\) with \(\left|w\right|=n\), every symbol appears in \(u|_{\{w^{[k]}\}_{n \ge k \ge 0}}\) at most twice, probably except \((u_N)_\epsilon = a\) for at most three times. Therefore, \(\max _{w \in s(u_N)} \left|w\right| \le 2\left|{\mathcal {A}}\right|\). The proof is completed by letting \(u = u_N\). \(\square \)

In particular, Theorem 3.8 gives an upper bound for size of the pattern required in the definition of CPC-irreducibility if we take \({\mathcal {B}}_1:=\{a\}\) and \({\mathcal {B}}:=\{b\}\). Moreover, for CPC-irreducibility on N-step G-SFT X, one can consider its N-block representation \(Y \subset B_{N}(X)^{G}\) so that Y is a 1-step G-SFT induced by some matrices \(A_1\) and \(A_2\). We apply the theorem again to give a similar upper bound, and hence such CPC-irreducibility is decidable in general, even though it is not a topological invariant. To be more precise in this setting, X is CPC-irreducible if and only if for any \(a, b \in {\mathcal {A}}\), there exists a pattern u in Y with s(u) a CPC such that \(u_{\epsilon } \in {\mathcal {B}}_1\), that \(u_{g} \in {\mathcal {B}}_2\), and that \(\max _{w \in s(u)} \left|w\right| \le \left|B_{N}(X)\right|\), where \({\mathcal {B}}_1:=\{v \in B_N(X): v_\epsilon =a\}\) and \({\mathcal {B}}_1:=\{v \in B_N(X): v_\epsilon =b\}\). For the demonstration of Theorem 3.8, we provide an example defined as follows.

Example 3.9

Let X be an SFT induced by matrices

$$\begin{aligned} A_1=\begin{bmatrix}0 &{}\quad 1 &{}\quad 0\\ 0 &{}\quad 0 &{}\quad 1\\ 1 &{}\quad 0 &{}\quad 0\end{bmatrix} \text { and } A_2=\begin{bmatrix}0 &{}\quad 1 &{}\quad 0\\ 1 &{}\quad 0 &{}\quad 1\\ 0 &{}\quad 1 &{}\quad 0\end{bmatrix}, \end{aligned}$$

for which all admissible 1-blocks are provided in Fig. 7. Under this definition, X is not a CPC-irreducible SFT. In particular, b and c are not connected in the CPC sense since the recurrence of the pattern \(a \xrightarrow {s_1^{-1}} b\) asserts the CPC connectivity is impossible due to the argument in Theorem  3.8 (see Fig. 8). Note that the maximal length of the pattern provided in this figure is \(3 \le 2 \left|{\mathcal {A}}\right| = 6\) and is consistent with Theorem 3.8.

Fig. 7
figure 7

Rules of the SFT induced by \(A_1\), \(A_2\)

Fig. 8
figure 8

Occurrence of repeated patterns during the search of CPC connectivity

Remark 3.10

By Theorems 3.7 and 3.8, the brute force algorithm for checking whether \(i,i+1\) can be connected in the CPC sense needs at most \(\left|{\mathcal {A}}\right|^{{2^{2 \left|{\mathcal {A}}\right|+1}-1}}\) steps. Therefore, the complexity of the brute force algorithm for checking CPC irreducibility is bounded by \(\left|{\mathcal {A}}\right| \cdot \left|{\mathcal {A}}\right|^{{2^{2 \left|{\mathcal {A}}\right|+1}-1}} = \left|{\mathcal {A}}\right|^{{2^{2 \left|{\mathcal {A}}\right|+1}}}\).

4 Discussion and conclusion

This paper generalizes the extended graph to tree-SFTs with arbitrary number of generators. In addition, the paper also provides a brief investigation into the decidability of CPC-irreducibility on 1-step G-SFTs induced by adjacency matrices, where G is a free group. However, this problem is far from being solved, and the core problem listed as follows is left open.

  • Is there an interpretation of CPC-irreducibility for G-SFTs in terms of the graph representation?