# Subshift of finite type

In mathematics, subshifts of finite type are used to model dynamical systems, and in particular are the objects of study in symbolic dynamics and ergodic theory. They also describe the set of all possible sequences executed by a finite-state machine. The most widely studied shift spaces are the subshifts of finite type.

## Motivating examples

A (one-sided) shift of finite type is the set of all sequences, infinite on one end only, that can be made up of the letters $A,B,C$, like $AAA\cdots ,ABAB\cdots ,\dots$. A (two-sided) shift of finite type is similar, but consists of sequences that are infinite on both ends.
A subshift can be defined by a directed graph on these letters, such as the graph $A\to B\to C\to A$. It consists of sequences whose transitions between consecutive letters are only those allowed by the graph. For this example, the subshift consists of only three one-sided sequences: $ABCABC\cdots ,BCABCA\cdots ,CABCAB\cdots$. Similarly, the two-sided subshift described by this graph consists of only three two-sided sequences.
Other directed graphs on the same letters produce other subshifts. For example, adding another arrow $A\to C$ to the graph produces a subshift that, instead of containing three sequences, contains an uncountably infinite number of sequences.

### Markov and non-Markov measures

Given a Markov transition matrix and an invariant distribution on the states, we can impose a probability measure on the set of subshifts. For example, consider the Markov chain given on the left on the states $A,B_{1},B_{2}$, with invariant distribution $\pi =(2/7,4/7,1/7)$. If we "forget" the distinction between $B_{1},B_{2}$, we project this space of subshifts on $A,B_{1},B_{2}$ into another space of subshifts on $A,B$, and this projection also projects the probability measure down to a probability measure on the subshifts on $A,B$.
The curious thing is that the probability measure on the subshifts on $A,B$ is not created by a Markov chain on $A,B$, not even multiple orders. Intuitively, this is because if one observes a long sequence of $B^{n}$, then one would become increasingly sure that the $Pr(A|B^{n})\to {\frac {2}{3}}$, meaning that the observable part of the system can be affected by something infinitely in the past.
Conversely, there exists a space of subshifts on 6 symbols, projected to subshifts on 2 symbols, such that any Markov measure on the smaller subshift has a preimage measure that is not Markov of any order (Example 2.6).

## Definition

Let V be a finite set of n symbols (alphabet). Let X denote the set ⁠$V^{\mathbb {Z} }$⁠ of all bi-infinite sequences of elements of V together with the shift operator T. We endow V with the discrete topology and X with the product topology. A symbolic flow or subshift is a closed T-invariant subset Y of X and the associated language L$_Y$ is the set of finite subsequences of Y.
Now let A be an n × n adjacency matrix with entries in {0, 1}. Using these elements we construct a directed graph G = (V, E) with V the set of vertices and E the set of edges containing the directed edge x → y in E if and only if A$_{x,y}$ = 1. Let Y be the set of all infinite admissible sequences of edges, where by admissible it is meant that the sequence is a walk of the graph, and the sequence can be either one-sided or two-sided infinite. Let T be the left shift operator on such sequences; it plays the role of the time-evolution operator of the dynamical system. A subshift of finite type is then defined as a pair (Y, T) obtained in this way. If the sequence extends to infinity in only one direction, it is called a one-sided subshift of finite type, and if it is bilateral, it is called a two-sided subshift of finite type.
Formally, one may define the sequences of edges as
    $\Sigma _{A}^{+}=\left\{(x_{0},x_{1},\ldots ):x_{j}\in V,A_{x_{j}x_{j+1}}=1,j\in \mathbb {N} \right\}.$
This is the space of all sequences of symbols such that the symbol p can be followed by the symbol q only if the (p, q)-th entry of the matrix A is 1. The space of all bi-infinite sequences is defined analogously:
    $\Sigma _{A}=\left\{(\ldots ,x_{-1},x_{0},x_{1},\ldots ):x_{j}\in V,A_{x_{j}x_{j+1}}=1,j\in \mathbb {Z} \right\}.$
The shift operator T maps a sequence in the one- or two-sided shift to another by shifting all symbols to the left, i.e.
    $\displaystyle (T(x))_{j}=x_{j+1}.$
Clearly this map is only invertible in the case of the two-sided shift.
A subshift of finite type is called transitive if G is strongly connected: there is a sequence of edges from any one vertex to any other vertex. It is precisely transitive subshifts of finite type which correspond to dynamical systems with orbits that are dense.
An important special case is the full n-shift: it has a graph with an edge that connects every vertex to every other vertex; that is, all of the entries of the adjacency matrix are 1. The full n-shift corresponds to the Bernoulli scheme without the measure.

## Terminology

By convention, the term shift is understood to refer to the full n-shift. A subshift is then any subspace of the full shift that is shift-invariant (that is, a subspace that is invariant under the action of the shift operator), non-empty, and closed for the product topology defined below. Some subshifts can be characterized by a transition matrix, as above; such subshifts are then called subshifts of finite type. Often, subshifts of finite type are called simply shifts of finite type. Subshifts of finite type are also sometimes called topological Markov shifts.

## Examples

Many chaotic dynamical systems are isomorphic to subshifts of finite type; examples include systems with transverse homoclinic connections, diffeomorphisms of closed manifolds with a positive metric entropy, the Prouhet–Thue–Morse system, the Chacon system (this is the first system shown to be weakly mixing but not strongly mixing), Sturmian systems and Toeplitz systems.

## Generalizations

A sofic system is an image of a subshift of finite type where different edges of the transition graph may be mapped to the same symbol. For example, if one only watches the output from a hidden Markov chain, then the output appears to be a sofic system. It may be regarded as the set of labellings of paths through an automaton: a subshift of finite type then corresponds to an automaton which is deterministic. Such systems correspond to regular languages.
Context-free systems are defined analogously, and are generated by phrase structure grammars.
A renewal system is defined to be the set of all infinite concatenations of some fixed finite collection of finite words.
Subshifts of finite type are identical to free (non-interacting) one-dimensional Potts models (n-letter generalizations of Ising models), with certain nearest-neighbor configurations excluded. Interacting Ising models are defined as subshifts together with a continuous function of the configuration space (continuous with respect to the product topology, defined below); the partition function and Hamiltonian are explicitly expressible in terms of this function.
Subshifts may be quantized in a certain way, leading to the idea of the quantum finite automata.

## Topology

A subshift has a natural topology, derived from the product topology on ⁠$V^{\mathbb {Z} },$⁠ where
    $V^{\mathbb {Z} }=\prod _{n\in \mathbb {Z} }V=\{x=(\ldots ,x_{-1},x_{0},x_{1},\ldots ):x_{k}\in V\;\forall k\in \mathbb {Z} \}$
and V is given the discrete topology. A basis for the topology of ⁠$V^{\mathbb {Z} },$⁠ which induces the topology of the subshift, is the family of cylinder sets
    $C_{t}[a_{0},\ldots ,a_{s}]=\{x\in V^{\mathbb {Z} }:x_{t}=a_{0},\ldots ,x_{t+s}=a_{s}\}$
The cylinder sets are clopen sets in ⁠$V^{\mathbb {Z} }.$⁠ Every open set in ⁠$V^{\mathbb {Z} }$⁠ is a countable union of cylinder sets. Every open set in the subshift is the intersection of an open set of ⁠$V^{\mathbb {Z} }$⁠ with the subshift. With respect to this topology, the shift T is a homeomorphism; that is, with respect to this topology, it is continuous with continuous inverse.
The space ⁠$V^{\mathbb {Z} }$⁠ is homeomorphic to a Cantor set.

## Metric

A variety of different metrics can be defined on a shift space. One can define a metric on a shift space by considering two points to be "close" if they have many initial symbols in common; this is the p-adic metric. In fact, both the one- and two-sided shift spaces are compact metric spaces.

## Measure

A subshift of finite type may be endowed with any one of several different measures, thus leading to a measure-preserving dynamical system. A common object of study is the Markov measure, which is an extension of a Markov chain to the topology of the shift.
A Markov chain is a pair (P, π) consisting of the transition matrix, an n × n matrix P = (p$_{ij}$) for which all p$_{ij}$ ≥ 0 and
    $\sum _{j=1}^{n}p_{ij}=1$
for all i. The stationary probability vector π = (π$_i$) has all π$_i$ ≥ 0, ∑π$_i$=1{\textstyle \sum \pi _{i}=1} and has
    $\sum _{i=1}^{n}\pi _{i}p_{ij}=\pi _{j}.$
A Markov chain, as defined above, is said to be compatible with the shift of finite type if p$_{ij}$ = 0 whenever A$_{ij}$ = 0. The Markov measure of a cylinder set may then be defined by
    $\mu (C_{t}[a_{0},\ldots ,a_{s}])=\pi _{a_{0}}p_{a_{0},a_{1}}\cdots p_{a_{s-1},a_{s}}$
The Kolmogorov–Sinai entropy with relation to the Markov measure is
    $s_{\mu }=-\sum _{i=1}^{n}\pi _{i}\sum _{j=1}^{n}p_{ij}\log p_{ij}$

## Zeta function

The Artin–Mazur zeta function is defined as the formal power series
    $\zeta (z)=\exp \left(\sum _{n=1}^{\infty }{\Bigl |}{\textrm {Fix}}(T^{n}){\Bigr |}{\frac {z^{n}}{n}}\right),$
where Fix(T$^n$) is the set of fixed points of the n-fold shift. It has a product formula
    $\zeta (z)=\prod _{\gamma }\left(1-z^{|\gamma |}\right)^{-1}\$
where γ runs over the closed orbits. For subshifts of finite type, the zeta function is a rational function of z:
    $\zeta (z)=(\det(I-zA))^{-1}\ .$