A coalgebraic take on regular and $\omega$-regular behaviours
Tomasz Brengos

TL;DR
This paper develops a coalgebraic framework for modeling finite and infinite behaviors with B"uchi acceptance, unifying various automata types and establishing Kleene-type theorems for regular and -regular behaviors.
Contribution
It introduces a general coalgebraic approach to -regular behaviors, including constructions for suitable monads and coalgebraic automata, extending classical automata theory.
Findings
Framework instantiated on non-deterministic Buchi automata
Framework applied to tree automata and probabilistic automata
Established coalgebraic Kleene-type theorems for -regular behaviors
Abstract
We present a general coalgebraic setting in which we define finite and infinite behaviour with B\"uchi acceptance condition for systems whose type is a monad. The first part of the paper is devoted to presenting a construction of a monad suitable for modelling (in)finite behaviour. The second part of the paper focuses on presenting the concepts of a (coalgebraic) automaton and its (-) behaviour. We end the paper with coalgebraic Kleene-type theorems for (-) regular input. The framework is instantiated on non-deterministic (B\"uchi) automata, tree automata and probabilistic automata.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
\lmcsdoi
17424 \lmcsheadingLABEL:LastPageFeb. 08, 2019Dec. 23, 2021
A coalgebraic take on regular
and -regular behaviours
Tomasz Brengos
Faculty of Mathematics and Information Science
Warsaw University of Technology
ul. Koszykowa 75
00–662 Warszawa, Poland
Abstract.
We present a general coalgebraic setting in which we define finite and infinite behaviour with Büchi acceptance condition for systems whose type is a monad. The first part of the paper is devoted to presenting a construction of a monad suitable for modelling (in)finite behaviour. The second part of the paper focuses on presenting the concepts of a (coalgebraic) automaton and its (-) behaviour. We end the paper with coalgebraic Kleene-type theorems for (-) regular input. The framework is instantiated on non-deterministic (Büchi) automata, tree automata and probabilistic automata.
Key words and phrases:
bisimulation, coalgebra, epsilon transition, labelled transition system, tau transition, internal transition, logic, monad, Büchi automata, Buechi automata, saturation, weak bisimulation, infinite trace
1991 Mathematics Subject Classification:
F.1.1, F.4.1
This work has been supported by National Centre for Research and Development Grant CYBERSECIDENT/456962/III/NCBR/2020
Contents
1. Introduction
Automata theory is one of the core branches of theoretical computer science and formal language theory. One of the most fundamental state-based structures considered in the literature is a non-deterministic automaton and its relation with languages. Non-deterministic automata with a finite state-space are known to accept regular languages. These languages are characterized as subsets of words over a fixed finite alphabet that can be obtained from simple languages via a finite number of applications of three types of operations: union, concatenation and the Kleene star operation [HMRU00, Kle56]. This result is known under the name of
Kleene theorem for regular languages and readily generalizes to other types of finite input (see e.g. [PP04]).
On the other hand, non-deterministic automata have a natural infinite semantics which is given in terms of infinite input satisfying the so-called Büchi acceptance condition (or BAC in short). The condition takes into account the terminal states of the automaton and requires them to be visited infinitely often. It is a common practise to use the term Büchi automata in order to refer to automata whenever their infinite semantics is taken into consideration.
Although the standard type of infinite input of a Büchi automaton is the set of infinite words over a given alphabet, other types (e.g. trees) are also commonly studied [PP04]. The class of languages of infinite words accepted by Büchi automata can also be characterized akin to the characterization of regular languages. This result is known under the name of Kleene theorem for -regular languages and its variants hold for many input types (see e.g.[KN01, Büc90, GTW02, PP04]). Roughly speaking, any language recognized by a Büchi automaton can be represented in terms of regular languages and the infinite iteration operator . This begs the question whether these systems can be placed in a unifying framework and reasoned about on a more abstract level so that the analogues of Kleene theorems for (-)regular input are derived. The recent developments in the theory of coalgebra [CV12, SW13, USH16, Rut00] show that the coalgebraic framework may turn out to be suitable to achieve this goal.
A coalgebra is an abstract (categorical) representation of a computation of a process [Rut00, Gum99]. The coalgebraic setting has already proved itself useful in modelling finite behaviour via least fixpoints (e.g. [HJS07, SW13, Bre15]) and infinite behaviour via greatest fixpoints of suitable mappings [Jac04, Cîr10, UH15]. The infinite behaviour with BAC can be modelled by a combination of the two [USH16, Par81].
We plan to revisit the coalgebraic framework of (in)finite behaviour from the perspective of systems whose type functor is a monad. In the coalgebraic literature [Bre14, Bre15, BP16, BMP15, Bre18, BP19] these systems are often referred to by the name of systems with internal moves. This name is motivated by the research on a unifying theory of finite behaviour for systems with internal steps [SW13, Bre14, Bre15, BMSZ15, BP16, BMP15]. They arise in a natural manner in many branches of theoretical computer science, among which are process calculi [Mil89] (labelled transition systems and their weak bisimulation) or automata theory (automata with -moves), to name only two. Intuitively, these systems have a special computation branch that is silent. This special branch, usually labelled by the letter or , is allowed to take several steps and is, in some, a neutral part of the process. As thoroughly discussed in [Bre15], the nature of this type of transition suggests it is in fact (part of) the unit of a monad. Hence, from our point of view the following terms become synonymous:
[TABLE]
This observation allows for an elegant modelling of several coalgebraic behavioural
equivalences which take silent steps into account [BMP15, BP16, Bre15]. If the type of a coalgebra is a monad then the map becomes an endomorphism \alpha:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X in the Kleisli category for : a natural and simple setting to study composition and fixpoints. For instance, if is taken to be the monad modelling labelled transition systems [Bre15] then Milner’s weak bisimulation [Mil89] of an LTS given by is a strong bisimulation on its saturation , i.e. the smallest LTS over the same state space s.t. , (where the composition and the order are given in the Kleisli category for the LTS monad) [Bre15]. Hence, intuitively, is the reflexive and transitive closure of and is formally defined as the least fixpoint . The fact that labelled transition systems’ weak bisimulation can be modelled via saturation of endomorphisms of a given Kleisli category allows for a generalization of the setting to other systems (e.g. probabilistic [Bre15, BMP15]). The only requirement is that type functor is a monad whose Kleisli category satisfies suitable conditions for the definition of to be meaningful.
The reflexive and transitive closure is understood as an accumulation of a finite number of compositions of the structure with itself. Hence, the concept of coalgebraic saturation is intrinsically related to finite behaviour of systems with a monadic type. A similar treatment of infinite behaviour (and their combination used to model Büchi acceptance condition) in the context of coalgebras whose type is a monad has not been considered so far. The closest to this goal would be [UH15, USH16], where (in)finite trace semantics is given in the setting of -coalgebras for a monad and an endofunctor . We take this treatment one step further and embed into a monad which is tailored to modelling (in)finite behaviours and their combinations. The new setting allows us to present clear definitions of coalgebraic (in)finite semantics and reason about them. In particular, it allows us to state Kleene theorems for regular and -regular behaviours which would be challenging without the monadic types.
1.1. Motivations
Our purpose is to build a single coalgebraic setting that allows us to easily present definitions of (in)finite behaviours and reason about them aiming at their algebraic characterization. By finding a suitable monad describing the type of systems taken into consideration we are able to state generic Kleene theorems connecting syntax and semantics of languages: the former imposed by the canonical algebraic nature of and the latter given by -automata and their behaviours.
By presenting a recipe to extend a functor to a suitable monad, we automatically encompass systems with invisible steps. However, this should not be viewed as our primary goal. Instead, from our point of view, it should be perceived as a by-product.
1.2. The aim of the paper
We plan to:
- (1)
revisit non-deterministic (tree) automata and their behaviour in the coalgebraic context of systems whose type is a monad, 2. (2)
provide a type monad suitable for modelling (in)finite behaviour of general systems, 3. (3)
present a setting for defining (in)finite behaviour for abstract automata whose type is a monad, 4. (4)
state and prove coalgebraic Kleene theorems for (-)regular behaviour, 5. (5)
put probabilistic automata into the framework.
The first point is achieved in Section 3 by describing non-deterministic (tree) automata and their finite and infinite behaviour in terms of different coalgebraic (categorical) fixpoint constructions calculated in the Kleisli category for a suitable monad. Section 3 serves as a motivation for the framework presented later in Section 4 and Section 5.
Originally [Has06, SW13], coalgebras with internal moves were considered as systems for a monad and an endofunctor , where . Under some conditions the functor can be embedded into the monad , where is the free monad over [Bre15]. The monad is sufficient to model systems with internal moves and their finite behaviour [BMSZ15, Bre15, BMP15]. However, it will prove itself useless in the context of infinite behaviour. Hence, by revisiting and tweaking the construction of from [Bre15], Section 4 gives a general description of the monad , the type functor (or ) embeds into, which is used in the remaining part of the paper to model the combination of finite and infinite behaviour. The reason why we find the expressive power of suitable is the following: the object is defined for any as the carrier of the coproduct of the free algebra over and the algebra obtained by inversing the final coalgebra map. Hence, by slighty abusing the notation, we can write
Item 3 in the above list is achieved by using two fixpoint operators: the saturation operator and a new operator defined in the Kleisli category for a given monad. The combination of and allows us to define infinite behaviour with BAC.
Kleene-type theorems of 4 are a direct consequence of the definitions of finite and infinite behaviour with BAC using and .
Finally, in Section 6 we put probabilistic automata into the framework of (in)finite behaviour for systems whose type is a monad.
This paper is an extended version of [Bre18] with all missing proofs and additional Section 6 where probabilistic automata are considered.
2. Basic notions
We assume the reader is familiar with basic category theory concepts like a category, a functor, an adjunction. For a thorough introduction to category theory the reader is referred to [ML78]. See also e.g. [Bre14, Bre15, BMP15] for an extensive list of notions needed here.
2.1. Non-deterministic automata
The purpose of this subsection and the next one is to recall basic definitions and properties of non-deterministic automata and their tree counterparts: an automaton, its (-)language and Kleene theorems for regular and -regular languages. Note that the aim of this paper is to take these notions and statements and generalize them to the categorical setting.
Classically, a non-deterministic automaton, or simply automaton, is a tuple , where is a finite set of states, is a finite set called alphabet, a transition function and set of accepting states. We write if . There are two standard types of semantics of automata: finite and infinite. The finite semantics of is defined as the set of all finite words for which there is a sequence of transitions which ends in an accepting state [HMRU00]. The infinite semantics, also known as the -language of , is the set of infinite words for which there is a run for which the set of indices is infinite, or in other words, the run visits the set of final states infinitely often. Often in the literature, in order to emphasize that the infinite semantics is taken into consideration the automata are referred to as Büchi automata [PP04]. In our work we consider (Büchi) automata without the initial state specified and define the (-)language in an automaton for any given state (see Section 3 for details).
2.1.1. Kleene theorems
Finite and infinite semantics of non-deterministic automata can be characterized in terms of two Kleene theorems (see e.g. [HMRU00, PP04]). The first statement is the following. A language is a language of finite words of an automaton (a.k.a. regular language) if and only if it is a rational language, i.e. it can be obtained from languages of the form and for any by a sequence of applications of finite union, concatenation and Kleene star operation with the latter two given respectively by:
[TABLE]
for .
The second Kleene theorem focuses on -languages. A language is an -language (a.k.a. -regular language) of an automaton if and only if it is -rational, i.e. it can be written as a finite union
[TABLE]
where are regular languages, the language is given by111Our definition of and the one presented in e.g. [PP04] differ slightly on with . Indeed, in loc. cit., . This small difference does not change the formulation of the Kleene theorem. We choose our definition of because it can be viewed as the greatest fixpoint of a certain assignment. See the following sections for details.:
[TABLE]
and for and .
2.2. Tree automata
There are several other variants of input for non-deterministic Büchi automata known in the literature [PP04, GTW02]. Here, we focus on non-deterministic (Büchi) tree automaton, i.e. a tuple , where and the rest is as in the case of standard non-deterministic automata. The infinite semantics of this machine is given by a set of infinite binary trees with labels in for which there is a run whose every branch visits infinitely often [PP04, GTW02]. We recall these notions here below (with minor modifications to suit our language) and refer the reader to e.g. [PP04] for more details.
2.2.1. Trees
Formally, a binary tree or simply tree with nodes in is a function , where is a non-empty prefix closed subset of . The set is called the domain of and is denoted by . Elements of are called nodes. For a node any node of the form for is called a child of . A tree is called complete if all nodes have either two children or no children. The height of a tree is . A tree is finite if it is of a finite height, it is infinite if . The frontier of a tree is . Elements of are called leaves. Nodes from are called inner nodes. The outer frontier of is defined by . I.e. it consists of all the words such that and . Finally, set .
Let denote the set of all complete trees with inner nodes taking values
in and which have a finite number of leaves, all from the set . Note that trees from of height [math] can be thought of as elements of . Hence, we may write . Moreover, trees of height can be viewed as elements from . Thus, . Additionally, any induces a map which assigns to the tree obtained from by replacing any occurrence of a leaf with . This turns into a -endofunctor. For two functions and we may naturally define for which is a tree obtained from with every occurence of a variable replaced with the tree . It is a simple exercise to prove that is associative. Moreover, if we denote the function by then . This follows from the fact that is a monad and is, in fact, the Kleisli composition for (see Example 4.2.1 for details).
Finally, and are sets of finite and infinite trees from respectively. Note that trees in have no leaves, hence for any set .
2.2.2. Büchi tree automata and their languages
Let be a tree automaton. A run of the automaton on a finite tree starting at the state is a map such that and for any we have
[TABLE]
We say that the run is successful if for any for the tree . The set of finite trees recognized by a state in is defined as the set of finite trees for which there is a run in starting at which accepts the tree .
Finally, let be an infinite tree with nodes in . An infinite run for starting at is a map such that and:
[TABLE]
The tree is said to be recognized by the state in if there is a run for which start at and for each path in some final state occurs infinitely often [PP04].
2.2.3. Rational tree languages
Rational tree languages are analogues of rational languages for non-deterministic automata. Akin to the standard case, they are defined as sets of trees obtained from trees of height by a sequence of applications of: finite union, composition and Kleene star closure. However, the non-sequential nature of trees requires us to consider composition of rational trees with more than one variable.
Formally, for any subset we define by , where and For any natural number we slightly abuse the notation and put and define to be the smallest family of subsets of which satisfies:
- •
,
- •
, where is of height less than or equal to ,
- •
if and then:
[TABLE]
- •
if then for any :
[TABLE]
It is easy to check that if we extend the definition of and put
[TABLE]
then the last item in the above list implies that for any we have .
Now for we define as the subset of consisting of common extensions of functions in for any . Finally, the -rational subset of trees is defined by [PP04]:
[TABLE]
where .
2.2.4. Kleene theorems
Let be the set of subsets of trees from for which there is an automaton accepting the given set of trees. Similarly, we define the set of infinite trees accepted by the tree automata. In this case the Kleene theorems for regular and -regular input are respectively given by [PP04]:
[TABLE]
In Section 3 we will show that Kleene theorems for non-deterministic automata and tree automata are instances of a generic pair of theorems formulated on a categorical level.
2.3. Algebras and coalgebras
Let be a functor. An -coalgebra (-algebra) is a morphism (resp. ). The object is called a carrier of the underlying -(co)algebra. Given two coalgebras and a morphism is homomorphism from to provided that . For two algebras and a morphism is called homomorphism from to if . The category of all -coalgebras (-algebras) and homomorphisms between them is denoted by (resp. ). We say that a coalgebra is final or terminal if for any -coalgebra there is a unique homomorphism from to .
{exa}
Let be a set of labels. Labelled transition systems (see e.g. [San11]) can be viewed as coalgebras of the type [Rut00]. Here, is the powerset functor which maps any to the set and any to .
Non-deterministic automata as defined in Subsection 2.1 are modelled as coalgebras of the type , where (e.g. [HJS07]). Indeed, any non-deterministic automaton is modelled by where:
[TABLE]
where \chi(q)=\left\{\begin{array}[]{cc}\{\checked\}&q\in\mathfrak{F},\\ \varnothing&\text{ otherwise.}\end{array}\right. In a similar manner, we can model tree automata coalgebraically, i.e. as coalgebras of the type .
{exa}
Fully probabilistic processes [BH97] sometimes referred to as fully probabilistic systems [Sok11] are modelled as -coalgebras [Sok11]. Here, denotes the subdistribution functor assigning to any set the set of subdistributions with countable support and to any map the map with
[TABLE]
2.4. Monads
For a general introduction to the theory of monads the reader is referred to e.g. [BW02, ML78]. A monad on is a triple , where is an endofunctor and , are two natural transformations for which the following diagrams commute:
[TABLE]
The transformation is called multiplication and the transformation is called unit.
For any monad we define the Kleisli category for has whose class of objects is the class of objects of and for two objects in we put with the composition in defined between two morphisms and by . Since most of the time we work with two categories at once, namely and , morphisms in will be denoted using standard arrows , whereas for morphisms in we will use the symbol \longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{\mkern-21.0mu\circ\mkern 10.0mu}. Hence, f:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Y=X\to TY and the composition is given by
[TABLE]
We define a functor which sends each object to itself and each morphism in to the morphism . Maps in of the form for some are referred to as base morphisms.
Every monad on a category arises from the composition of a left and a right adjoint: , where the left adjoint is and the right adjoint is defined as follows: for any object (i.e. ) the object is given by and for any morphism in the morphism is given by .
We say that a functor lifts to a functor provided that the following diagram commutes:
\mathsf{C}$$\mathsf{C}$$\mathcal{K}l(T)$$\mathcal{K}l(T)$$F$$\overline{F}$$\sharp$$\sharp
There is a one-to-one correspondence between liftings and distributive laws between the functor and the monad 222A distributive law between a functor and a monad is a natural transformation which additionally satisfies extra conditions listed in e.g. [JSS12, Mul93]. . Indeed, any lifting induces the transformation whose -component is and any distributive law gives rise to a lifting given by:
[TABLE]
A monad on a category with finite products is called strong if there is a natural transformation called tensorial strength satisfying the strength laws listed in e.g. [Koc72]. Existence of strength guarantees that for any object the functor admits a lifting defined as follows. For any we put and for any f:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Y=X\to TY we define Existence of the transformation is not a strong requirement. For instance all monads on are strong.
{exa}
The powerset endofunctor , used in the definition of labelled transition systems, non-deterministic automata and tree automata, carries a monadic structure for which the multiplication and the unit are given by:
[TABLE]
The Kleisli category consists of sets as objects and morphisms given by the maps f:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Y=X\to\mathcal{P}Y and g:Y\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Z=Y\to\mathcal{P}Z with the composition g\cdot f:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Z=X\to\mathcal{P}Z given by
[TABLE]
The identity morphisms \mathsf{id}:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X=X\to\mathcal{P}X are given for any by . The Kleisli category for is isomorphic to — the category of sets as objects, and relations as morphisms. The -component of the distributive law induced by strength of is:
[TABLE]
{exa}
The subdistribution functor from Example 2.3 carries a monadic structure , where is
[TABLE]
and assigns to any the Dirac delta distribution .
{exa}
For any monoid the -functor carries a monadic structure , where and .
From the perspective of this paper, the most imporant instance of the family of monads from Example 2.4 is the monad , where is the free monoid over . The reason is that is the free monad over the functor and hence, since lifts to the Kleisli category for any -based monad (since all -based monads are strong), then so does whose lifting is the free monad over the lifting of [Bre15]. In practice, this yields a monadic structure on for any monad on the category of sets [Bre15].
{exa}
If then the Kleisli category for has the composition given as follows [Bre15]. For two morphisms f:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Y=X\to\mathcal{P}(\Sigma^{*}\times Y) and g:Y\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Z=Y\to\mathcal{P}(\Sigma^{*}\times Z) we have
[TABLE]
The identity morphisms in this category are \mathsf{id}:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X=X\to\mathcal{P}(\Sigma^{\ast}\times X) given by .
In a similar manner, using the remark above, we show that carries a monadic structure.
2.5. Coalgebras with internal moves
Coalgebras with internal moves were first introduced in the context of coalgebraic trace semantics as coalgebras of the type for a monad and an endofunctor on with defined by [Has06, SW13]. If we take then we have , where . In [Bre15] we showed that given certain assumptions on and we may embed the functor into the monad , where is the free monad over . In particular, if we apply this construction to and we obtain the monad from Example 2.4. The construction of is revisited in this paper in Section 4. The trick of modelling the invisible steps via a monadic structure allows us not to specify the internal moves explicitly. Instead of considering -coalgebras we consider -coalgebras for a monad on an arbitrary category.
The strategy of finding a suitable monad (for modelling the behaviour taken into consideration) will also be applied in this paper. Unfortunately, from the point of view of the infinite behaviour of coalgebras, considering systems of the type is not sufficient (see Section 3 for a discussion). Hence, in Section 4 we show how to obtain a monad suitable for modelling infinite behaviour. Intuitively, the new monad extends by adding an ingredient associated with the terminal -coalgebra . The construction presented in Section 4 yields the monad suitable to capture both: finite and infinite behaviour of systems. Below we give two examples of such monad.
{exa}
Although the monad from Example 2.4 proves to be sufficient to model finite behaviours of non-deterministic automata (see [Bre15, BMP15]), it will not be suitable to model their infinite behaviour (see Section 3 for details). Hence, we extend and consider the following. Let be the set of all infinite sequences of elements from . As it will be shown in sections to come, the functor carries a monadic structure whose Kleisli composition is as follows. For and the map g\cdot f:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Z=X\to\mathcal{P}(\Sigma^{\ast}\times Z+\Sigma^{\omega}) satisfies:
[TABLE]
In the above we write whenever and if for , . The identity morphisms in this category are the same as in the Kleisli category for the monad . The monadic structure of arises as a consequence of a general construction of monads modelling (in)finite behaviour described in detail in Section 4.
{exa}
If we move from non-deterministic automata towards tree automata we have to find a suitable monadic setting to talk about their (in)finite behaviour. It turns out that a good candidate for this monad can be built from the ingredients already presented in this paper. Indeed, if we take the powerset monad and the monad from Subsection 2.2.1, then their composition carries a monadic structure333The proof of this claim can be found in Section 4. See Example 4.2.1 for details.. The formula for the composition in the Kleisli category for the monad is given for and by g\cdot f:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Z=X\to\mathcal{P}T_{\Sigma}Z with being a set of trees obtained from trees in by replacing any occurence of the leaf with a tree from . As will be witnessed in Section 4, this monad and the monad arise from the same categorical construction.
The list of examples of monads used in the paper will be extended in the upcoming sections.
2.6. Categorical order enrichment
Our main ingredients for defining (in)finite behaviours of automata will turn out to be two fixpoint operators: and . In order to establish them on a categorical level we require the category under consideration to be suitably order enriched. A category is said to be order enriched, or simply ordered, if each hom-set is a poset with the order preserved by the composition. It is -ordered if all hom-posets admit arbitrary finite (possibly empty) suprema. Note that, given such suprema exist,
the composition in does not have to distribute over them in general. We call a category left distributive (or LD in short) if it is -ordered and for any finite set . We define right distributivity analogously. In this paper we come across many left distributive categories that do not necessarily satisfy right distributivity. Still, however, all examples of Kleisli categories taken into consideration satisfy its weaker form. To be more precise, we say that the Kleisli category for a monad on is right distributive w.r.t. base morphisms provided that for any f_{i}:Y\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Z=Y\to TZ\in\mathcal{K}l(T)(Y,Z), any and any finite set . We say that an order enriched category is -enriched if any countable ascending chain of morphisms with common domain and codomain admits a supremum which is preserved by the morphism composition. Finally, in an ordered category with finite coproducts we say that cotupling preserves order if for any with suitable domains and codomains.
Remark 1**.**
Right distributivity w.r.t. the base morphisms and cotupling order preservation are properties we often get as a consequence of other general assumptions. Indeed, any -based monad whose order enrichment of the Kleisli category is given by , for where is a poset for any 444In this case, we say that the order enrichement of is pointwise induced., satisfies these conditions. Note that, in this case, the Kleisli composition over any suprema or infima that exist is right distributive w.r.t. morphisms of the form j^{\sharp}=\eta_{Y}\circ j:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Y=X\to TY for any set map . A similar argument applies to cotupling order preservation.
{exa}
The next section of this paper focuses on three categories, namely: , and . These categories are order-enriched with the hom-set ordering given by . The base morphisms of the first two examples are of the form
[TABLE]
for a set map . The base morphisms of the third example are given by . We leave it as an exercise to the reader to verify that all these examples satisfy the following conditions: the order enrichment is pointwise induced; they are -enriched; their hom-sets are complete lattices; they are left distributive555We refer the reader to [Bre15] for a proof that satisfies these conditions.. These conditions play a central role in defining (in)finite behaviours on a coalgebraic level. We will elaborate more on them in Section 5.
2.7. Lawvere theories
The primary interest of the theory of automata and formal languages focuses on automata over a finite state space. Hence, since we are interested in systems with internal moves (i.e. coalgebras for a monad ), without loss of generality we may focus our attention on coalgebras of the form , where with . These morphisms are endomorphisms in a full subcategory of the Kleisli category for , we will later refer to as (Lawvere) theory. Restricting the scope to this category instead of considering the whole Kleisli category for a given monad plays an important role in Kleene theorems characterizing regular and -regular behaviour (see e.g. [HMRU00, PP04]).
Formally, a Lawvere theory, or simply theory, is a category whose objects are natural numbers such that each is an -fold coproduct of . The definition used here is dual to the classical notion [Law63] and can be found in e.g. [ÉK11, ÉK13, EH09]. The reason why we use our version of the definition is the following: we want the connection between Lawvere theories and Kleisli categories for -based monads to be as direct as possible. Indeed, in our case, any monad on induces a theory associated with it by restricting the Kleisli category to objects for any . Conversely, for any theory there is a based monad the theory is associated with (see e.g. [HP07] for details). This remark also motivates us to use the notation introduced before and denote morphisms from a theory by \longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{\mkern-21.0mu\circ\mkern 10.0mu}.
For any element let i_{n}:1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n denote the -th coproduct injection
and [f_{1},\ldots,f_{k}]:n_{1}+\cdots+n_{k}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n the cotuple of \{f_{l}:n_{l}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n\}_{l} depicted in the diagram on the right. The coprojection morphism n_{i}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{1}+\cdots+n_{k} into the -th component of the coproduct will be denoted by . Any morphism k\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n of the form [(i^{1})_{n},\ldots,(i^{k})_{n}]:k\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n for is called base morphism or base map. If is associated with a monad then the base morphisms in are exactly given by f^{\sharp}:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n=m\to Tn for -maps . Finally, let !:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1 be defined by . We say that a theory is a subtheory of if there is a faithful functor which maps any object onto itself.
{exa}
By , and we denote the theories associated with the monads , and respectively.
3. Non-deterministic automata, coalgebraically
The purpose of this section is to give motivations for the abstract theory presented in the remainder of the paper. In the first part of this section we focus on finite non-deterministic (Büchi) automata and their (in)finite behaviour from the perspective of the categories and . Afterwards, we deal with tree automata and their behaviour. Finally, we give a categorical perspective on Kleene theorems for automata taken into consideration.
3.1. Non-deterministic automata
Without any loss of generality we may only consider automata over the state space for some natural number . As mentioned in Example 2.3 any non-deterministic automaton may be modelled as a coalgebra [Rut00]. However, as it has been already noted in [USH16], from the point of view of infinite behaviour with BAC it is more useful to extract the information about the final states of the automaton and not to encode it into the transition map as above. Instead, given an automaton we encode it as a pair where is defined by and consider the map:
[TABLE]
Note that by extending the codomain of and both maps can be viewed as endomorphisms in and . The purpose of is to encode the set of accepting states with an endomorphism in the same Kleisli category in which the transition is an endomorphism. Now, we have all the necessary ingredients to revisit finite and infinite behaviour (with BAC) of non-deterministic automata from the perspective of the theories and .
3.1.1. Finite behaviour
Consider \alpha^{\ast}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n to be an endomorphism in (or ) given by , where the order is as in Example 2.7. We have [Bre15]:
[TABLE]
where for , and . Let us observe that the theory morphism !:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1 is explicitly given in the case of theories and by for any . Finally, consider the morphism !\cdot\mathfrak{f_{F}}\cdot\alpha^{\ast}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1 in (or ) which is:
[TABLE]
Since , the set represents the set of all finite words accepted by the state in the automaton .
3.1.2. Infinite behaviour
Note that the hom-posets of theories and are complete lattices and, hence (by the Tarski-Knaster theorem), come equipped with an operator which assigns to any endomorphism \beta:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n the morphism \beta^{\omega}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0 defined as the greatest fixpoint of the assignment . Now, if is given as in the previous subsections and considered as an endomorphism in the theory then the map \alpha^{\omega}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=n\to\mathcal{P}(\Sigma^{\ast}\times\varnothing) in satifies . However, if we consider to be an endomorphism in and compute \alpha^{\omega}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=n\to\mathcal{P}(\Sigma^{\ast}\times\varnothing+\Sigma^{\omega})=n\to\mathcal{P}(\Sigma^{\omega}) in the result will be different. Indeed, we have the following.
Proposition 2**.**
Let and, since , it can be considered as an endomorphism in . In this case, the explicit formula for the greatest fixpoint \beta^{\omega}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=n\to\mathcal{P}(\Sigma^{\omega}) of the assignment calculated in is given by:
[TABLE]
where assigns to any sequence of words over the set
[TABLE]
Proof 3.1**.**
At first let us note that we may assume . This is a consequence of the fact that 666This identity is proven in Lemma 9 in the general setting of ordered theories equipped with and satisfying additional conditions that, in particular, hold for . Hence, we refer the reader to Section 5 for the general proof of the statement.. Restated, this condition means that for any we have:
[TABLE]
Let \beta^{o}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=n\to\mathcal{P}(\Sigma^{\omega}) be a map whose value is given in terms of the right hand side of the equality 3.1. Observe that this map satisfies in . This follows directly from the definition of and the formula for the composition in . Thus, . Now, by contradiction, if then there is and such that and . Hence, in particular, this means that there is an infinite sequence of transitions in which starts at . If there was no such sequence, this would mean that which cannot hold. Since , there is a state and , such that and with . Note that we may assume as there has to be a prefix of with for some state with . If it was otherwise, then by 3.2 we would have an infinite sequence yielding which contradicts our assumptions. Hence, if for and then we also have . By inductively repeating this argument we get a sequence in such that and . Thus, by the definition of we also get which is a contradiction.
3.1.3. Büchi acceptance condition
Before we spell out the recipe of how to extract -language of any state in the automaton in terms of , and the composition in , we need one last ingredient. Let us define and note
[TABLE]
Hence, viewed as an endomorphism in is given by \mathfrak{f_{F}}\cdot\alpha^{+}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n=n\to\mathcal{P}(\Sigma^{*}\times n+\Sigma^{\omega}) where:
[TABLE]
Finally, consider the following map in :
[TABLE]
By Proposition 2, the map satisfies:
[TABLE]
The above statement suggests a general approach towards modelling (-)behaviours of abstract (coalgebraic) automata which we will develop in the sections to come.
3.2. Tree automata
Let us now focus our attention on tree automata and their behaviour. Just like in the previous subsection we may consider automata over the state space . Moreover, as before, we also encode any tree automaton as a pair . Since , the transition map can be viewed as (i.e. as an endomorphism in the Kleisli category for the monad or, equivalently, as an endomorphism in the theory ). The hom-sets of the Kleisli category for and its full subcategory admit ordering in which we can define , and for any \beta:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n as in the previous subsection. Not surpisingly, if we now compute and in we exactly get the following777The proof of Proposition 3 is intensionally omitted as it goes along the lines of the series of statements made in Subsection 3.1 for non-deterministic automata. .
Proposition 3**.**
For any we have:
[TABLE]
3.3. Kleene theorems, categorically
The purpose of this subsection is to restate classical Kleene theorems from Subsection 2.1 on the categorical level for and . Before we do this let us elaborate more on why we choose our setting to be systems whose type is a monad.
Remark 4**.**
As the examples of non-deterministic (tree) automata studied in the previous subsection do not admit silent moves, the reader may get an impression that the need for categorical modelling of infinite behaviour for systems with silent steps is not sufficiently justified. To add to this, although -moves are a standard feature of automata whenever it comes to their finitary languages, invisible moves rarely occur in practice in the classical literature on the infinite behaviour (with BAC) (see e.g. [PP04]). However, as already mentioned in the introduction, incorporation of silent moves should be viewed as a by-product of our paper’s framework, not its main purpose. The main aim is to build a simple bridge between syntax and semantics of regular and -regular behaviours in the form of generic Kleene theorems. Once we embed our systems into systems whose type is a monad , the syntax arises from the algebraicity of and the semantics is provided by automata whose transition maps are certain -coalgebras. This also allows us to abstract away from several “unnecessary” details and focus on core properties.
As witnessed in Subsection 2.1, Kleene theorems for tree automata were slightly more involved than their classical counterparts for non-deterministic automata. The reason for this is simple: non-deterministic automata accept sequential data types. Whenever we deal with non-sequential data, e.g. trees, the set of (-)regular languages is expected to be closed under a more complex type of composition, i.e. the composition of regular languages with multiple variables [GTW02, PP04]. Hence, if we aim at categorical statements generalizing theory from Subsection 2.1 then we should expect a slightly more involved formulation to be our point of reference. Hence, we start with presenting a categorical perspective of Kleene theorems for tree automata first.
3.3.1. Tree automata
The Kleene theorems for regular and -regular input from Subsection 2.2.4 are equivalent to the following proposition.
Proposition 5**.**
Let and be defined as in Subsection 2.2.4. Let be the smallest subtheory of such that:
- (1)
it contains all maps of the form , 2. (2)
is closed under finite suprema, 3. (3)
its endomorphisms are closed under .
Then the hom-set of the theory equals to . Moreover, the set of -regular languages for tree automata satisfies .
3.3.2. Non-deterministic automata
The formulation of Proposition 5 allows us to instantiate it for non-deterministic automata. A simple verification proves that the following holds.
Proposition 6**.**
Let be the smallest subtheory of such that:
- (1)
it contains all maps of the form , 2. (2)
it is closed under finite suprema, 3. (3)
its endomorphisms are closed under .
Then the hom-set of the theory equals to:
[TABLE]
Additionally, the set \omega\mathfrak{Reg}\triangleq\{r:1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=1\to\mathcal{P}(\Sigma^{\omega})\mid r(1)\text{ is \omega-regular}\} satisfies:
[TABLE]
3.4. Beyond tree automata
There are variants of non-deterministic (Büchi) automata that accept other types of input (e.g. arbitrary finitely-branching trees, see e.g. [USH16]). In general, given a functor we define a non-deterministic (Büchi) -automaton as a pair , where and . A natural question that arises is the following: are we able to build a general categorical setting in which we can reason about the (in)finite behaviour of systems for arbitrary non-deterministic Büchi -automata (or even more generally, for systems of the type for a monad )? If so, then is it possible to generalize the Kleene theorem for regular languages to a coalgebraic level? We will answer these questions positively in the next sections.
4. Monads for (in)finite behaviour
Given a monad and an endofunctor on a common category, the purpose of this section is to provide a construction of a monad which extends the functor . The monad will prove itself sufficient to model the combination of finite and infinite behaviour (akin to the monad for the functor , or for ).
At first we list all assumptions required in the remainder of this section. Later, in Subsection 4.2, we revisit the construction of the monad from [Bre15]. Finally, we give a description of .
{asm}
Let be a category which admits binary coproducts. We denote the coproduct operator by and the coprojection into the first and the second component of a coproduct by and respectively. Moreover, let be a functor. In what follows, in this section we additionally assume:
- (1)
is a monad on and lifts to via a distributive law , 2. (2)
there is an initial -algebra for any object and a terminal -coalgebra , 3. (3)
the category of -algebras admits binary coproducts (with the coproduct operator denoted by ).
4.1. Preliminaries
The initial -algebra yields the free -algebra over given by . Hence, by our assumptions we have an adjoint situation , where the left adjoint is the free algebra functor which assigns to any object the free algebra over it. The right adjoint is the forgetful functor which assigns to any -algebra its carrier and is the identity on morphisms. The adjunction yields the monad which assigns to any object the carrier of the free -algebra over .
{exa}
For any set and the initial -algebra is given by the morphism , where
[TABLE]
4.1.1. Bloom algebras
The purpose of this subsection is to recall basic definitions and properties of Bloom -algebras [AHM14] whose free algebras yield a monad on which extends the functor . This will allow us to embed systems of the type to systems of the type and discuss their (in)finite behaviour in the latter context.
A pair is called a Bloom -algebra provided that any -coalgebra yields the map which satisfies:
X$$A$$FX$$FA$$e$$a$$e^{\dagger}$$Fe^{\dagger}andX$$Y$$FX$$FY$$e$$f$$h$$FhimpliesX$$Y$$A$$e^{\dagger}$$f^{\dagger}$$h
A homomorphism from a Bloom algebra to a Bloom algebra is a map which is an -algebra homomorphism from to , which additionally preserves the dagger, i.e. . The category of Bloom algebras and homomorphisms between them is denoted by . We have the following theorem.
{thmC}
[[AHM14]] The pair , where assigns to the unique coalgebra homomorphism between and , is an initial object in . Moreover, the -algebra coproduct
[TABLE]
is the free Bloom algebra over .
Remark 7**.**
Let be defined as the composition of the left and right adjoints , where the left adjoint is the free Bloom algebra functor and the right adjoint is the forgetful functor. The functor carries a monadic structure which extends . Indeed, by Theorem 4.1.1, the monad is a submonad of (via the transformation induced by the coprojection into the first component of in ). The formula for the free Bloom algebra from the above theorem indicates that is a natural extension of encompassing infinite behaviours of the final -coalgebra. By abusing the notation slightly, we can write
[TABLE]
The functor is a subfunctor of [Bre15, Lemma 4.12] and hence, by the above, also of . In the following sections this will let us turn any coalgebra or into a system and, by doing so, allow us to model their (in)finite behaviour.
{exa}
The terminal -coalgebra is
[TABLE]
The coproduct of and in is
[TABLE]
Hence, the free Bloom algebra over is a map explicitly given by: .
Let be a Bloom algebra, an -algebra and a homomorphism between -algebras and . Then there is a unique assignment which turns into a Bloom algebra and into a Bloom algebra homomorphism and it is defined as follows [AHM14]: for the map is .
4.2. Lifting monads to algebras
Take an -algebra and define . If is a homomorphism of algebras and we put . In this case is a functor for which the morphism is an -algebra homomorphism from to . Moreover, is a homomorphism from to (see [Bec69] for details). A direct consequence of this construction is the following.
{thmC}
[[Bec69]] The triple , where for we put
[TABLE]
is a monad on .
The above theorem together with the assumption of existence of an arbitrary
free -algebra in leads to a pair of adjoint situations captured by the diagram on the right. Since the composition of adjunctions is an adjunction this yields a monadic structure on the functor .
{exa}
An example of this phenomenon is given by the monad from Example 2.4 where in the above we set and . This monad has already been described e.g. in [Bre15], but it arose as a consequence of the composition of a different pair of adjunctions.
4.2.1. Monads on Bloom algebras
Above we gave a recipe for a general construction of a monadic structure on the functor . As witnessed in [Bre15, BMSZ15], this monad is suitable to model coalgebras and their weak bisimulations and weak finite trace semantics (i.e. their finite behaviour). Our primary interest is in modelling infinite behaviour and this monad proves itself insufficient. The purpose of this subsection is to show how to tweak the middle category from the pair of adjunctions in pictured in the diagram above so that the monad obtained from the composition of two adjunctions is suitable for our needs.
Let be a Bloom algebra and define
[TABLE]
where for any the map is given by . Since is a homomorphism between and the pair is a Bloom algebra. For a pair of Bloom algebras and and a Bloom algebra homomorphism between them put . This defines a functor . Analogously to the previous subsection we have the following direct consequence of the construction.
Theorem 8**.**
The triple is a monad on , where for any Bloom algebra the -components of the transformations and are
[TABLE]
Hence, we obtain two adjoint situations captured in the diagram below. These
adjunctions impose a monadic structure on the functor . The monad from Example 2.5 arises from the composition of the above adjoint situations (see also Example 4.1.1).
{exa}
Let . This functor lifts to [HJS07] and, up to isomorphism, is a functor which assigns to any set the set of complete binary trees (i.e. every node has either two children or no children) with inner nodes taking values in and finitely many leaves, all taken from [AHM14] (see Subsection 2.1). This yields a monadic structure on defined in Example 2.5.
The above example can be easily generalized. Indeed, if is a commutative -based monad then any polynomial functor888A polynomial functor is a functor defined by the grammar [HJS07]. lifts to [HJS07]. If it admits all free -algebras and the final -coalgebra then Assumption 4 holds for and yielding the monad .
5. Abstract automata and their behaviour
The purpose of this section is to generalize the concepts from Section 3 to an arbitrary Kleisli category with a suitable ordering. In other words, given a -monad , we define a -automaton, its finite behaviour, its infinite behaviour with BAC and provide generic Kleene theorems for .
Let be a -based monad. Since we will often consider the Lawvere theory associated with it, recall that its objects are sets given by for . We start with the definition of a -automaton.
{defi}
A -automaton or simply automaton is a pair , where \alpha:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X=X\to TX is a -coalgebra called transition morphism and .
{asm}
In order to define finite and infinite behaviour of and reason about it we require the Kleisli category for to satisfy more assumptions. In this section we assume that:
- (1)
is order enriched with a pointwise induced order, 2. (2)
it is -enriched, 3. (3)
it is left distributive, 4. (4)
its hom-sets are complete lattices.
At first let us note that, in the light of Remark 1, by 1 we get:
- •
right distributivity w.r.t. the base morphisms and
- •
cotupling order preservation.
Additionally, since the Kleisli category for is left distributive we have:
- •
the bottoms satisfy for any g:Y\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Z.
The axioms 1-3 guarantee that the saturation is computable in -steps and is expressive enough. For a given \alpha:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X=X\to TX we can define maps \alpha^{\ast},\alpha^{+}:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X=X\to TX:
[TABLE]
The operator was thoroughly studied in [Bre14, Bre15, BMP15, BP16] in the context of coalgebraic weak bisimulation. Its definition does not require a complete lattice order. See loc. cit. for a discussion.
Assumption 4 allows us to define the greatest fixpoint of the map . Indeed for any \alpha:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X=X\to TX put \alpha^{\omega}:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=X\to T0 to be:
[TABLE]
where \top:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=X\to T0 is the greatest element of and
[TABLE]
is defined in terms of the transfinite induction by
[TABLE]
for a successor ordinal and the ordinary map composition operator , and for a limit ordinal . By the Tarski-Knaster theorem, the map \alpha^{\omega}:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=X\to T0 is the greatest fixpoint of the assignment .
{exa}
The Kleisli categories for the monads from Example 2.6 satisfy 1-4. Section 6 presents one more example of a Kleisli category that fits the setting in the context of probabilistic automata.
Before we present the definition of finite and infinite behaviour of automata we need one more technical result.
Lemma 9**.**
For any \alpha,\beta:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X=X\to TX we have:
- (1)
, 2. (2)
, and , 3. (3)
, 4. (4)
* for any ,* 5. (5)
.
Proof 5.1**.**
The proof of 1 and 2 can be found in [Bre15, Lemma 5.1 and Theorem 5.7]. To see 3 holds, i.e. note that is a fixpoint of and hence . By a similar argument we show . Thus,
[TABLE]
To prove note that by 3 we have . Hence, . Moreover, since we get the converse inequality, i.e. . This proves the assertion.
Finally, note that by monotonicity of since we have . Moreover,
[TABLE]
Hence, by induction we prove that . By the fact that our theory is -enriched we get:
[TABLE]
This proves that satisfies . Thus, which completes the proof.
5.1. Finite and infinite behaviour
The purpose of this subsection is to present the definitions of the finite and infinite behaviour with BAC for -automata. Let be a -automaton. Before we start, let us first encode the set of accepting states in terms of an endomorphism \mathfrak{f}_{\mathfrak{F}}:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X=X\to TX by:
[TABLE]
where denotes the bottom element of the poset .
{defi}
Finite and -behaviour of the automaton are given respectively in terms of morphisms in by: ||\alpha,\mathfrak{F}||:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1 and ||\alpha,\mathfrak{F}||_{\omega}:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0, where
[TABLE]
Finite behaviour of a state of is the map ||\alpha,\mathfrak{F}||\cdot x_{X}:1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1, and its -behaviour is given by ||\alpha,\mathfrak{F}||_{\omega}\cdot x_{X}:1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0. Here,
[TABLE]
{exa}
As we have already seen in Section 3, the finite and -behaviour of -automata coincides with the classical notions whenever the tuple is given by . The same applies to tree automata (see Proposition 3).
5.2. Additional remarks
Our approach to defining semantics for coalgebras seems to diverge slightly from the established coalgebraic takes known from e.g. [HJS07, SW13, BMSZ15, USH16]. The purpose of this subsection is to compare our setting with the frameworks presented in the literature and try to justify the (slight) differences.
Our approach builds on top of two fixpoint operators, namely and . The choice of these two operators, and not other (e.g. the dagger operator from [ÉK11, BMSZ15]) follows from the premise that we wanted to make the connection with the classical results in regular and -regular languages as clear and as direct as possible. As we witness here, the classical Kleene star operation and [PP04] prove to have their general categorical counterparts.
It may not be clear to the reader why the finite and -behaviour maps have different codomains, i.e. the former is a map X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1 and the latter X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0. Let us focus on the finite behaviour first. So far in the coalgebraic literature, finite behaviour of systems was introduced in terms of finite trace [SW13, BMSZ15, JSS12]. In the setting of systems it is obtained in terms of the initial algebra-final coalgebra coincidence [HJS07, BMSZ15]. When translated to the setting of systems with internal moves, the finite trace is given by \mu x.x\cdot\alpha:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0 and is calculated in the Kleisli category for the monad [Bre14, Bre15]. However, this holds for coalgebras whose type monad encodes accepting states. From the point of our setting, the accepting states are not part of the transition and are encoded in terms of instead. The direct use of initial algebra-final coalgebra coincidence makes no sense here, as the initial algebra would simply be degenerate. Luckily, there is a simple formal argument showing that our approach from this paper and the aforementioned approach established in the coalgebraic literature coincide. For the monad and a -automaton consider the monad 999It can be easily verified that for any monad the functor carries a monadic structure. It follows from the fact that the exception monad induces an exception monad transfomer . and the map defined for any by , where \chi_{\mathfrak{F}}:X\to T(X+1);x\mapsto\left\{\begin{array}[]{cc}\eta_{X+1}(1)&\text{ if }x\in\mathfrak{F},\\ \perp&\text{ otherwise}.\end{array}\right. It is a simple exercise to prove that the least fixpoint \mu x.x\cdot(\alpha\vee\chi_{\mathfrak{F}}):X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=X\to T(0+1)=X\to T1 calculated in is the same as the finite behaviour map ||\alpha,\mathfrak{F}||:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1=X\to T1 calculated in . Therefore, our definition of finite behaviour via coincides with the coalgebraic finite trace semantics via .
The finite behaviour of a state of an automaton from Definition 5.1 is of type 1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1. We argue that this map should be viewed as a generalization of a finitary language. Classically, these languages have been considered in some algebraic context, e.g. with the familiar algebraic operations of concatenation, Kleene start closure and finite union. These operations considered on our abstract categorical level directly translate into morphism composition, saturation and finite joins of endomorphisms 1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1 respectively.
As far as the infinite behaviour is concerned, it should be noted here that our prototypical example of a monad is from Section 4. By Theorem 4.1.1 the object is the carrier of the terminal -coalgebra making . This is exactly what we expect to have as a codomain of an infinite trace map (see also for comparison [USH16, Cîr10]).
Additionally, the type of the infinite behaviour of a state of an automaton is 1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0 and it reflects the partial algebraic nature of (in)finitary languages. In particular, it makes sense to compose (concatenate) a finitary langugage 1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1 with an infinitary language 1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0 and get an infinitary one (1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0=1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0), but not vice versa. Moreover, it does not necessarily make sense to compose two infinitary languages (1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0 and 1\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0) with each other.
5.3. Kleene theorems
The purpose of this part of the paper is to state and prove Kleene theorems akin to Proposition 5 and 6. These theorems require us to work with finite automata and their behaviour, so we will restrict the setting of this subsection to the Lawvere theory associated with the monad .
In this subsection we consider a set of endomorphisms from such that:
- •
contains all base map endomorphisms,
- •
\perp_{n,n}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n\in\mathcal{A} for any 101010In order to simplify the notation we will often omit the subscript and write to denote if the domain and codomain of can be deduced from the context.,
- •
if \{\alpha_{k}:n_{i}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{i}\}_{k=1,\ldots,k}\subseteq\mathcal{A} then ,
- •
is closed under taking finite suprema.
The set plays a role of a set of admissible transition functions for automata taken into consideration. A -automaton whose transition \alpha:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n is an arrow in is called -automaton if .
{exa}
In the case of our leading examples of theories, namely and , the prototypical choice for was given in condition (a) in Proposition 6 and 5 respectively.
{defi}
The set of regular morphisms m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}p\in\mathbb{T} is defined by:
[TABLE]
The set of regular morphisms will be often referred to as the set of regular trees with variables in . Note that is exactly the set of finite behaviours of states in -automata.
We list the statements without proofs which we later provide in Subsection 5.3.1.
Lemma 10**.**
The identity maps in are regular morphisms. Moreover, regular morphisms are closed under composition from .
The above lemma precisely says that the collection of objects with morphisms forms a category with the composition taken from . We denote this category by . We have the following.
Theorem 11** (Kleene theorem for regular behaviour).**
The category is a subtheory of such that:
- (1)
it contains all maps from , 2. (2)
it admits finite suprema, 3. (3)
its endomorphisms are closed under .
Moreover, if denotes the smallest subtheory of which satsfies 1-3 then
[TABLE]
Finally, we define
[TABLE]
Theorem 12** **(Kleene theorem for -regular
behaviour).
We have
[TABLE]
5.3.1. Proofs
The purpose of this subsection is to present the proofs of the statements above. Before we proceed we would like to make a remark concerning the material presented here and its originality. Several Kleene theorems (akin to Theorem 11) have been presented and proven in the literature on the level of iteration theories (see e.g. [Ési97, BE93, EH09, ÉK11, ÉK13]). According to our knowledge, due to minor differences in the formulation, the theorems presented in our paper do not fit directly into any existing setting. However, the classical proof techniques used in loc. cit. are still applicable here. These methods are based on using well know properties satisfied by a fixpoint operator. We recall them here and present detailed proofs of our statements. We additionally use string diagrams as a visual aid to help the reader understand the techniques better.
In order to proceed with the proofs we need to introduce some new notions and define a notation used below. We start off by defining to be the set of morphisms from obtained by (pre- and post-)composing maps from with base morphisms with suitable domains and codomains:
[TABLE]
Moreover, since the proofs presented below use the identity GSPI which requires an extended definition of the saturation operator, for any morphism \alpha:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p we define:
[TABLE]
Note that . Hence, if then for \alpha:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p.
String diagram notation
Let us now develop a string diagram notation which will clarify the proofs considerably.
Remark 13**.**
It is important to emphasize that the purpose of the new notation is to build a visual aid to the technical statements made below. The reader should note that all proofs presented here are written so that the knowledge of the string diagram calculus is not required. However, given the complexity of some of the (in)equalities used, we strongly believe that the diagrammatic notation improves their readability (conf. e.g. GSPI and its diagrammatic representation). Hence, we decide to proceed with its introduction.
We adopt the standard string diagram calculus for monoidal categories [Sel11, FS18] which will be tailored to our purposes. A morphism f:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n is depicted by
f$$m$$n
. We will often drop the (co)domain types from the notation and depict simply by
. If f:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p and the coproduct codomain needs to be emphasized by the diagram notation then we depict by
. This generalizes to m_{1}+\cdots+m_{k}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{1}+\cdots+n_{l} in an obvious manner. Whenever f:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n and g:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}p then the composition g\cdot f:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}p is
f$$g
. Given two maps f:m_{1}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{1} and g:m_{2}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{2} the coproduct f+g:m_{1}+m_{2}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{1}+n_{2} is depicted by
f$$g
.
Given any endomorphism \alpha:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n we depict the saturated map by
.
By slightly abusing the notation we extend it to the generalized saturation operator and for any \alpha:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p denote \alpha^{\otimes}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p diagrammatically by:
[TABLE]
We will use a separate notation to denote special morphisms. The identity map \mathsf{id}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n is depicted by
, the maps {\perp_{0,m}}:0\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}m and {\perp_{m,0}}:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}0 by
and
respectively.
Since by Assumption 3 we have we depict by
.
Additionally, since the map \mathsf{in}^{m}_{m+n}:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}m+n satisfies , its diagrammatic representation is
.
The cotuple string diagram notation has already been presented in Subsection 2.7. However, since the the cotuple
[TABLE]
satisfies
[TABLE]
the following diagram depicts it:
.
Moreover, the morphism [\alpha,\mathsf{in}^{p}_{n+p}]:n+p\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p satisfies the identity
[TABLE]
and its diagrammatic representation is
\alpha$$n$$n$$p
.
We are now ready to list some basic observations and remarks about the diagram calculus introduced above. First of all note that by the properties of saturation the following diagram (in)equalities hold:
\leq$$\alphaand\alpha$$\alpha$$=$$\alpha
.
Moreover, since satisfies (Assumption 3) for any , we have:
[TABLE]
which diagrammatically is represented in terms of the following identity:
.
In the above, the right hand side of the equality, namely
, is the composition of
and
.
Generalized star pairing identity
Here, we present the so-called generalized star pairing identity described in any Lawvere theory equipped with an operator assigning to each morphism f:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p a morphism f^{\otimes}:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p [EH09]. This identity will hold in our setting and will be used in the proof of Theorem 11 and lemmas that precede it.
For f:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+m+p and g:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+m+p the generalized star pairing identity is [EH09]:
[TABLE]
where \pi:m+n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+m is given by and
[TABLE]
The generalized star pairing identity is depicted by the string diagram:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p
Rational morphisms.
Let be the theory defined in Theorem 11. Since (with its extension given in 5.1) is defined in in terms of a least fixpoint operator in a more general setting of the Kleisli category for which satisfies Assumption 5, we have the following [Ési97, EH09] 111111 Here, we sketch a proof of Lemma 14. The generalized star pairing identity is equivalent to the so-called pairing identity given in dagger theories which are also grove theories, where the dagger operator is compatible with the star operator [EH09]. The pairing identity for dagger theories holds in any -continuous theory [Ési97]. Our theory satisfies the assumptions of an -continuous grove theory where the dagger operator is given by (\alpha:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p)\mapsto(\mu x.x\cdot\alpha:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}p) and the extended saturation operator 5.1 is compatible with it. This completes the proof. We skip the definitions of the theories and new notions introduced in the footnote and refer the reader to loc. cit. for details.
(see also [BE93, ÉK11, ÉK13]):
Lemma 14**.**
The theory satisfies the generalized star pairing identity for the operator .
Regular morphisms and normal form.
Note that any regular map is a morphism in . In particular, this means that regular morphisms satisfy the generalized star pairing identity.
Let us first introduce a new notion.
{defi}
A morphism r:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}p is said to be in normal form if
[TABLE]
for some \alpha:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+p\in[\mathcal{A}] and .
Let the family of all maps in normal form be denoted by . The map and in from Definition 5.3 are depicted by the string diagrams below:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$\alpha$$m$$n-m$$m$$p$$n-m$$\alpha
The right-hand-side diagram is a correct representation of as it is the result of the composition of three maps:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$\alpha$$\mathsf{in}$$\alpha^{\otimes}$$[\perp,\mathsf{id}]=\perp+\mathsf{id}
It follows straight by Definition 5.3 that every map in normal form is a regular morphism. Note that the family of maps in normal form contains all base maps and all morphisms from . Additionally, it is closed under cotupling . Moreover, the following statement holds.
Lemma 15**.**
The family is closed under the composition , finite suprema and saturation .
Proof 5.2**.**
The proof is divided into three parts.
Part 1.* Here, we show that the family is closed under the composition. Take for and for , where \alpha:n_{1}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{1}+m_{2} and \beta:n_{2}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{2}+m_{3}. Consider morphisms f:n_{1}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{1}+n_{2}+m_{3} and g:n_{2}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{1}+n_{2}+m_{3} defined by*
[TABLE]
and represented in terms of their string diagrams respectively as follows:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$n_{1}$$n_{1}$$m_{2}$$n_{2}-m_{2}$$m_{3}$$\alpha
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$n_{1}$$m_{2}$$m_{2}$$n_{2}-m_{2}$$n_{2}-m_{2}$$m_{3}$$\beta
Let . Then \gamma:n_{1}+n_{2}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{1}+n_{2}+m_{3} is in and by a careful analysis of the generalized star pairing identity it follows that the morphism in GSPI is, in our case, given by which is diagrammatically captured by:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$n_{1}$$m_{2}$$m_{2}$$n_{2}-m_{2}$$n_{2}-m_{2}$$m_{3}$$\beta
Hence, by GSPI and 5.2 we get:
[TABLE]
Part 2.* Here, we show that given two maps and for \alpha:n_{1}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{1}+m_{2} and \beta:n_{2}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n_{2}+m_{2} their join is in normal form. Let f:m_{1}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}m_{1}+(n_{1}+n_{2})+m_{3} be defined in terms of supremum of the following two morphisms:*
[TABLE]
and
[TABLE]
where the endomorphism
[TABLE]
permutes the first and third component of the coproduct and is the identity everywhere else. Now, let g:n_{1}+n_{2}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}m_{1}+(n_{1}+n_{2})+m_{2} be given by:
[TABLE]
where the endomorphism \sigma^{\prime}:m_{1}+n_{1}+m_{2}+n_{2}+m_{2}\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}m_{1}+n_{1}+m_{2}+n_{2}+m_{2} injects the third component of the coproduct into the last component and is the identity everywhere else. The morphisms and are depicted in terms of their string diagrams respectively as follows:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$m_{1}$$m_{1}$$n_{1}-m_{1}$$m_{1}$$n_{2}-m_{1}$$m_{2}$$\vee$$m_{1}$$m_{1}$$m_{1}$$n_{1}-m_{1}$$n_{2}-m_{1}$$m_{2}$$m_{1}$$n_{1}$$n_{1}-m_{1}$$m_{1}$$\alpha$$n_{2}$$m_{1}$$n_{2}-m_{1}$$m_{2}$$\beta
Let . Then \gamma:m_{1}+(n_{1}+n_{2})\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}m_{1}+(n_{1}+n_{2})+m_{2} is in . The morphism is equal to and is depicted by:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$m_{1}$$m_{1}$$n_{1}-m_{1}$$m_{1}$$n_{2}-m_{1}$$m_{2}$$\vee$$m_{1}$$m_{1}$$m_{1}$$n_{1}-m_{1}$$n_{2}-m_{1}$$m_{2}$$\vee$$m_{1}$$m_{1}$$m_{1}$$n_{1}-m_{1}$$n_{2}-m_{1}$$m_{2}
Moreover, from GSPI is, in our case, given by , where is as above and is depiced as follows:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$m_{1}$$n_{1}$$n_{1}-m_{1}$$m_{1}$$\alpha$$n_{2}$$m_{1}$$n_{2}-m_{1}$$m_{2}$$\beta
As before, by a careful analysis of GSPI and 5.2 we get:
[TABLE]
Part 3.* Finally, we show that for a map r:m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}m given by its normal form for \alpha:n\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+m its saturation is in . The proof presented here uses a construction of a morphism that will later be used in the proof of Theorem 12 and the lemmas that precede it.*
Let \alpha^{\prime}:n+m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+m be given by and consider \gamma:n+m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}n+m defined by
[TABLE]
where \sigma:m+(n-m)+m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}m+(n-m)+m injects the third component of the coproduct into the first one and is the identity everywhere else. The map is depicted by the following diagram:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$\alpha$$\vee
Note that is a -map which satisfies for represented by the diagram:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$\alpha$$\vee
We have which is depicted by:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$\alpha$$\vee;=$$\alpha
Moreover,
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$\alpha$$\vee;\alpha$$=$$\alpha$$\alpha$$\vee$$\alpha$$=$$\alpha$$\vee$$\alpha
Hence, by right distributivity w.r.t. the base morphisms we have and . Since we conclude that:
[TABLE]
Moreover,
[TABLE]
for . Note that . Hence, to summarize:
[TABLE]
If we let and then the above inequalities are rephrased as follows:
[TABLE]
By 1 in Lemma 9, 2 in Assumption 5 and we get:
[TABLE]
Since and we get: Similarily, we show This proves that .
We are now ready to present the following proof.
Proof 5.3**.**
(Theorem 11) Note that all maps from are regular and all regular maps are in . By Lemma 15 morphisms from form a theory closed under finite suprema and saturation. Hence, . This completes the proof.
Before we proceed with the proof of Theorem 12 we require one extra statement. Let us define:
[TABLE]
and note that and . Additionally, the following holds.
Lemma 16**.**
For any we have:
[TABLE]
Proof 5.4**.**
All regular maps can be given in their normal form. Hence, we have
[TABLE]
*for , where . We depict by
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$\alpha
. Consider the morphism defined as in 5.3 depicted by the following diagram:*
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$\alpha$$\vee
By the properties listed in Part 3. of the proof of Lemma 15 we have:
[TABLE]
Moreover, let be defined by and depicted in the following diagram:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$\alpha;=$$\alpha
The map is a -map which satisfies . Additionally,
[TABLE]
Since we get that
[TABLE]
From the above we get:
[TABLE]
The identity follows by Lemma 9. The identity follows from a more general property: given two coalgebras \alpha:X\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}X=X\to TX and \beta:Y\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}Y=Y\to TY and a -map which is a coalgebra homomomorphism (or, equivalently, in ) we have: . This property known as uniformity of w.r.t. the base maps (see e.g. **[SP00]**). In our setting, the fixpoint operator is uniform w.r.t. the base maps since the order of is pointwise induced and since (see Remark 1).
This completes the proof of the lemma.
We are now ready to proceed with the proof of Theorem 12.
Proof 5.5**.**
(Theorem 12) We have
[TABLE]
as it is enough to note that
[TABLE]
and take , .
Conversely, let . Put and consider any regular morphism such that . For sake of clarity of notation let and . Consider the map , where \sigma:m+m\makebox[1.1pt][l]{\longrightarrow\makebox{\mkern-24.0mu\color[rgb]{1,1,1}\definecolor[named]{pgfstrokecolor}{rgb}{1,1,1}\pgfsys@color@gray@stroke{1}\pgfsys@color@gray@fill{1}{\bullet}\mkern 12.0mu}\makebox{}}m+m injects the first component of the coproduct into the second one and is the identity everywhere else. The morphism is depicted below:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$s^{\prime}$$s
Note that this map is a regular morphism, so the map is -regular. Moreover, we get:
[TABLE]
This completes the proof.
6. Probabilistic automata
The main purpose of this section is to put probabilistic systems [BH97, SdVW09, Sok11, USH16, BG05, BGB12] into the framework of Section 5. Here, we focus our attention on probabilistic automata which are akin to fully probabilistic systems from Example 2.3[BH97, BMP15, BEMC00, Sok11].
6.1. Preliminaries
A probabilistic automaton is a tuple
[TABLE]
where is a set of states, an alphabet, is a probability transition function, i.e. a function such that for any we have , and the set of accepting states.
For we define . An execution fragment is a finite sequence such that . We define , , , and . An execution is an infinite sequence with .
Let , , and . For an execution fragment of length let denote the set of all executions such that .
Let denote the set of all executions such that . Let be the smallest sigma field on which contains all sets for any execution fragment with . Finally, let denote the unique probability measure on such that for any execution fragment with . We will often drop the subscript and write instead of if the measure can be deduced from the context.
For and define to be the set of all executions for which there is with and and consider . As stated in [BH97] the set is -measurable. Additionally, put and .
An execution starting at is called -accepting provided that it visists infinitely often, i.e. the set is infinite. Let denote all -accepting executions and let . The set is -measurable as
[TABLE]
A curious reader is referred to e.g. [BEMC00, BH97] for more details on fully probabilistic systems and probability measures they induce. {exa} Consider the automaton , where is the probability transition function given by the diagram below:
f$$n$$n$$p$$g$$n$$p$$m$$m$$m$$n$$m$$p$$=$$f$$n$$g$$n$$p$$m$$m$$f$$n$$n$$n$$m$$p$$n$$m$$p$$m$$p$$s_{0}$$s_{1}$$1,\frac{1}{2}$$0,\frac{1}{2}$$0,\frac{1}{2}$$1,\frac{1}{2}
Let . Then consists of all executions such that for which ,
[TABLE]
and such that there is with and . Similarily, contains all executions such that , satisfying 6.1 and whose with its last letter equal to for some . In particular this means that and for any whose length equals to .
Now, is the set of all executions such that it satisfies 6.1 and for any there is such that equals to . Similarily, is the set of all executions whose first state is which satisfy the same argument as above. It is easy to see that 121212This follows by the fact that any execution satisfying 6.1 that is not a member of satisfies the following condition: there is a natural number such that for all we have and . Hence, the probability of the set of all such executions equals [math]. .
The remaining part of this section will focus on finding a suitable setting in which we can model probabilistic automata and their (in)finite behaviour using the framework presented in the previous section.
Remark 17**.**
Any probabilistic automaton can be modelled coalgebraically as a pair , where is the subdistribution monad from Example 2.3 and is given by (see e.g. [SdVW09, BMSZ15]):
[TABLE]
The Kleisli category associated with the monad 131313By applying the construction from Section 4 to and we obtain a monadic structure on the aforementioned functor. is order enriched with the hom-set ordering given for by:
[TABLE]
Although the Kleisli category for this monad is -enriched, its hom-posets do not admit arbitrary finite suprema [HJS07, BMP15]. In other words, the setting is incompatible with the setting from the previous section. Hence, the remaining part of this section is focused on solving this issue based on ideas given in [GP14, BMP15].
6.2. Choosing the right monad
Here, we introduce a monad which is a suitable replacement for , i.e. it satisfies the desired properties to make it suitable for modeling (in)finite behaviours of probabilistic automata. Inspired by [GP14] we consider the continuous continuation monad parametrized by the set whose functorial part is defined for any set by:
[TABLE]
where denotes the set of functions between two ’s and which preserve suprema of -chains. The identity maps and the composition in the Kliesli category for are as follows:
[TABLE]
with and . Note that any can be assigned a function which maps any onto
[TABLE]
It is not hard to see that this turns the family into a natural transformation which is a monad morphism between the monads and . Additionally, it is easy to see that there is a natural ordering of arrows in which share the same domain and codomain. Indeed, for we have:
[TABLE]
This turns the Kleisli category for the monad into an order enriched category. Moreover, the following theorem is true.
Lemma 18**.**
The order enrichment of is pointwise induced, every hom-set of is a complete lattice and the category is -enriched and left distributive.
Proof 6.1**.**
The fact that the partial order is a complete lattice order is a direct corollary from the definition of . We will now prove that Kleisli category for is -enriched. Take any ascending chain of morphisms and note that
[TABLE]
where the equality marked with () follows from the fact that consists of functions that preserve -chains. Note that the identities 6.3 and 6.4 hold more generally for an arbitrary family of morphisms and . This shows left distributivity of the Kliesli category and ends the proof.
From the above it follows that satisfies 1 - 4 from Section 5.
6.2.1. The monad for probabilistic automata and their behaviours
By instantiating the construction from Section 4 for and we obtain the monad . We explicitly spell out the formula for the identity maps and the composition in as it will be used throughout the remaining part of this section. For any set the identity map is given by:
[TABLE]
Moreover, for and the map is:
[TABLE]
where for and the map is given by for , and for .
The following statement is a direct consequence of the definition of the monad and the properties of from the previous subsection.
Theorem 19**.**
* satisfies 1 - 4 from Section 5.*
6.3. (In)finite behaviour
Let be a pair as in Remark 17 and consider
[TABLE]
where is given by 6.2. We see that the map can be viewed as an endomorphism in the Kleisli category for the monad .
The rest of this section is devoted to presenting some properties of and for the pair . We show that the values and of behaviour functions encode probabilities of certain events from . The main results are summarized in Theorem 21 and 22.
6.3.1. Finite behaviour
At first let us focus on describing the finite behaviour map . Before we do that (see Theorem 21 for details) we need to present some intermediate results first. The following lemma is a direct consequence of the definition of and the composition in .
Lemma 20**.**
We have:
[TABLE]
Now, consider a subset and note that, in the setting of this subsection, the map is explicitly given by:
[TABLE]
Hence, the map is given by:
[TABLE]
Therefore, the finite behaviour of is:
[TABLE]
For and put and consider a mapping given by:
[TABLE]
If we define a function by:
[TABLE]
then and:
[TABLE]
A careful analysis of the formulae from [BH97, BMP15] describing the value and the above observations lead us to the statement below. It turns out that for any state the value is the probability of reaching a state in from via an execution fragment whose trace is a member of :
Theorem 21**.**
We have:
[TABLE]
6.3.2. Infinite behaviour
Let us focus on the infinite behaviour of introduced in the previous section given by
[TABLE]
The following theorem gives us insight into what (some of) the values of the infinite behaviour function are. To be more precise, we show that for a state and a subset , the value of the infinite behaviour of calculated for the characteristic function of the set of all infinite sequences from with prefixes in equals to the probability of -accepting executions starting at whose trace prefix belongs to .
Theorem 22**.**
For any we have:
[TABLE]
where .
Proof 6.2**.**
The proof is divided into three parts.
Part 1.* We will first show the statement holds for , i.e. we prove that*
[TABLE]
Indeed, since
[TABLE]
we have:
[TABLE]
where is a descending chain of -measurable sets. Let us now consider a family of maps defined inductively as follows:
[TABLE]
Note that the sequence is descending for any fixed and and that
[TABLE]
We will now show that for . For we have:
[TABLE]
In the above
[TABLE]
Hence, if we continue with 6.19 we get:
[TABLE]
If we now assume by induction that the statement holds for some then
[TABLE]
Hence, by following a similar reasoning to the one applied to we get:
[TABLE]
Part 2.* We will now show that the following holds:*
[TABLE]
Assume . Then for of length less than or equal to we have is equal if and it is the constantly equal to zero function otherwise. This observation together with the fact that
[TABLE]
and induction allows us to prove the assertion.
Part 3.* The statement from Part 2. can be easily generalized to*
[TABLE]
for any pair of incomparable words with respect to lexicographic ordering on . Indeed, in this case the sets and are disjoint. If is not comparable with and then is constantly equal to zero function. However, if is comparable wit then for all such which are sufficiently long we have: . Hence, by the same argument as before we prove the desired assertion. Note that the equation generalizes to any finite set of incomparable words .
Finally, the general statement holds since the function
[TABLE]
preserves suprema of -chains. Indeed, let and note that for a countable subset of incomparable words . Then
[TABLE]
Hence,
[TABLE]
{exa}
Let us consider the probabilistic automaton from Example 6.1 and put it into the framework of the Lawvere theory for the monad . Below, we calculate (some values of) finite and infinite behaviours of the automaton derived from Example 6.1 in a direct manner (i.e. without applying Theorem 21 or Theorem 22). By following the guidelines of Remark 17 we obtain , where given by and . Moreover, is defined by
[TABLE]
and . Next, observe that by Lemma 20 the morphisms and are the least solutions to:
[TABLE]
Consider , , as in 6.9 and , as in 6.12. Then by 6.15
[TABLE]
By carefully analysing the formula for we conclude that, in our case,
[TABLE]
Similarily, by 6.15 we have
[TABLE]
In this case, however, a thorough analysis of the formula for leads us to the following conclusion:
[TABLE]
Now, in order to compute first consider which is given by:
[TABLE]
The morphism is the greatest map satisfying . In particular, this means that
[TABLE]
For we have and hence solves to the following equation for :
[TABLE]
In order to compute take given by and note that it satisfies . Moreover, it is not hard to see that 141414Indeed, follows trivially from the fact that . By the recursive formula describing and by induction we show that for any . This proves the assertion.. Therefore, the following equation holds:
[TABLE]
This proves that if we put
[TABLE]
then it satisfies 6.20. Thus,
[TABLE]
Remark 23**.**
By Theorem 19 probabilistic automata can be put into the framework of Section 5. Hence, Kleene theorems hold for any suitable choice of . In particular, we may take to be the least set of maps containing all morphisms of the form
[TABLE]
and satisfying the properties listed in the beginning of Subsection 5.3.
6.4. Summary
The purpose of this section was to put probabilistic automata into a monadic framework from Section 5 and reason about their (in)finite behaviours. We achieved this by introducing the continuous continuation monad and viewing probabilistic automata transition maps as coalgebras
[TABLE]
The monad gives rise to a Kleisli category which satisfies 1 - 4 from Section 5 making it possible to consider finite and infinite behaviours of automata taken into consideration. We proved that the behaviour maps encode probabilities of certain events from the execution space. These probabilities were attained without changing the underlying category: the type monad and the automata taken into consideration are -based. Additionally, Theorem 22 suggests that our infinite behaviour with BAC for probabilistic automata is similar to the one presented in [USH16]. However, in loc. cit. the base category for probabilistic systems was the category of measurable spaces and measurable functions. Hence, by Remark 23, Kleene theorems can be instantiated in our setting directly, but it is not possible to do so in the setting from [USH16].
7. Summary
The purpose of this paper was to develop a coalgebraic (categorical) framework to reason about abstract automata and their finite and infinite behaviours satisfying BAC. We achieved this goal by constructing a monad suitable for handling the types of behaviours we were interested in and defining them in the right setting. A natural and direct consequence of this treatment was Theorem 11 and Theorem 12, i.e. a (co)algebraic characterization of regular and -regular behaviour for systems whose type is a -based monad satisfying some additional properties. Our theory of finite and infinite behaviour for abstract automata has been successfully instantiated on: non-deterministic automata, tree automata and probabilistic automata.
Future work
Given our natural characterization of coalgebraic (-)regular languages we ask if it is possible to characterize it in terms of a preimage of a subset of a finite algebraic structure. Especially, considering the fact that by Theorem 9 the pair of hom-sets equipped with suitable operations resembles a Wilke algebra used in the algebraic characterization of these languages (see e.g. [PP04] for details).
Our definitions of the operators and via the least and greatest fixpoints suggest a connection between our line of work and -calculus [Koz83, BdRV01, Ven20]. In particular, it would be interesting to clarify how our coalgebraic framework fits into the framework of coalgebraic modal -calculus and its semantics (e.g. [CKP11, FLV10]) with an emphasis laid on non-classical systems, e.g. probabilistic systems from Section 6.
Related work
The first coalgebraic take on -languages was presented in [CV12], where authors put deterministic Muller automata with Muller acceptance condition into a coalgebraic framework. Our work is related to a more recent paper [USH16], where Urabe et al. give a coalgebraic framework for modelling behaviour with Büchi acceptance condition for -systems. The main ingredient of their work is a solution to a system of equations which uses least and greatest fixpoints. This is done akin to Park’s [Par81] classical characterization of -languages via a system of equations. In our paper we also use least and greatest fixpoints, however, the operators we consider are the two natural types of operators and which generalize the language operators and known from the classical theory of regular and -regular languages. The definitions of behaviours of an automaton are presented in terms of simple expressions involving Kleisli composition and the above operators. This allows us to state and prove generic Kleene theorems for (-)regular input which was not achieved in [USH16] and (in our opinion) would be difficult to obtain in that setting. To summarize, the major differences between our work and [USH16] are the following:
- •
we use the setting of systems with internal moves (i.e. coalgebras over a monad) to discuss infinite behaviour with BAC, which is given in terms of a simple expression using and in the Kleisli category,
- •
we provide the definition of (in)finite behaviours of a system and build a bridge between regular and -regular behaviours by characterizing them on a categorical level in terms of the Kleene theorems.
Abstract finite automata have already been considered in the computer science literature in the context of Lawvere iteration theories with analogues of Kleene theorems stated and proven (see e.g. [Ési97, ÉK11, ÉK13, EH09, BE93]). Some of these results seem to be presented using a slightly different language than ours (see Theorem 11 and e.g. [BE93, Theorem 1.4]). We decided to state Theorem 11 the way we did, in order to make a direct generalization of the classical Kleene theorem for regular input and to give a coalgebraic interpretation which is missing in [Ési97, ÉK11, ÉK13, EH09, BE93]. We should also mention that the infinite behaviour with BAC was defined in loc. cit. only for a very specific type of theories (i.e. the matricial theories over an algebra with an infinite iteration operator), which do not encompass e.g. non-deterministic Büchi tree automata and their infinite tree languages or probabilistic automata and their infinite behaviour.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[AHM 14] Jirí Adámek, Mahdieh Haddadi, and Stefan Milius. Corecursive algebras, corecursive monads and bloom monads. Logical Methods in Computer Science , 10(3), 2014.
- 2[Bd RV 01] Patrick Blackburn, Maarten de Rijke, and Yde Venema. Modal Logic , volume 53 of Cambridge Tracts in Theoretical Computer Science . Cambridge University Press, 2001.
- 3[BE 93] Stephen Bloom and Zoltán Ésik. Iteration Theories. The Equational Logic of Iterative Processes. Monographs in Theoretical Computer Science. Springer, 1993.
- 4[Bec 69] Jon Beck. Distributive laws. In B. Eckmann, editor, Seminar on Triples and Categorical Homology Theory , pages 119–140, Berlin, Heidelberg, 1969. Springer Berlin Heidelberg.
- 5[BEMC 00] Christel Baier, Bettina Engelen, and Mila E. Majster-Cederbaum. Deciding bisimilarity and similarity for probabilistic processes. J. Comput. Syst. Sci. , 60(1):187–231, 2000.
- 6[BG 05] Christel Baier and Marcus Grosser. Recognizing omega-regular languages with probabilistic automata. In Proceedings of the 20th Annual IEEE Symposium on Logic in Computer Science , LICS ’05, pages 137–146, Washington, DC, USA, 2005. IEEE Computer Society.
- 7[BGB 12] Christel Baier, Marcus Grösser, and Nathalie Bertrand. Probabilistic omega-automata. J. ACM , 59(1):1:1–1:52, March 2012.
- 8[BH 97] Christel Baier and Holger Hermanns. Weak bisimulation for fully probabilistic processes. In CAV , pages 119–130, 1997.
