2012 ACM Subject Classification Theory of computation → Formalisms; Theory of computation → Quantitative automata
Keywords and phrases Automata, conformance testing, categorical methods, weighted automata
Digital Object Identifier 10.4230/LIPIcs...
Funding This research is supported by the NWO grant No. VI.Vidi.223.096.
Acknowledgements We want to thank Henning Urbat and Fabian Lenke for discussions about join-semilattices, tensor products, and join-irreducible elements. We are also very grateful to the anonymous reviewers for their time and useful comments, which improved the paper.
Introduction
The W-method is a celebrated result in conformance testing of deterministic finite state machines (FSMs) by Chow [16 ] and Vasilevskii [61 ] . The W-method generates a finite test suite based on a specification FSM. Crucially, this test suite is complete , meaning that any (black-box) implementation that passes the test suite and has no more states than the specification is necessarily behaviourally equivalent. Behavioural equivalence is a strong property: it means that the two systems give equal outputs on any of the infinitely many inputs. On top of that, the test suite generated by the W-method is only polynomial in size.
One area where conformance testing is used is active automata learning . Algorithms such as L* [4 ] and its descendants assume access to an equivalence oracle, that is, a way of deciding whether a hypothesis is correct with respect to the system under learning (SUL). In active automata learning, the SUL is typically assumed to be black-box. A common way to realise the equivalence oracle is through conformance testing, where the hypothesis is viewed as the specification and the SUL as the implementation. Libraries such as LearnLib [22 ] and AALpy [48 ] have implemented the W-method and its extensions.
Active automata learning has been generalised to various types of automata, such as non-deterministic automata [13 ] , weighted automata [11 ] , stochastic systems with observable non-determinism [58 ] , and many others, including categorical frameworks that generalise and extend some of these algorithms [9 , 59 , 30 , 17 , 7 ] . This motivates us to also extend the W-method to a broader class of automata, since these algorithms all rely on equivalence queries. In particular, the main challenge that we address in this paper is to develop a framework for the W-method and its completeness that applies to types of automata beyond deterministic ones, such as non-deterministic automata and weighted automata.
The aim of constructing test suites for non-deterministic FSMs is not new. Petrenko and Yevtushenko describe a complete test suite in [52 ] with many references to prior work; we discuss more related work in § 7 . In this line of research, the fault domain, i.e. the class of models for which the test suite is complete, is fixed: it is the class of automata of a certain size. Our aim instead is to generalise the W-method specifically without fixing our fault domain a priori . This idea of taking a more liberal fault domain follows [39 ] and is strongly connected to the notion of k k k -A A A -completeness by Vaandrager and Melse [60 ] .
To this end, we build on the generalised W-method developed in [39 ] at the level of automata in monoidal closed categories, which includes instances such as deterministic automata, Mealy and Moore machines, and deterministic nominal automata [12 ] . Weighted automata over a field are also described in [39 ] , but the examples there require additional analysis beyond what the framework offers, and a systematic theory is missing. In particular, non-deterministic automata and weighted automata over Z \mathbb{Z} Z are not covered in op. cit.
Our approach is to develop a categorical framework for conformance testing based on effectful automata , i.e. automata that have an effectful transition structure modelled using a monad. Formally, these are automata in the Kleisli category of a monad, as already studied by Arbib and Manes [6 ] , and they naturally cover automata with non-deterministic, weighted, or stochastic transition structure. To obtain a general framework, we aim to instantiate the theory in [39 ] . However, this leads to a technical challenge: the assumptions are not met for automata in Kleisli categories, as these categories do not have enough structure to construct the test suites required by the W-method. Therefore, we exploit the algebraic structure of effectful automata by working in Eilenberg-Moore categories of commutative monads (§ 4 ). Showing that the framework applies to these categories is non-trivial, and it is one of the main contributions of this paper.
Based on this development, we reach our key contributions: the notions of effectful state cover and effectful state characteriser that are used to construct the effectful W-method (§ 5 ). We derive the completeness of the effectful W-method from the general theory. Furthermore, we illustrate the effectful W-method by deriving complete test suites for non-deterministic automata and weighted automata over the ring Z \mathbb{Z} Z (§ 6 ).
We assume familiarity with basic category theory, such as categories, functors, natural transformations, limits, colimits, adjunctions, and monads. These notions are covered by standard textbooks (e.g. [43 , 3 , 8 , 54 ] ). We also rely heavily on symmetric monoidal closed categories and some further categorical notions, which are recalled in Appendix § 9 .
Automata in categories
We recall the basics of automata in a category (see e.g. [5 , 2 , 24 ] ). Throughout the paper, we fix a base category C C C , a functor F : C → C F \colon C \to C F : C → C , an initial state object I I I , and an output object O O O .
Definition 2.1. An F F F -automaton in C C C consists of a state space Q ∈ C Q \in C Q ∈ C , a transition morphism δ : F Q → Q \delta\colon FQ \to Q δ : F Q → Q , an input morphism i : I → Q i \colon I \to Q i : I → Q , and an output morphism o : Q → O o \colon Q \to O o : Q → O .
If the functor F F F is clear from context, we simply use the term automaton .
Example 2.2. Let C \mathcal{C} C be the category Set of sets and functions, let F F F be defined as F A : = A × Σ FA := A \times\Sigma F A := A × Σ for some finite alphabet Σ \Sigma Σ , let I I I be the singleton set 1 : = { ∗ } 1 := \{\ast\} 1 := { ∗ } , and let O O O be the two-element set 2 : = { 0 , 1 } 2 := \{0,1\} 2 := { 0 , 1 } . Then an F F F -automaton is given by a set of states Q Q Q , a transition function δ : Q × Σ → Q \delta: Q \times\Sigma\to Q δ : Q × Σ → Q , an initial state i : 1 → Q i : 1 \to Q i : 1 → Q , and an acceptance condition o : Q → 2 o : Q \to2 o : Q → 2 . Thus, an F F F -automaton with a finite state space is a deterministic finite automaton (DFA) [53 ] .
Example 2.3. The previous example can be generalised by replacing the base category Set with an arbitrary monoidal category ( C , ⊗ , 1 ) (\mathcal{C}, \otimes, 1) ( C , ⊗ , 1 ) (see Definition A.1 ). For such a category C \mathcal{C} C and any alphabet object Σ ∈ C \Sigma\in\mathcal{C} Σ ∈ C , we can set F A : = A ⊗ Σ FA := A \otimes\Sigma F A := A ⊗ Σ . Letting I : = 1 I := 1 I := 1 while leaving the output object O O O arbitrary, we obtain the notion of sequential automata as defined by Adámek and Trnková [2 ] , also called machines by Goguen [24 ] . This notion encompasses many instances such as weighted automata [56 ] , semilattice automata [49 ] , and nominal automata [12 ] .
The transition morphism of an F F F -automaton is an algebra for the functor F F F . In general, an F F F -algebra (or simply algebra ) is a pair ( A , a ) (A,a) ( A , a ) with A ∈ C A \in\mathcal{C} A ∈ C and a : F A → A a : FA \to A a : F A → A . An F F F -algebra homomorphism f : ( A , a ) → ( B , b ) f : (A,a) \to(B,b) f : ( A , a ) → ( B , b ) is a map f : A → B f : A \to B f : A → B such that f ∘ a = b ∘ F f f \circ a = b \circ Ff f ∘ a = b ∘ F f . Together, these form a category Alg ( F ) \operatorname{Alg}(F) Alg ( F ) . Moreover, the notion of algebra homomorphism extends to automata. A homomorphism of F F F -automata from ( Q 1 , δ 1 , i 1 , o 1 ) (Q_1,\delta_1,i_1,o_1) ( Q 1 , δ 1 , i 1 , o 1 ) to ( Q 2 , δ 2 , i 2 , o 2 ) (Q_2,\delta_2,i_2,o_2) ( Q 2 , δ 2 , i 2 , o 2 ) is an F F F -algebra map f : ( Q 1 , δ 1 ) → ( Q 2 , δ 2 ) f : (Q_1,\delta_1) \to(Q_2,\delta_2) f : ( Q 1 , δ 1 ) → ( Q 2 , δ 2 ) such that f ∘ i 1 = i 2 f \circ i_1 = i_2 f ∘ i 1 = i 2 and o 2 ∘ f = o 1 o_2 \circ f = o_1 o 2 ∘ f = o 1 . F F F -automata and their homomorphisms form a category Aut O ( F ) \operatorname{Aut}_{O}(F) Aut O ( F ) .
Given an object A ∈ C A \in\mathcal{C} A ∈ C , a free F F F -algebra over A A A consists of an object F ∗ A ∈ C F^{\ast}A \in\mathcal{C} F ∗ A ∈ C and morphisms ζ A : F F ∗ A → F ∗ A \zeta_A : FF^{\ast}A \to F^{\ast}A ζ A : F F ∗ A → F ∗ A and η A : A → F ∗ A \eta_A : A \to F^{\ast}A η A : A → F ∗ A such that for every B ∈ C B \in\mathcal{C} B ∈ C , b : F B → B b : FB \to B b : F B → B , and f : A → B f : A \to B f : A → B , there exists a unique F F F -algebra morphism f ~ : ( F ∗ A , ζ A ) → ( B , b ) \tilde{f} : (F^{\ast}A,\zeta_A) \to(B,b) f ~ : ( F ∗ A , ζ A ) → ( B , b ) with f ~ ∘ η A = f \tilde{f} \circ\eta_A = f f ~ ∘ η A = f . We refer to f ~ \tilde{f} f ~ as the free F F F -extension of f f f . For an algebra ( A , a ) (A,a) ( A , a ) , we write a ∗ a^{\ast} a ∗ for 1 A : ( F ∗ A , ζ A ) → ( A , a ) 1_A : (F^{\ast}A,\zeta_A) \to(A,a) 1 A : ( F ∗ A , ζ A ) → ( A , a ) . If free F F F -algebras exist over all objects of C \mathcal{C} C , we say that F F F is a varietor [2 ] . If C \mathcal{C} C has and F F F preserves colimits of ω \omega ω -chains, then F F F is a varietor [1 , 35 ] .
In the context of automata theory, F ∗ I F^{\ast}I F ∗ I generalises the set of words: it is an object describing all possible inputs to an automaton. This motivates the following definitions.
Definition 2.4. Let F F F be a varietor, and A = ( Q , δ , i , o ) \mathcal{A} = (Q,\delta,i,o) A = ( Q , δ , i , o ) an F F F -automaton.
A behaviour (or language) is a morphism F ∗ I → O F^{\ast}I \to O F ∗ I → O .
The reachability map r A : F ∗ I → Q r_{\mathcal{A}} : F^{\ast}I \to Q r A : F ∗ I → Q of A \mathcal{A} A is the free F F F -extension of the input morphism i i i .
The behaviour B A : F ∗ I → O B_{\mathcal{A}} : F^{\ast}I \to O B A : F ∗ I → O of A \mathcal{A} A is the composite F ∗ I → r A Q → o O F^{\ast}I \xrightarrow{r_{\mathcal{A}}} Q \xrightarrow{o} O F ∗ I r A Q o O .
Intuitively, the reachability map sends an input word to the state reached after processing that word. The behaviour, then, is defined by observing the output of the corresponding state.
Example 2.5. The functor F F F corresponding to DFAs (Example 2.2) is a varietor, and F ∗ 1 F^{\ast}1 F ∗ 1 is isomorphic to Σ ∗ \Sigma^{\ast} Σ ∗ , the set of words over Σ \Sigma Σ . Therefore, a behaviour Σ ∗ → 2 \Sigma^{\ast} \to2 Σ ∗ → 2 is precisely a language in the classical sense, i.e. a set of words.
The reachability and behaviour maps in Definition 2.4 instantiate to the standard notions in the case of DFAs. Recall that, for a given DFA ( Q , δ , q 0 , Γ ) (Q,\delta,q_0,\Gamma) ( Q , δ , q 0 , Γ ) , the generalised transition function δ ∗ : Q × Σ ∗ → Q \delta^{\ast} : Q \times\Sigma^{\ast} \to Q δ ∗ : Q × Σ ∗ → Q is defined inductively by δ ∗ ( q , ε ) : = q \delta^{\ast}(q,\varepsilon) := q δ ∗ ( q , ε ) := q and δ ∗ ( q , v a ) : = δ ( δ ∗ ( q , v ) , a ) \delta^{\ast}(q,va) := \delta(\delta^{\ast}(q,v),a) δ ∗ ( q , v a ) := δ ( δ ∗ ( q , v ) , a ) . Then the reachability map is r A ( v ) = δ ∗ ( q 0 , v ) r_{\mathcal{A}}(v) = \delta^{\ast}(q_0,v) r A ( v ) = δ ∗ ( q 0 , v ) , and the behaviour coincides with the usual accepted language of A \mathcal{A} A : B A ( v ) = 1 B_{\mathcal{A}}(v) = 1 B A ( v ) = 1 iff r A ( v ) ∈ Γ r_{\mathcal{A}}(v) \in\Gamma r A ( v ) ∈ Γ .
An important automata-theoretic notion that is missing from Definition 2.4 is the observability map . For a DFA ( Q , δ , q 0 , Γ ) (Q,\delta,q_0,\Gamma) ( Q , δ , q 0 , Γ ) , the observability map μ A : Q → 2 Σ ∗ \mu_{\mathcal{A}} : Q \to2^{\Sigma^{\ast}} μ A : Q → 2 Σ ∗ sends a state q ∈ Q q \in Q q ∈ Q to the accepted language of q q q , defined as L A ( q ) : = { v ∈ Σ ∗ ∣ δ ∗ ( q , v ) ∈ Γ } \mathcal{L}_{\mathcal{A}}(q) := \{v \in\Sigma^{\ast} \mid\delta^{\ast}(q,v) \in\Gamma\} L A ( q ) := { v ∈ Σ ∗ ∣ δ ∗ ( q , v ) ∈ Γ } .
To define this generally, we use a categorical analogue of the set of languages 2 Σ ∗ 2^{\Sigma^{\ast}} 2 Σ ∗ . We assume that our base category C \mathcal{C} C is monoidal closed (Definition A.1 ); we use the notation [ A , B ] [A,B] [ A , B ] for the internal hom. Then we may construct the object [ F ∗ 1 , O ] [F^*1,O] [ F ∗ 1 , O ] , thought of as the behaviour object , and define the observability map as a morphism Q → [ F ∗ 1 , O ] Q \to[F^*1,O] Q → [ F ∗ 1 , O ] . This approach to behaviours was introduced by Goguen [24 ] in the case of sequential automata (Example 2.3).
To be able to define the observability map this way for an arbitrary functor F F F , we need a left strength for F ∗ F^* F ∗ (see Definition A.2 ). If we assume, besides closedness, that C \mathcal{C} C is a symmetric monoidal category (Definition A.1 ), then any left strength σ \sigma σ for F F F induces a canonical left strength σ ∗ \sigma^* σ ∗ for F ∗ F^* F ∗ [44 Proposition 6.7] .
Definition 2.6. Suppose C \mathcal{C} C is symmetric monoidal closed and F F F is a varietor with left strength σ \sigma σ . Denote the induced strength for F ∗ F^* F ∗ by σ ∗ \sigma^* σ ∗ , and let A = ( Q , δ , i , o ) \mathcal{A}=(Q,\delta,i,o) A = ( Q , δ , i , o ) be an automaton.
The run map τ A \tau_{\mathcal{A}} τ A of A \mathcal{A} A is the composite Q ⊗ F ∗ 1 → σ Q , 1 ∗ F ∗ ( Q ⊗ 1 ) → F ∗ ρ Q F ∗ Q → δ ∗ Q Q \otimes F^*1 \xrightarrow{\sigma^*_{Q,1}} F^*(Q \otimes1) \xrightarrow{F^*\rho_Q} F^*Q \xrightarrow{\delta^*} Q Q ⊗ F ∗ 1 σ Q , 1 ∗ F ∗ ( Q ⊗ 1 ) F ∗ ρ Q F ∗ Q δ ∗ Q , where ρ \rho ρ is the right unitor of C \mathcal{C} C .
The observability map ℓ A : Q → [ F ∗ 1 , O ] \ell_{\mathcal{A}}:Q \to[F^*1,O] ℓ A : Q → [ F ∗ 1 , O ] of A \mathcal{A} A is the currying of Q ⊗ F ∗ 1 → τ A Q → o O Q \otimes F^*1 \xrightarrow{\tau_{\mathcal{A}}} Q \xrightarrow{o} O Q ⊗ F ∗ 1 τ A Q o O .
Generalised W-method
In this section, we present a categorical version of the W-method for F F F -automata, following closely the testing framework introduced in [39 ] . The categorical W-method and the proof of its completeness presented in op. cit. is a direct generalisation of the completeness proof in [45 ] (also the appendix of [40 ] ), which ultimately goes back to [61 , 16 ] . We first give an overview of the W-method for DFAs, then present our categorical generalisation.
Conformance testing aims to decide the equivalence of two automata, a known specification and a black-box implementation , by checking their behaviour on a well-chosen, finite set of inputs, called a test suite . The W-method [61 , 16 ] is a classical way to construct such test suites for deterministic finite (Mealy-)automata. It relies on two special sets of words: a state cover is used to reach all (reachable) states, and a characterisation set is used to distinguish all pairs of (inequivalent) states.
More precisely, given a specification DFA S = ( Q , δ , q 0 , Γ ) \mathcal{S}=(Q,\delta,q_0,\Gamma) S = ( Q , δ , q 0 , Γ ) over an alphabet Σ \Sigma Σ , a set of words C ⊆ Σ ∗ C \subseteq\Sigma^* C ⊆ Σ ∗ is a called a state cover for S \mathcal{S} S if ε ∈ C \varepsilon\in C ε ∈ C and for every reachable state q ∈ Q q \in Q q ∈ Q , there exists a word v ∈ C v \in C v ∈ C (called an access sequence for q q q ) such that δ ∗ ( q 0 , v ) = q \delta^*(q_0,v)=q δ ∗ ( q 0 , v ) = q . Moreover, a set of words W ⊆ Σ ∗ W \subseteq\Sigma^* W ⊆ Σ ∗ is called a characterisation set for S \mathcal{S} S if ε ∈ W \varepsilon\in W ε ∈ W and for any pair of states p , q ∈ Q p,q \in Q p , q ∈ Q with ℓ S ( p ) ≠ ℓ S ( q ) \ell_{\mathcal{S}}(p) \ne\ell_{\mathcal{S}}(q) ℓ S ( p ) = ℓ S ( q ) , there exists a word v ∈ W v \in W v ∈ W (called a distinguishing sequence for p p p and q q q ) such that δ ∗ ( p , v ) ∈ Γ \delta^*(p,v) \in\Gamma δ ∗ ( p , v ) ∈ Γ and δ ∗ ( q , v ) ∉ Γ \delta^*(q,v) \notin\Gamma δ ∗ ( q , v ) ∈ / Γ or vice versa.
Given such sets C C C and W W W and a natural number k k k , we define a test suite T = C ⋅ Σ ≤ k ⋅ W T=C \cdot\Sigma^{\leq k} \cdot W T = C ⋅ Σ ≤ k ⋅ W , where ⋅ \cdot ⋅ denotes the concatenation of languages and Σ ≤ k \Sigma^{\leq k} Σ ≤ k is the set of words of length at most k k k . That is, T T T is obtained by concatenating words from the state cover with words from the characterisation set, with at most k k k letters inserted in the middle. This test suite, which we call the W-suite , has the property that it is k k k -complete, meaning that for any inequivalent automaton with at most k k k more states than S \mathcal{S} S , we can find a test case v ∈ T v \in T v ∈ T that witnesses the difference (i.e. one accepts v v v and the other rejects it).
Example 3.1. Consider the automaton S \mathcal{S} S over the alphabet Σ = { a , b } \Sigma=\{a,b\} Σ = { a , b } , depicted in Figure 1 . In S \mathcal{S} S , the states q 0 q_0 q 0 , q 1 q_1 q 1 , q 2 q_2 q 2 , and q 3 q_3 q 3 are reached by the words ε \varepsilon ε , a a a , a b ab ab , and a a aa aa , respectively. Hence, C : = { ε , a , a a , a b } C:=\{\varepsilon,a,aa,ab\} C := { ε , a , aa , ab } is a state cover for S \mathcal{S} S . Furthermore, W : = { ε , a } W:=\{\varepsilon,a\} W := { ε , a } is a characterisation set for S : \mathcal{S}: S : the word ε \varepsilon ε distinguishes the rejecting states (q 0 q_0 q 0 and q 1 q_1 q 1 ) from the accepting states (q 2 q_2 q 2 and q 3 q_3 q 3 ), and the word a a a distinguishes both q 0 q_0 q 0 from q 1 q_1 q 1 and q 2 q_2 q 2 from q 3 q_3 q 3 .
The W-suite with k = 0 k=0 k = 0 is then given by T = C ⋅ ( { ε } ∪ Σ ) ⋅ W T=C\cdot(\{\varepsilon\}\cup\Sigma)\cdot W T = C ⋅ ({ ε } ∪ Σ ) ⋅ W . Performing the calculations, we see that T={\varepsilon,a,aa,aaa,aaaa,aab,aaba,ab,aba,abaa,abb,abba,b,ba}. Since the test
Figure 1. Deterministic automaton for the language L 1 = Σ ∗ a Σ L_1 = \Sigma^*a\Sigma L 1 = Σ ∗ a Σ with Σ = { a , b } \Sigma= \{a,b\} Σ = { a , b } .
suite T T T is 0-complete, every automaton with at most 4 states which agrees with S S S on the acceptance of the 14 words in T T T accepts exactly the language L 1 = Σ ∗ a Σ L_1 = \Sigma^*a\Sigma L 1 = Σ ∗ a Σ of S S S .
We now turn to the categorical generalisation of the W-method.
Assumption 3.2. Throughout this section, we assume that C \mathcal{C} C is a symmetric monoidal closed category with binary coproducts, that F F F is a strong functor, and that F F F is a varietor.
Categorically speaking, a subset of a set A A A corresponds to an equivalence class of monomorphisms (injective functions) with codomain A A A . To simplify the theory, we instead work with generalised elements , i.e. arbitrary morphisms into A A A . Intuitively, the subset represented by a morphism f : B → A f : B \to A f : B → A is the image im ( f ) ⊆ A \operatorname{im}(f) \subseteq A im ( f ) ⊆ A of f f f . In particular, collections of inputs, such as test suites, can be represented as morphisms into F ∗ I F^*I F ∗ I . Although finiteness of test suites is crucial for testing in practice, it is not required for the theory.
Definition 3.3. A test suite is a morphism in C \mathcal{C} C with codomain F ∗ I F^*I F ∗ I .
Let us fix a specification automaton S = ( S , δ S , i S , o S ) S = (S, \delta_S, i_S, o_S) S = ( S , δ S , i S , o S ) . An intuitive way to categorify state covers is as a morphism c : C → F ∗ I c : C \to F^*I c : C → F ∗ I such that r S ∘ c r_S \circ c r S ∘ c is an epimorphism. However, to prove completeness, we need an ‘internal’ way to assign states to access sequences. This suggests to demand that r S ∘ c r_S \circ c r S ∘ c be a split epi , i.e. that it have a right inverse S → C S \to C S → C . Unfortunately, as explained in [39 ] , this condition is too strong in many categories. Following op. cit. , we use an alternative definition that equips C C C with an algebra structure.
To state the definition, we need some notation. Given maps f f f , g g g with common codomain X X X , a morphism f → g f \to g f → g is a map h h h such that f = g ∘ h f = g \circ h f = g ∘ h (i.e. a map in the slice category C / X \mathcal{C}/X C / X ). Regarding f f f and g g g as subsets of X X X , such a morphism expresses that f f f is a subset of g g g . In particular, for DFAs (Example 2.2 ), where F ∗ I ≅ Σ ∗ F^*I \cong\Sigma^* F ∗ I ≅ Σ ∗ (Example 2.5 ), if c : A → F ∗ I c : A \to F^*I c : A → F ∗ I is thought of as a collection of words, then the existence of a map η I → c \eta_I \to c η I → c intuitively means that ‘c c c contains the empty word’.
Definition 3.4. A state cover for S S S is a morphism c : C → F ∗ I c : C \to F^*I c : C → F ∗ I together with maps δ C : F C → C \delta_C : FC \to C δ C : F C → C and i C : η I → c i_C : \eta_I \to c i C : η I → c such that r S ∘ c r_S \circ c r S ∘ c is an F F F -algebra morphism ( C , δ C ) → ( S , δ S ) (C,\delta_C) \to(S,\delta_S) ( C , δ C ) → ( S , δ S ) .
The condition that r S ∘ c r_S \circ c r S ∘ c be an algebra map is equivalent to the following commuting diagram:
F C → F c F F ∗ I → ζ I F ∗ I δ C ↓ ↓ r S C → c F ∗ I → r S S (1) \begin{CD}
FC @>{F c}>> FF^*I @>{\zeta_I}>> F^*I \\
@V{\delta_C}VV @. @VV{r_S}V \\
C @>{c}>> F^*I @>{r_S}>> S \tag*{(1)}
\end{CD} F C δ C ↓ ⏐ C F c c F F ∗ I F ∗ I ζ I r S F ∗ I ↓ ⏐ r S S (1)
The idea is that C C C is a set of representative access sequences for the reachable states of S S S , and δ C \delta_C δ C imitates the transition structure of S S S on C C C . For F : = ( − ) × Σ F := (-) \times\Sigma F := ( − ) × Σ , the intuitive reading of diagram (1) is the following: for each v ∈ C v \in C v ∈ C and s ∈ Σ s \in\Sigma s ∈ Σ , the word δ C ( v , s ) ∈ C \delta_C(v,s) \in C δ C ( v , s ) ∈ C is an access sequence for the state r S ( v s ) r_S(vs) r S ( v s ) . The map δ C \delta_C δ C is part of the structure because it is required to be a morphism in C C C . In general, there may be many such maps, but the choice does not matter as far as completeness is concerned. In Set, some δ C \delta_C δ C can always be defined if C C C is a state cover in the original sense of the word (cf. Proposition 5.2).
The condition for a set W ⊆ Σ ∗ W \subseteq\Sigma^* W ⊆ Σ ∗ containing ε \varepsilon ε to be a characterisation set can be stated in the following form: for all p , q ∈ S p,q \in S p , q ∈ S , ℓ S ( p ) ∩ W = ℓ S ( q ) ∩ W \ell_S(p) \cap W = \ell_S(q) \cap W ℓ S ( p ) ∩ W = ℓ S ( q ) ∩ W implies ℓ S ( p ) = ℓ S ( q ) \ell_S(p) = \ell_S(q) ℓ S ( p ) = ℓ S ( q ) . That is, if two states are equivalent on words in W W W , then they are equivalent on all words. The definition of abstract characterisation sets (which we call state characterisers) is obtained from this by replacing p , q ∈ S p,q \in S p , q ∈ S with generalised elements p , q : A → S p,q : A \to S p , q : A → S .
Definition 3.5. A state characteriser for S S S is a pair of maps w : W → F ∗ 1 w: W \to F^*1 w : W → F ∗ 1 and i W : η 1 → w i_W : \eta_1 \to w i W : η 1 → w s.t. for any p , q : A → S p,q : A \to S p , q : A → S , if S → ℓ S [ F ∗ 1 , O ] → [ w , 1 ] [ W , O ] S \xrightarrow{\ell_S} [F^*1,O] \xrightarrow{[w,1]} [W,O] S ℓ S [ F ∗ 1 , O ] [ w , 1 ] [ W , O ] equalises p p p and q q q , then so does ℓ S \ell_S ℓ S .
We often omit the δ C \delta_C δ C , i C i_C i C , and i W i_W i W components of state covers and state characterisers, in which case they are understood to be existentially quantified.
Before defining the W-suite, we introduce auxiliary operations related to concatenation. Intuitively, the map ξ \xi ξ below is a generalisation of word concatenation, the operation ⋅ \cdot ⋅ extends concatenation to sets of words, and a ↑ k a^{\uparrow k} a ↑ k consists of words that are obtained by appending an arbitrary sequence of at most k k k letters to the end of some word in a a a .
Definition 3.6. The morphism ξ : F ∗ I ⊗ F ∗ 1 → F ∗ I \xi: F^*I \otimes F^*1 \to F^*I ξ : F ∗ I ⊗ F ∗ 1 → F ∗ I is defined as the composite
F ∗ I ⊗ F ∗ 1 → δ F ∗ I , 1 F ∗ ( F ∗ I ⊗ 1 ) → F ∗ ρ F ∗ I F ∗ F ∗ I → ζ I F ∗ I . F^*I \otimes F^*1 \xrightarrow{\delta_{F^*I,1}} F^*(F^*I \otimes1) \xrightarrow{F^* \rho_{F^*I}} F^*F^*I \xrightarrow{\zeta_I} F^*I. F ∗ I ⊗ F ∗ 1 δ F ∗ I , 1 F ∗ ( F ∗ I ⊗ 1 ) F ∗ ρ F ∗ I F ∗ F ∗ I ζ I F ∗ I . Given a : A → F ∗ I a: A \to F^*I a : A → F ∗ I and b : B → F ∗ 1 b : B \to F^*1 b : B → F ∗ 1 , we define the map a ⋅ b : A ⊗ B → F ∗ I a \cdot b : A \otimes B \to F^*I a ⋅ b : A ⊗ B → F ∗ I as ξ ∘ ( a ⊗ b ) \xi\circ(a \otimes b) ξ ∘ ( a ⊗ b ) .
Given a : A → F ∗ I a: A \to F^*I a : A → F ∗ I , we define the map a ↑ : A + F A → F ∗ I a^\uparrow: A + FA \to F^*I a ↑ : A + F A → F ∗ I as [ a , ζ I ∘ F a ] [a,\zeta_I \circ Fa] [ a , ζ I ∘ F a ] . Furthermore, we write ( − ) ↑ k (-)^{\uparrow k} ( − ) ↑ k for the k k k -fold iteration of ( − ) ↑ (-)^\uparrow ( − ) ↑ and denote the domain of a ↑ k a^{\uparrow k} a ↑ k by A ↑ k A^{\uparrow k} A ↑ k .
The W-suite can now be constructed by concatenating words from the state cover with words from the state characteriser, with at most k k k arbitrary letters inserted in between.
Definition 3.7. Given a state cover c c c for S S S , a state characteriser w w w for S S S , and a natural number k k k , we define the W-suite as c ↑ k + 1 ⋅ w c^{\uparrow k+1} \cdot w c ↑ k + 1 ⋅ w .
Test coverage may be expressed using a collection of automata called a fault domain . A test suite is then called complete if for any inequivalent implementation from the given fault domain, we can find a failing test case witnessing the error. This is formally expressed as follows, using the behaviour maps B S B_S B S and B M B_M B M from Definition 2.4.
Definition 3.8. A fault domain is a class of automata, i.e. a subclass of Ob ( Aut I O ( F ) ) \operatorname{Ob}(\operatorname{Aut}_I^O(F)) Ob ( Aut I O ( F )) .
Let t t t be a test suite and let U \mathcal{U} U be a fault domain. We say that t t t is complete for S S S w.r.t. U \mathcal{U} U if for all M ∈ U \mathcal{M} \in\mathcal{U} M ∈ U , B S ∘ t = B M ∘ t B_S \circ t = B_M \circ t B S ∘ t = B M ∘ t implies B S = B M B_S = B_M B S = B M .
The fault domain corresponding to k k k -completeness for DFAs is U k = { M ∣ ∣ M ∣ ≤ ∣ S ∣ + k } \mathcal{U}_k = \{\mathcal{M} \mid|\mathcal{M}| \le|S| + k\} U k = { M ∣ ∣ M ∣ ≤ ∣ S ∣ + k } , where ∣ A ∣ |A| ∣ A ∣ denotes the number of states of A A A . We instead consider the fault domain U c k \mathcal{U}_c^k U c k that, intuitively, consists of those automata each of whose states can be reached by a word from c c c followed by at most k k k letters. In the case of Mealy machines, completeness with respect to a similar fault domain has been studied by Vaandrager and Melse [60 ] (see also [42 ] ).
Definition 3.9. Let c : C → F ∗ I c: C \to F^*I c : C → F ∗ I and let k ∈ N k \in\mathbb{N} k ∈ N . The fault domain U c k \mathcal{U}_c^k U c k is defined as U c k : = { M ∈ Aut I O ( F ) ∣ c ↑ k \mathcal{U}_c^k := \{\mathcal{M} \in\operatorname{Aut}_I^O(F) \mid c^{\uparrow k} U c k := { M ∈ Aut I O ( F ) ∣ c ↑ k is a state cover for M } \mathcal{M}\} M } .
The theorem below states the completeness of the W-method. An automaton A \mathcal{A} A is called observable if ℓ A \ell_\mathcal{A} ℓ A is a monomorphism. Observability is a sort of minimality condition: it means all states have different behaviour.
Theorem 3.10. Let c c c be a state cover for S S S , let w w w be a state characteriser for S S S , let k ∈ N k \in\mathbb{N} k ∈ N , and suppose S S S is observable. Then the W-suite c ↑ k + 1 ⋅ w c^{\uparrow k+1} \cdot w c ↑ k + 1 ⋅ w is complete for S S S w.r.t. U c k U_c^k U c k .
Instantiating the theory to DFAs, we recover the original W-method.
Example 3.11. The setting of deterministic automata (Example 2.2 ) satisfies Assumption 3.2: the category S e t \mathbf{Set} Set is complete and Cartesian closed. Since F = ( − ) × Σ F = (-) \times\Sigma F = ( − ) × Σ preserves colimits, it is a varietor (§ 2 ). The strength σ \sigma σ is given by σ A , B ( a , ( b , s ) ) = ( ( a , b ) , s ) \sigma_{A,B}(a,(b,s)) = ((a,b),s) σ A , B ( a , ( b , s )) = (( a , b ) , s ) .
As explained above, the notions of state cover and state characteriser reduce to the classical notions for DFAs (after taking images). In particular, given a (traditional) state cover C C C , we can define δ C ( v , s ) \delta_C(v,s) δ C ( v , s ) simply by choosing any u ∈ C u \in C u ∈ C satisfying δ ∗ ( q 0 , u ) = δ ∗ ( q 0 , v s ) \delta^*(q_0,u) = \delta^*(q_0,vs) δ ∗ ( q 0 , u ) = δ ∗ ( q 0 , v s ) .
Returning to the automaton S S S in Figure 1 , we have the state cover C C C and the state characteriser W W W constructed in Example 3.1 . The maps c c c and w w w are simply the inclusions into Σ ∗ \Sigma^* Σ ∗ . Instantiating Definition 3.7 with k = 0 k = 0 k = 0 , the W-suite is then t = c ↑ ⋅ w t = c^\uparrow\cdot w t = c ↑ ⋅ w . Concretely, we have T = ( C + F C ) × W ≅ C × ( { ε } ∪ Σ ) × W T = (C +_F C) \times W \cong C \times(\{\varepsilon\} \cup\Sigma) \times W T = ( C + F C ) × W ≅ C × ({ ε } ∪ Σ ) × W , and t : T → Σ ∗ t:T \to\Sigma^* t : T → Σ ∗ is given by t ( u , a , v ) = u a v t(u,a,v) = uav t ( u , a , v ) = u a v . The corresponding set of words im ( t ) \operatorname{im}(t) im ( t ) is precisely the set T T T from Example 3.1 .
Completeness of the test suite t t t now follows from Theorem 3.10 . Note that compared to Example 3.1 , where we used k k k -completeness, the fault domain U c 0 U_c^0 U c 0 in this case is different: it consists of automata for which C C C is a state cover, which does not include all automata with at most 4 states. However, as k k k increases, U c k U_c^k U c k can contain DFAs with exponentially more states than S S S . (See [60 ] for a comparison.)
Effectful automata
The automaton model defined in § 2 is an abstraction of deterministic automata. However, as observed by Arbib and Manes [6 ] , it also covers instances such as non-deterministic, weighted, or stochastic automata if we choose appropriate Kleisli categories as base categories. Towards developing a theory of conformance testing covering such examples, we therefore consider automata in Kleisli categories of commutative monads, and refer to these as effectful .
We wish to apply the abstract framework from § 3 to effectful automata. Unfortunately, Kleisli categories in general are not closed, so they do not satisfy Assumption 3.2, preventing us to construct the W-suite (Definition 3.7 ) and apply the associated completeness result (Theorem 3.10 ) directly. We therefore move from the Kleisli category to the richer Eilenberg-Moore category (as in [6 ] ), which is monoidal closed under certain conditions [57 ] . Thus, automata in the Kleisli category provide a ‘syntactic’ presentation, whereas the actual computations happen in the Eilenberg-Moore category.
This section aims to provide the technical apparatus for studying conformance testing of effectful automata in this way. We first illustrate our high-level approach in § 4.1 . Then, in § 4.2 , we describe the technical ingredients precisely and verify that the assumptions of the testing framework (Assumption 3.2) hold in the Eilenberg-Moore category.
Overview: automata in Kleisli and Eilenberg-Moore categories
Let T T T be a monad describing an effect type, and consider the left triangle in the diagram below:
F K l ↺ K l ( T ) → K E M ( T ) ↻ F E M ↖ E ↑ V ↗ S C ↺ F F ‾ I T O ( F ) ↗ E ‾ ↑ V ‾ ↘ S ‾ Aut I F K l → K ‾ Aut S I F E M (2) \begin{array}{cc}
\begin{array}{ccccc}
F_{\mathrm{Kl}} & \circlearrowleft& \mathrm{Kl}(T) & \xrightarrow{K} & \mathrm{EM}(T) & \circlearrowright F_{\mathrm{EM}} \\
& \nwarrow^{E} & \uparrow^{V} & \nearrow^{S} & & \\
& & C & \circlearrowleft^{F} & &
\end{array}
&
\begin{array}{ccccc}
\overline{F}_{I}^{TO}(F) & & \\
\nearrow_{\overline{E}} & \uparrow^{\overline{V}} & \searrow^{\overline{S}} \\
\operatorname{Aut}_{I}^{F_{\mathrm{Kl}}} & \xrightarrow{\overline{K}} & \operatorname{Aut}_{SI}^{F_{\mathrm{EM}}}
\end{array} \tag*{(2)}
\end{array} F Kl ↺ ↖ E Kl ( T ) ↑ V C K ↗ S ↺ F EM ( T ) ↻ F EM F I T O ( F ) ↗ E Aut I F Kl ↑ V K ↘ S Aut S I F EM (2)
Here, E ⊣ V E \dashv V E ⊣ V is the Kleisli adjunction, S ⊣ U S \dashv U S ⊣ U is the Eilenberg–Moore adjunction, and K K K is the comparison functor that exhibits K l ( T ) \mathrm{Kl}(T) Kl ( T ) as the full subcategory of free algebras in E M ( T ) \mathrm{EM}(T) EM ( T ) . Our idea is to start with a base functor F : C → C F \colon C \to C F : C → C that describes the transition structure of ‘plain’, non-effectful automata, and then ‘extend’ it to functors F K l : K l ( T ) → K l ( T ) F_{\mathrm{Kl}} \colon\mathrm{Kl}(T) \to\mathrm{Kl}(T) F Kl : Kl ( T ) → Kl ( T ) and F E M : E M ( T ) → E M ( T ) F_{\mathrm{EM}} \colon\mathrm{EM}(T) \to\mathrm{EM}(T) F EM : EM ( T ) → EM ( T ) that commute with the left adjoints. The functors F K l F_{\mathrm{Kl}} F Kl and F E M F_{\mathrm{EM}} F EM can then be used for modelling effectful generalisations of F F F -automata. (This idea for Kleisli categories occurred already in [6 ] and also in [27 ] .)
These constructions can be lifted to the respective categories of automata, obtaining the triangle on the right of (2) . Here, the functors that are overlined are induced by the respective functors in the first diagram. In particular, the functors E ‾ \overline{E} E and S ‾ \overline{S} S are embeddings from non-effectful automata into effectful ones, and the functor K ‾ \overline{K} K provides a generalised determinisation construction that also endows the automaton with algebraic structure, similar to coalgebraic determinisation [32 ] .
Example 4.1. We recall the notion of a non-deterministic finite automaton (NFA) [53 ] to be used as a running example. Fixing some finite alphabet Σ \Sigma Σ , an NFA consists of a finite set Q Q Q of states, a transition function δ : Q × Σ → P f Q \delta\colon Q \times\Sigma\to\mathcal{P}_{\mathrm{f}}Q δ : Q × Σ → P f Q , a set Q 0 ⊆ Q Q_0 \subseteq Q Q 0 ⊆ Q of initial states , and a set Γ ⊆ Q \Gamma\subseteq Q Γ ⊆ Q of accepting states . In the next section, we will show that this data is exactly captured by an object of A u t I O ( F K l ) \mathrm{Aut}^{O}_{I}(F_{\mathrm{Kl}}) Aut I O ( F Kl ) for suitable choices of F K l F_{\mathrm{Kl}} F Kl , I I I , and O O O . For the effect T T T , we take the (finite) powerset monad, which is generally associated with non-determinism. Then F E M F_{\mathrm{EM}} F EM -automata will turn out to be equivalent to JSL-automata [49 ] , and the functor K ‾ \overline{K} K will coincide with the determinisation of NFAs via the powerset construction.
From deterministic to effectful automata
In the remainder of the section, we give the necessary technical ingredients for carrying out the idea outlined above. The main goal is to verify the assumptions of the testing theory of § 3 for automata in E M ( T ) \mathrm{EM}(T) EM ( T ) (Theorem 4.15 ). To achieve this, we make stronger assumptions on the base category compared to those in Assumption 3.2, which are however sufficient for the purposes of the present paper.
Assumption 4.2. For the rest of the section, we assume that C C C is a complete and cocomplete symmetric monoidal closed category, and that F F F is strong and preserves colimits of ω \omega ω -chains.
Throughout this section, we fix a monad ( T , μ , η T ) (T, \mu, \eta^{T}) ( T , μ , η T ) and use the notation introduced in diagram (2) for the associated categories and functors. To make E M ( T ) \mathrm{EM}(T) EM ( T ) symmetric monoidal closed, we need to assume that T T T is a commutative monad (Definition A.3); we denote its structure map by θ A , B : T A ⊗ T B → T ( A ⊗ B ) \theta_{A,B} \colon TA \otimes TB \to T(A \otimes B) θ A , B : T A ⊗ T B → T ( A ⊗ B ) . Moreover, we need some additional technical assumptions on T T T to guarantee the existence of colimits and free algebras in E M ( T ) \mathrm{EM}(T) EM ( T ) .
Assumption 4.3. We assume that the monad T T T is commutative, that E M ( T ) \mathrm{EM}(T) EM ( T ) has reflexive coequalisers, and that T T T preserves colimits of ω \omega ω -chains.
We first consider the problem of extending F F F to K l ( T ) \mathrm{Kl}(T) Kl ( T ) . As discussed above, we need a functor F K l : K l ( T ) → K l ( T ) F_{\mathrm{Kl}} \colon\mathrm{Kl}(T) \to\mathrm{Kl}(T) F Kl : Kl ( T ) → Kl ( T ) such that F K l F_{\mathrm{Kl}} F Kl -automata are effectful generalisations of F F F -automata. This can be achieved by demanding that F F F and F K l F_{\mathrm{Kl}} F Kl commute with the embedding E E E of C C C into the Kleisli category K l ( T ) \mathrm{Kl}(T) Kl ( T ) , that is, F K l E = E F F_{\mathrm{Kl}}E = EF F Kl E = E F . We call an F K l F_{\mathrm{Kl}} F Kl satisfying this equation a Kleisli extension of F F F . Kleisli extensions are easily obtained using distributive laws (also called K \mathcal{K} K -laws in [32 ] ; see Definition A.4).
Theorem 4.4 ([6 , 46 ] ). There is a bijective correspondence between Kleisli extensions of F F F and distributive laws γ : F T → T F \gamma\colon FT \to TF γ : F T → T F of F F F over T T T . Given γ \gamma γ , the Kleisli extension F K l F_{\mathrm{Kl}} F Kl is defined as F K l A : = F A F_{\mathrm{Kl}}A := FA F Kl A := F A for A ∈ C A \in C A ∈ C and F K l f : = γ B ∘ F f F_{\mathrm{Kl}}f := \gamma_{B} \circ Ff F Kl f := γ B ∘ F f for f : A → B f \colon A \to B f : A → B .
Assumption 4.5. We assume a distributive law γ : F T → T F \gamma: FT \to TF γ : F T → T F of F F F over T T T , inducing a Kleisli extension F K l : K l ( T ) → K l ( T ) F_{\mathrm{Kl}}: \mathrm{Kl}(T) \to\mathrm{Kl}(T) F Kl : Kl ( T ) → Kl ( T ) of F F F .
Thus, Aut O ( F K l ) \operatorname{Aut}_{O}(F_{\mathrm{Kl}}) Aut O ( F Kl ) is the category of effectful automata. An F K l F_{\mathrm{Kl}} F Kl -automaton is like an ordinary F F F -automaton, but whose transition map returns T T T -structured collections of states.
Example 4.6 (continuing Example 4.1). The finitary powerset monad P f \mathcal{P}_{f} P f is defined on sets as P f A : = { X ⊆ A ∣ X is finite } \mathcal{P}_{f}A := \{X \subseteq A \mid X \text{ is finite}\} P f A := { X ⊆ A ∣ X is finite } . The unit is given by a ↦ { a } a \mapsto\{a\} a ↦ { a } and the multiplication by X ↦ ⋃ X ∈ X X \mathcal{X} \mapsto\bigcup_{X \in\mathcal{X}} X X ↦ ⋃ X ∈ X X . The Kleisli category K l ( P f ) \mathrm{Kl}(\mathcal{P}_{f}) Kl ( P f ) models finitely branching non-determinism: a Kleisli map A → B A \to B A → B maps an input in A A A to a finite set of possible outputs in B B B .
Since NFAs are the non-deterministic extension of DFAs, we continue Example 2.2 and add the monad P f \mathcal{P}_{f} P f . We set C : = S e t \mathcal{C} := \mathbf{Set} C := Set , F A : = A × Σ FA := A \times\Sigma F A := A × Σ for some finite alphabet Σ \Sigma Σ , T : = P f T := \mathcal{P}_{f} T := P f , and I : = 1 I := 1 I := 1 . However, instead of 2 2 2 , we take O : = 1 O := 1 O := 1 (since P f 1 ≅ 2 \mathcal{P}_{f}1 \cong2 P f 1 ≅ 2 ). The argument given in Example 3.11, combined with the completeness of S e t \mathbf{Set} Set , shows that Assumption 4.2 holds in this example. Assumption 4.3 is also satisfied: commutativity is shown by the maps θ A , B : P f A × P f B → P f ( A × B ) \theta_{A,B}: \mathcal{P}_{f}A \times\mathcal{P}_{f}B \to\mathcal{P}_{f}(A \times B) θ A , B : P f A × P f B → P f ( A × B ) given by ( X , Y ) ↦ X × Y (X,Y) \mapsto X \times Y ( X , Y ) ↦ X × Y . Lastly, for Assumption 4.5, we use the distributive law γ A : P f A × Σ → P f ( A × Σ ) \gamma_{A}: \mathcal{P}_{f}A \times\Sigma\to\mathcal{P}_{f}(A \times\Sigma) γ A : P f A × Σ → P f ( A × Σ ) given by ( X , a ) ↦ X × { a } (X,a) \mapsto X \times\{a\} ( X , a ) ↦ X × { a } (as in [6 , 25 ] ).
Hence, we obtain a Kleisli extension F K l F_{\mathrm{Kl}} F Kl with F K l A = A × Σ F_{\mathrm{Kl}}A = A \times\Sigma F Kl A = A × Σ . Spelling out Definition 2.1, we get that a finite F K l F_{\mathrm{Kl}} F Kl -automaton consists of: a finite set Q Q Q of states; a non-deterministic transition function δ : Q × Σ → Q \delta: Q \times\Sigma\to Q δ : Q × Σ → Q ; a function i : 1 → Q i: 1 \to Q i : 1 → Q , corresponding to a set i ( ∗ ) i(*) i ( ∗ ) of initial states; and a function o : Q → 1 o: Q \to1 o : Q → 1 , corresponding to a set o − 1 ( 1 ) o^{-1}(1) o − 1 ( 1 ) of accepting states. Thus, we see that finite F K l F_{\mathrm{Kl}} F Kl -automata are equivalent to NFAs as defined in Example 4.1.
Similarly to the Kleisli extension, we would also like some sort of extension of F F F to E M ( T ) \mathbf{EM}(T) EM ( T ) . Since the objects of E M ( T ) \mathbf{EM}(T) EM ( T ) are not (necessarily) in bijection with those of C \mathcal{C} C , it is unrealistic to expect a strict extension, i.e. one that commutes with S S S up to equality. Instead, we are after a functor F E M : E M ( T ) → E M ( T ) F_{\mathrm{EM}}: \mathbf{EM}(T) \to\mathbf{EM}(T) F EM : EM ( T ) → EM ( T ) such that there is a natural isomorphism F E M S → ≅ S F F_{\mathrm{EM}}S \xrightarrow{\cong} SF F EM S ≅ S F . We call such an F E M F_{\mathrm{EM}} F EM an Eilenberg-Moore extension of F F F .
Mulry [47 ] provided a sufficient condition for the existence of Eilenberg-Moore extensions. Below, in Theorem 4.7, we recall this result and extend it with a uniqueness argument. For this, we use that any T T T -algebra ( A , a ) (A,a) ( A , a ) arises as the coequaliser S T A ⇉ μ A S a S A → a ( A , a ) STA \underset{Sa}{\overset{\mu_A}{\rightrightarrows}} SA \xrightarrow{a} (A,a) S T A S a ⇉ μ A S A a ( A , a ) , called the canonical presentation of ( A , a ) (A,a) ( A , a ) [43 ] .
Theorem 4.7. Given a distributive law γ : F T → T F \gamma: FT \to TF γ : F T → T F of F F F over T T T , there exist a functor F E M : E M ( T ) → E M ( T ) F_{\mathrm{EM}}: \mathbf{EM}(T) \to\mathbf{EM}(T) F EM : EM ( T ) → EM ( T ) and a natural isomorphism φ : F E M S → ≅ S F \varphi: F_{\mathrm{EM}}S \xrightarrow{\cong} SF φ : F EM S ≅ S F such that
(1) F E M F_{\mathrm{EM}} F EM preserves canonical presentations, and
(2) the following diagram commutes:
F E M S T → φ T S F T → S γ S T F ↓ F E M μ ↓ μ F F E M S → φ S F (3) \begin{array}{ccccc}
F_{\mathrm{EM}}ST & \xrightarrow{\varphi T} & SFT & \xrightarrow{S\gamma} & STF \\
\downarrow{F_{\mathrm{EM}}\mu} & & & & \downarrow{\mu F} \\
F_{\mathrm{EM}}S & \xrightarrow{\varphi} & SF \tag*{(3)}
\end{array} F EM S T ↓ F EM μ F EM S φT φ S F T S F S γ S T F ↓ μ F (3) Further , for any functor F E M ′ : E M ( T ) → E M ( T ) F'_{\mathrm{EM}}: \mathbf{EM}(T) \to\mathbf{EM}(T) F EM ′ : EM ( T ) → EM ( T ) preserving canonical presentations and any natural isomorphism φ ′ : F E M ′ S → ≅ S F \varphi': F'_{\mathrm{EM}}S \xrightarrow{\cong} SF φ ′ : F EM ′ S ≅ S F making (3) commute, there is a unique natural transformation ι : F E M ′ → F E M \iota: F'_{\mathrm{EM}} \to F_{\mathrm{EM}} ι : F EM ′ → F EM with φ ∘ ι S = φ ′ \varphi\circ\iota S = \varphi' φ ∘ ι S = φ ′ , and this ι \iota ι is a natural isomorphism.
Since we already assumed a distributive law γ \gamma γ , we can apply Theorem 4.7 to obtain a functor F E M : E M ( T ) → E M ( T ) F_{\mathrm{EM}}: \mathbf{EM}(T) \to\mathbf{EM}(T) F EM : EM ( T ) → EM ( T ) and a natural isomorphism φ : F E M S → ≅ S F \varphi: F_{\mathrm{EM}}S \xrightarrow{\cong} SF φ : F EM S ≅ S F as above. Then F E M F_{\mathrm{EM}} F EM -automata can be seen as algebraic versions of F F F -automata whose state spaces are equipped with algebraic structure preserved by the transition maps.
Example 4.8 (continuing Example 4.6). We describe the Eilenberg-Moore extension F E M F_{\mathrm{EM}} F EM in the case of NFAs. An algebra for P f P_{\mathrm{f}} P f is precisely a join-semilattice (JSL), i.e. a set A A A equipped with an associative, commutative, and idempotent binary operation ∨ : A × A → A \vee:A \times A \to A ∨ : A × A → A and a unit 0 ∈ A 0 \in A 0 ∈ A for ∨ \vee ∨ . A JSL-homomorphism is a function that preserves ∨ \vee ∨ and 0 0 0 .
The direct sum A ⊕ B A \oplus B A ⊕ B of JSLs A A A and B B B is the Cartesian product A × B A \times B A × B equipped with pointwise join and unit operations. It is the categorical coproduct in the category of join-semilattices and their homomorphisms. The Eilenberg-Moore extension F E M F_{\mathrm{EM}} F EM can then be written as F E M A = ⨁ s ∈ Σ A = A ⊕ ⋯ ⊕ A F_{\mathrm{EM}}A = \bigoplus_{s \in\Sigma} A = A \oplus\cdots\oplus A F EM A = ⨁ s ∈ Σ A = A ⊕ ⋯ ⊕ A . We write κ s : A → ⨁ s ∈ Σ A \kappa_s : A \to\bigoplus_{s \in\Sigma} A κ s : A → ⨁ s ∈ Σ A for the coprojection corresponding to the component at s ∈ Σ s \in\Sigma s ∈ Σ . Moreover, the map φ A : ⨁ s ∈ Σ P f A → P f ( A × Σ ) \varphi_A : \bigoplus_{s \in\Sigma} P_{\mathrm{f}}A \to P_{\mathrm{f}}(A \times\Sigma) φ A : ⨁ s ∈ Σ P f A → P f ( A × Σ ) is the cotupling of the maps φ A , s : P f A → P f ( A × Σ ) \varphi_{A,s} : P_{\mathrm{f}}A \to P_{\mathrm{f}}(A \times\Sigma) φ A , s : P f A → P f ( A × Σ ) given by φ A , s ( X ) = X × { s } \varphi_{A,s}(X) = X \times\{s\} φ A , s ( X ) = X × { s } , and its inverse φ A − 1 \varphi_A^{-1} φ A − 1 sends a set X ⊆ A × Σ X \subseteq A \times\Sigma X ⊆ A × Σ to the tuple ( X s ) s ∈ Σ (X_s)_{s \in\Sigma} ( X s ) s ∈ Σ where X s = { a ∈ A ∣ ( a , s ) ∈ X } X_s = \{a \in A \mid(a,s) \in X\} X s = { a ∈ A ∣ ( a , s ) ∈ X } .
Spelling out Definition 2.1 with I : = O : = P f 1 ≅ 2 I := O := P_{\mathrm{f}}1 \cong2 I := O := P f 1 ≅ 2 (ordered by 0 < 1 0 < 1 0 < 1 ), an F E M F_{\mathrm{EM}} F EM -automaton is given by: a join-semilattice Q Q Q ; a JSL-homomorphism δ : ⨁ s ∈ Σ Q → Q \delta: \bigoplus_{s \in\Sigma} Q \to Q δ : ⨁ s ∈ Σ Q → Q , corresponding to a family of JSL-homomorphisms δ s = δ ∘ κ s : Q → Q \delta_s = \delta\circ\kappa_s : Q \to Q δ s = δ ∘ κ s : Q → Q for s ∈ Σ s \in\Sigma s ∈ Σ ; a JSL-homomorphism i : 2 → Q i : 2 \to Q i : 2 → Q , corresponding to an initial state q 0 = i ( 1 ) ∈ Q q_0 = i(1) \in Q q 0 = i ( 1 ) ∈ Q ; and a JSL-homomorphism o : Q → 2 o : Q \to2 o : Q → 2 , corresponding to a set Γ = o − 1 ( 1 ) ⊆ Q \Gamma= o^{-1}(1) \subseteq Q Γ = o − 1 ( 1 ) ⊆ Q of accepting states satisfying 0 ∉ Γ 0 \notin\Gamma 0 ∈ / Γ and p ∨ q ∈ Γ p \vee q \in\Gamma p ∨ q ∈ Γ iff p ∈ Γ p \in\Gamma p ∈ Γ or q ∈ Γ q \in\Gamma q ∈ Γ . Thus, F E M F_{\mathrm{EM}} F EM -automata are equivalent to JSL-automata [49 ] .
The following lemma expresses that the family φ A \varphi_A φ A is also natural w.r.t. Kleisli maps.
Lemma 4.10. The family φ \varphi φ extends to a natural isomorphism φ K l : F E M K ≅ K F K l \varphi_{\mathrm{Kl}} : F_{\mathrm{EM}}^{\mathrm{K}} \cong K F_{\mathrm{Kl}} φ Kl : F EM K ≅ K F Kl .
Putting everything so far together, we are now in the situation on the left of diagram (2) . The next step is to lift all these functors and adjunctions to the respective categories of automata. Hermida and Jacobs [31 Theorem 2.14] showed how to lift adjunctions to categories of algebras. A straightforward adaptation of their proof to include initial state and output morphisms gives us the adjunctions in the right triangle of diagram (2) .
Theorem 4.11. The triangle on the left in (2) lifts to the triangle on the right in (2) .
Here, the adjunction E ‾ ⊣ V ‾ \overline{E} \dashv\overline{V} E ⊣ V is induced by the identity natural transformation on F K l E = E F F_{\mathrm{Kl}}E = EF F Kl E = E F , the adjunction S ‾ ⊣ U ‾ \overline{S} \dashv\overline{U} S ⊣ U is induced by φ \varphi φ , and the functor K ‾ \overline{K} K is induced by φ K l \varphi_{\mathrm{Kl}} φ Kl from Lemma 4.10.
Intuitively, the map E ‾ \overline{E} E turns a plain automaton into an effectful automaton without any real effects. It is analogous to how every DFA is also an NFA. Conversely, the map V ‾ \overline{V} V provides a generalisation of the usual powerset construction for NFAs: it turns an effectful automaton with state space Q Q Q into an equivalent plain automaton with state space T Q TQ T Q . The map K ‾ \overline{K} K acts like V ‾ \overline{V} V , but it additionally endows the resulting automaton with algebraic structure. Finally, S ‾ \overline{S} S is simply the composition K ‾ ∘ E ‾ \overline{K} \circ\overline{E} K ∘ E , and the map U ‾ \overline{U} U forgets the T T T -algebra structure.
Example 4.12 (continuing Example 4.8). Using the definitions given so far, we see that in our running example, K ‾ \overline{K} K sends an NFA A = ( Q , δ , i , o ) \mathcal{A} = (Q,\delta,i,o) A = ( Q , δ , i , o ) to the JSL-automaton ( P f Q , δ ‾ , K i , K o ) (P_{\mathrm{f}}Q,\overline{\delta},K i,K o) ( P f Q , δ , K i , K o ) , where δ ‾ s : = δ ‾ ∘ κ s \overline{\delta}_s := \overline{\delta} \circ\kappa_s δ s := δ ∘ κ s is the composite P f Q → P f ( Q × Σ ) P f Q P_{\mathrm{f}}Q \xrightarrow{P_{\mathrm{f}}(Q \times\Sigma)} P_{\mathrm{f}}Q P f Q P f ( Q × Σ ) P f Q . Unfolding definitions, we get that δ ‾ s \overline{\delta}_s δ s is given by δ ‾ s ( X ) = ⋃ q ∈ X δ ( q , s ) \overline{\delta}_s(X) = \bigcup_{q \in X} \delta(q,s) δ s ( X ) = ⋃ q ∈ X δ ( q , s ) . Moreover, identifying i i i and o o o with sets of states Q 0 Q_0 Q 0 and Γ \Gamma Γ , respectively, K i : 2 → P f Q K i : 2 \to P_{\mathrm{f}}Q K i : 2 → P f Q corresponds to the state ( K i ) ( 1 ) = Q 0 (K i)(1) = Q_0 ( K i ) ( 1 ) = Q 0 of K ‾ A \overline{K}\mathcal{A} K A , and K o : P f Q → 2 K o : P_{\mathrm{f}}Q \to2 K o : P f Q → 2 corresponds to the set Γ ‾ : = ( K o ) − 1 ( 1 ) = { X ∈ P f Q ∣ X ∩ Γ ≠ ∅ } \overline{\Gamma} := (K o)^{-1}(1) = \{X \in P_{\mathrm{f}}Q \mid X \cap\Gamma\ne\varnothing\} Γ := ( K o ) − 1 ( 1 ) = { X ∈ P f Q ∣ X ∩ Γ = ∅ } . Hence, the automaton K ‾ A \overline{K}\mathcal{A} K A is precisely the determinisation of the NFA A \mathcal{A} A in the classical sense [53 ] .
As our final step, we need to extend the given strength σ \sigma σ for F F F to F E M F_{\mathrm{EM}} F EM . Since F E M F_{\mathrm{EM}} F EM is defined in terms of the distributive law γ \gamma γ , and the monoidal structure on EM ( T ) \operatorname{EM}(T) EM ( T ) relies on the double strength θ \theta θ of the commutative monad T T T , it is natural that we need a compatibility condition between σ \sigma σ , γ \gamma γ , and θ \theta θ to achieve this.
Assumption 4.13. We assume that the following diagram commutes:
T A ⊗ F T B → σ T A , T B F ( T A ⊗ T B ) → F θ A , B F T ( A ⊗ B ) 1 T A ⊗ γ B ↓ ↓ γ A ⊗ B T A ⊗ T F B → θ A , F B T ( A ⊗ F B ) → T σ A , B T F ( A ⊗ B ) (4) \begin{CD}
TA \otimes FTB @>{\sigma_{TA,TB}}>> F(TA \otimes TB) @>{F\theta_{A,B}}>> FT(A \otimes B) \\
@V{1_{TA}\otimes\gamma_B}VV @. @VV{\gamma_{A\otimes B}}V \\
TA \otimes TFB @>{\theta_{A,FB}}>> T(A \otimes FB) @>{T\sigma_{A,B}}>> TF(A \otimes B) \tag*{(4)}
\end{CD} T A ⊗ F T B 1 T A ⊗ γ B ↓ ⏐ T A ⊗ T F B σ T A , T B θ A , F B F ( T A ⊗ T B ) T ( A ⊗ F B ) F θ A , B T σ A , B F T ( A ⊗ B ) ↓ ⏐ γ A ⊗ B T F ( A ⊗ B ) (4)
Under Assumption 4.13, it can be shown that F E M F_{\mathrm{EM}} F EM is a strong functor. Furthermore, our assumptions on F F F and T T T ensure that F E M F_{\mathrm{EM}} F EM preserves ω \omega ω -colimits; thus, it is a varietor (§ 2 ). The following theorem summarises these results.
Theorem 4.15. If Assumptions 4.2, 4.3, 4.5, and 4.13 hold, then Assumption 3.2 holds for C : = EM ( T ) \mathcal{C} := \operatorname{EM}(T) C := EM ( T ) and F : = F E M F := F_{\mathrm{EM}} F := F EM .
We conclude this section with a closer look at behaviours in Kl ( T ) \operatorname{Kl}(T) Kl ( T ) and EM ( T ) \operatorname{EM}(T) EM ( T ) . Recall from § 2 that the free F F F -algebra over A ∈ C A \in\mathcal{C} A ∈ C is denoted by ( F ∗ A , ζ A , η A ) (F^{*}A, \zeta_A, \eta_A) ( F ∗ A , ζ A , η A ) .
Proposition 4.16. For all A ∈ C A \in\mathcal{C} A ∈ C , the triple ( F ∗ A , E ζ A , E η A ) (F^{*}A, E\zeta_A, E\eta_A) ( F ∗ A , E ζ A , E η A ) is a free F K l F_{\mathrm{Kl}} F Kl -algebra over A A A . Moreover, for any automaton A ∈ Aut I O ( F K l ) \mathcal{A} \in\operatorname{Aut}^{O}_{I}(F_{\mathrm{Kl}}) A ∈ Aut I O ( F Kl ) , we have r A = r ∇ A r_{\mathcal{A}} = r_{\nabla\mathcal{A}} r A = r ∇ A and B A = B ∇ A B_{\mathcal{A}} = B_{\nabla\mathcal{A}} B A = B ∇ A .
The first part of the above proposition shows that F K l F_{\mathrm{Kl}} F Kl is a varietor; hence, it makes sense to talk about the behaviour of F K l F_{\mathrm{Kl}} F Kl -automata. In particular, a behaviour in Kl ( T ) \operatorname{Kl}(T) Kl ( T ) is a morphism F ∗ I → T O F^{*}I \to TO F ∗ I → T O . The second part shows how to compute the reachability map and the behaviour of F K l F_{\mathrm{Kl}} F Kl -automata: they coincide with those of the determinisation.
We already argued that F E M F_{\mathrm{EM}} F EM is a varietor; we denote the free F E M F_{\mathrm{EM}} F EM -algebra functor by F E M ∗ F^{*}_{\mathrm{EM}} F EM ∗ . Since Kl ( T ) \operatorname{Kl}(T) Kl ( T ) is essentially the full subcategory of EM ( T ) \operatorname{EM}(T) EM ( T ) on the free T T T -algebras, it is not surprising that we have an analogous proposition for EM ( T ) \operatorname{EM}(T) EM ( T ) . Let us write f # : S A → B f^{\#}: SA \to B f # : S A → B for the free T T T -extension of a map f : A → B f: A \to B f : A → B into a T T T -algebra B = ( B , b ) B = (B,b) B = ( B , b ) , given by f # : = b ∘ S f f^{\#} := b \circ Sf f # := b ∘ S f .
Proposition 4.17. For all A ∈ C A \in\mathcal{C} A ∈ C , the triple ( S F ∗ A , S ζ A ∘ φ A , S η A ) (SF^{*}A, S\zeta_A \circ\varphi_A, S\eta_A) ( S F ∗ A , S ζ A ∘ φ A , S η A ) is a free F E M F_{\mathrm{EM}} F EM -algebra over S A SA S A . Hence, there is a natural isomorphism φ ∗ : F E M ∗ S → ≅ S F ∗ \varphi^{*}: F^{*}_{\mathrm{EM}}S \xrightarrow{\cong} SF^{*} φ ∗ : F EM ∗ S ≅ S F ∗ such that for any automaton A ∈ Aut S I S O ( F E M ) \mathcal{A} \in\operatorname{Aut}^{SO}_{SI}(F_{\mathrm{EM}}) A ∈ Aut S I S O ( F EM ) , we have r A = r A ‾ # ∘ φ I ∗ r_{\mathcal{A}} = r^{\#}_{\overline{\mathcal{A}}} \circ\varphi^{*}_{I} r A = r A # ∘ φ I ∗ and B A = B A ‾ # ∘ φ I ∗ B_{\mathcal{A}} = B^{\#}_{\overline{\mathcal{A}}} \circ\varphi^{*}_{I} B A = B A # ∘ φ I ∗ .
Effectful test suites
As explained in § 4 , we wish to test effectful automata in Kl ( T ) \operatorname{Kl}(T) Kl ( T ) as automata in EM ( T ) \operatorname{EM}(T) EM ( T ) . In this section, we accomplish this program and derive a special form of the W-method for F E M F_{\mathrm{EM}} F EM -automata, which we call the effectful W-method . The effectful W-suite is constructed from effectful versions of state covers and state characterisers. We obtain the completeness of the effectful W-method by applying the completeness theorem of the ‘ordinary’ categorical W-method (Theorem 3.10 ) to EM ( T ) \operatorname{EM}(T) EM ( T ) . We continue to work under Assumptions 4.2, 4.3, 4.5, and 4.13 and employ the notation of Sections 2–4. We also fix a specification automaton S ∈ Aut S I S O ( F E M ) \mathcal{S} \in\operatorname{Aut}^{SO}_{SI}(F_{\mathrm{EM}}) S ∈ Aut S I S O ( F EM ) and write Q Q Q for its state space (which is a T T T -algebra).
The effectful W-method Whereas the general categorical definitions of state covers and state characterisers in Section 3 are stated in the category in which the specification lives, the notions of effectful state cover and effectful state characteriser introduced below are presented as structure in the base category C C C instead of the category EM ( T ) \operatorname{EM}(T) EM ( T ) of S S S .
Definition 5.1. An effectful state cover for S S S is a map c : C → F ∗ I c\colon C \to F^{*}I c : C → F ∗ I in C C C together with maps δ C : F C → T C \delta_C\colon FC \to TC δ C : F C → T C and i C : η I → c i_C\colon\eta_I \to c i C : η I → c such that the following diagram in C C C commutes:
F C → F c F F ∗ I → ζ I F ∗ I δ C ↓ ↓ r U ‾ S T C → T c T F ∗ I → r U ‾ S # Q (5) \begin{CD}
FC @>{Fc}>> FF^{*}I @>{\zeta_I}>> F^{*}I \\
@V{\delta_C}VV @. @VV{r_{\overline{U}S}}V \\
TC @>{Tc}>> TF^{*}I @>{r^{\#}_{\overline{U}S}}>> Q \tag*{(5)}
\end{CD} F C δ C ↓ ⏐ T C F c T c F F ∗ I T F ∗ I ζ I r U S # F ∗ I ↓ ⏐ r U S Q (5)
Definition 5.1 is formally quite similar to Definition 3.4 stated for U ‾ S \overline{U}S U S . The main difference is that δ C \delta_C δ C now returns a T T T -structured collection of elements of C C C instead of a single element. In other words, we are allowed to use the algebraic structure of Q Q Q to reach states.
As explained in Section 3, the map δ C \delta_C δ C is included in the definition because it is required to be a morphism in C C C . In Set, however, there is an equivalent characterisation of state covers without δ C \delta_C δ C that is analogous to the classical definition of state covers in terms of access sequences (albeit in the more general context of effectful F F F -automata).
Proposition 5.2. Suppose C = Set C = \operatorname{Set} C = Set and write R = im ( r U ‾ S ) R = \operatorname{im}(r_{\overline{U}S}) R = im ( r U S ) for the set of reachable states of U ‾ S \overline{U}S U S . A subset C ⊆ F ∗ I C \subseteq F^{*}I C ⊆ F ∗ I is an effectful state cover for S S S iff η I ( a ) ∈ C \eta_I(a) \in C η I ( a ) ∈ C for all a ∈ I a \in I a ∈ I and for all q ∈ R q \in R q ∈ R , there exists z ∈ T C z \in TC z ∈ T C such that r U ‾ S # ( T c ( z ) ) = q r^{\#}_{\overline{U}S}(Tc(z)) = q r U S # ( T c ( z )) = q .
In contrast to effectful state covers, the algebraic structure of S S S is not used for the definition of effectful state characterisers. Instead, we simply return to the base category via the functor U ‾ \overline{U} U and treat S S S as a plain deterministic automaton.
Definition 5.3. An effectful state characteriser for S S S is a state characteriser for U ‾ S \overline{U}S U S .
Definition 5.4. Given an effectful state cover c c c for S S S , an effectful state characteriser w w w for S S S , and a natural number k k k , we define the effectful W-suite as c ↑ k + 1 ⋅ w c^{\mathord{\uparrow}k+1}\cdot w c ↑ k + 1 ⋅ w .
Note that the construction in the definition above is the same as in Definition 3.7. However, the inputs are different; in particular, an effectful state cover for S S S is not the same as a state cover for U ‾ S \overline{U}S U S . (The analogous statement for state characterisers is true by definition.)
On the other hand, effectful state covers and state characterisers are equivalent to freely generated state covers and state characterisers in EM ( T ) \operatorname{EM}(T) EM ( T ) , which justifies the correctness of our definitions. For a : A → F ∗ B a\colon A \to F^{*}B a : A → F ∗ B , let us write S ~ a : = ( φ B ∗ ) − 1 ∘ S a : S A → F EM ∗ S B \widetilde{S}a := (\varphi^{*}_{B})^{-1} \circ Sa\colon SA \to F^{*}_{\operatorname{EM}}SB S a := ( φ B ∗ ) − 1 ∘ S a : S A → F EM ∗ S B , where φ ∗ \varphi^{*} φ ∗ is the map from Proposition 4.17. We then call a morphism freely generated if it is of the form S ~ a \widetilde{S}a S a . Intuitively, if t t t is a test suite, viewed as a subset of F ∗ I F^{*}I F ∗ I , then S ~ t \widetilde{S}t S t is the subalgebra of F EM ∗ S I ≅ S F ∗ I F^{*}_{\operatorname{EM}}SI \cong SF^{*}I F EM ∗ S I ≅ S F ∗ I freely generated by the elements of t t t .
Theorem 5.5. Let C → F ∗ I C \to F^{*}I C → F ∗ I , F C → δ C T C FC \xrightarrow{\delta_C} TC F C δ C T C , η I → i C c \eta_I \xrightarrow{i_C} c η I i C c , W → F ∗ I W \to F^{*}I W → F ∗ I , and η I → i W w \eta_I \xrightarrow{i_W} w η I i W w . Then:
(1) ( c , δ C , i C ) (c,\delta_C,i_C) ( c , δ C , i C ) is an effectful state cover for S S S iff ( S ~ c , K S ~ c ∘ φ C , S ~ i C ) (\widetilde{S}c,K_{\widetilde{S}c}\circ\varphi_C,\widetilde{S}i_C) ( S c , K S c ∘ φ C , S i C ) is a state cover for S S S .
(2) ( w , i W ) (w,i_W) ( w , i W ) is an effectful state characteriser for S S S iff ( S ~ w , S i W ) (\widetilde{S}w,S i_W) ( S w , S i W ) is a state characteriser for S S S .
The following result states that under the correspondences of Theorem 5.5, the W-suite (Definition 3.7) constructed in EM ( T ) \operatorname{EM}(T) EM ( T ) is essentially the same as the effectful W-suite.
Lemma 5.6. Let c : C → F ∗ I c: C \to F^*I c : C → F ∗ I be an effectful state cover for S S S , let w : W → F ∗ 1 w: W \to F^*1 w : W → F ∗ 1 be an effectful state characteriser for S S S , and let us write ⊠ \boxtimes ⊠ for the monoidal product in E M ( T ) \mathrm{EM}(T) EM ( T ) . Then for any k ∈ N k \in\mathbb{N} k ∈ N , there is an isomorphism making the following diagram commute:
( S C ) ⊠ k + 1 ⊠ S W ≅ S ( C ⊠ k + 1 ⊗ W ) (SC)^{\boxtimes k+1} \boxtimes SW \cong S(C^{\boxtimes k+1} \otimes W) ( S C ) ⊠ k + 1 ⊠ S W ≅ S ( C ⊠ k + 1 ⊗ W ) ( S c ) ⊠ k + 1 ⋅ S w ↘ F E M ∗ S I S ~ ( c ⊠ k + 1 ⋅ w ) ↙ \begin{aligned}
(S_c)^{\boxtimes k+1}\cdot S_w &\searrow\\
&F^*_{\mathrm{EM}}SI \\
\widetilde{S}(c^{\boxtimes k+1}\cdot w) &\swarrow
\end{aligned} ( S c ) ⊠ k + 1 ⋅ S w S ( c ⊠ k + 1 ⋅ w ) ↘ F EM ∗ S I ↙
Completeness of the effectful W-method. Theorem 4.15 shows that the testing theory of § 3 is applicable to F E M F_{\mathrm{EM}} F EM -automata. Combining our results on the effectful W-method with Theorem 3.10 , we obtain the following completeness theorem for F E M F_{\mathrm{EM}} F EM -automata. To state the theorem, we introduce the effectful version of the fault domain U c k U_c^k U c k from Definition 3.9 : for C → c F ∗ I C \xrightarrow{c} F^*I C c F ∗ I , we write U c , E M k : = { M ∈ Aut S I S O ( F E M ) ∣ c ⊠ k U_{c,\mathrm{EM}}^k := \{M \in\operatorname{Aut}^{SO}_{SI}(F_{\mathrm{EM}}) \mid c^{\boxtimes k} U c , EM k := { M ∈ Aut S I S O ( F EM ) ∣ c ⊠ k is an effectful state cover for M } M\} M } .
Theorem 5.7. Let c c c be an effectful state cover for S S S , let w w w be an effectful state characteriser for S S S , let k ∈ N k \in\mathbb{N} k ∈ N , and suppose S S S is observable. Then the test suite S ~ ( c ⊠ k + 1 ⋅ w ) \widetilde{S}(c^{\boxtimes k+1}\cdot w) S ( c ⊠ k + 1 ⋅ w ) is complete for S S S w.r.t. U c , E M k U_{c,\mathrm{EM}}^k U c , EM k .
Finally, we consider the special case when the specification S S S originates from the Kleisli category Kl ( T ) \operatorname{Kl}(T) Kl ( T ) . For S ∈ Aut I O ( F Kl ) S \in\operatorname{Aut}^{O}_{I}(F_{\operatorname{Kl}}) S ∈ Aut I O ( F Kl ) , we overload the term ‘effectful state cover for S S S ’ to mean ‘effectful state cover for K ‾ S \overline{K}S K S , and similarly for effectful state characteriser. Note that in this case, the automaton U ‾ K S \overline{U}KS U K S used in Definitions 5.1 and 5.3 coincides with V ‾ S \overline{V}S V S . Furthermore, we write U c , Kl k : = { M ∈ Aut I O ( F Kl ) ∣ c ⊠ k U_{c,\operatorname{Kl}}^k := \{M \in\operatorname{Aut}^{O}_{I}(F_{\operatorname{Kl}}) \mid c^{\boxtimes k} U c , Kl k := { M ∈ Aut I O ( F Kl ) ∣ c ⊠ k is an effectful state cover for M } M\} M } .
Corollary 5.8. Let S ∈ Aut I O ( F Kl ) S \in\operatorname{Aut}^{O}_{I}(F_{\operatorname{Kl}}) S ∈ Aut I O ( F Kl ) be an automaton. Let c c c be an effectful state cover for S S S , let w w w be an effectful state characteriser for S S S , let k ∈ N k \in\mathbb{N} k ∈ N , and suppose K ‾ S \overline{K}S K S is observable. Then the test suite E ( c ⊠ k + 1 ⋅ w ) E(c^{\boxtimes k+1}\cdot w) E ( c ⊠ k + 1 ⋅ w ) is complete for S S S w.r.t. U c , Kl k U_{c,\operatorname{Kl}}^k U c , Kl k .
Applications
We instantiate the effectful W-method to non-deterministic automata and weighted automata over the integers. In both cases, we give example automata and a complete test suite.
Nondeterministic automata
Consider the family of regular languages L n : = Σ ∗ a Σ n L_n := \Sigma^*a\Sigma^n L n := Σ ∗ a Σ n over Σ : = { a , b } \Sigma:= \{a,b\} Σ := { a , b } for n ∈ N n \in\mathbb{N} n ∈ N . These are typical examples of languages accepted by a small NFA (with n + 2 n+2 n + 2 states) whose determinisation is exponentially large (with 2 n + 1 2^{n+1} 2 n + 1 states). The NFA A 2 A_2 A 2 accepting L 2 L_2 L 2 is depicted in Figure 2 . The automata A n A_n A n for arbitrary n n n look similar but with a longer chain of states. We construct the effectful W-suite for A 2 A_2 A 2 as follows.
Figure 2. The non-deterministic automaton A 2 A_2 A 2 for the language L 2 = Σ ∗ a Σ 2 L_2 = \Sigma^*a\Sigma^2 L 2 = Σ ∗ a Σ 2 with Σ = { a , b } \Sigma= \{a,b\} Σ = { a , b } .
State cover Specialising Proposition 5.2 to NFAs (Example 4.6), we get:
Proposition 6.1. Let S S S be an NFA and write R = im ( r V S ) R = \operatorname{im}(r_{\mathsf{V}S}) R = im ( r V S ) for the set of reachable states of V S \mathsf{V}S V S . A set C ⊆ Σ ∗ C \subseteq\Sigma^* C ⊆ Σ ∗ of words is an effectful state cover for S S S iff ε ∈ C \varepsilon\in C ε ∈ C and for all q ∈ R q \in R q ∈ R , there exist words v 1 , … , v n ∈ C v_1,\ldots,v_n \in C v 1 , … , v n ∈ C such that ⋃ i = 1 n r V S ( v i ) = q \bigcup_{i=1}^{n} r_{\mathsf{V}S}(v_i) = q ⋃ i = 1 n r V S ( v i ) = q .
Note that we can use unions (the algebraic structure of P f Q \mathcal{P}_{f}Q P f Q ) to cover states, meaning that the size of an effectful state cover for an NFA may be smaller than a state cover for its determinised DFA. In this example, one can check that the set C : = { ε , a , a b , a b b } C := \{\varepsilon,a,ab,abb\} C := { ε , a , ab , abb } with just four elements is an effectful state cover for A 2 A_2 A 2 , even though ∣ R ∣ = 8 |R| = 8 ∣ R ∣ = 8 .
In general, constructing a minimal effectful state cover is equivalent to finding access sequences for the reachable states that cannot be expressed as a union of other reachable states. These are precisely the join-irreducible elements of the subsemilattice of P f Q \mathcal{P}_{f}Q P f Q generated by R R R . This is similar to the construction of the canonical residual finite state automaton of a language L L L [19 ] (also called jiromaton in [49 ] ).
A (not necessarily minimal) effectful state cover C C C for an NFA S S S can be computed incrementally, as follows. Start with C : = { ε } C := \{\varepsilon\} C := { ε } , and perform a traversal on the determinisation of S S S . For each new state, check if it can be expressed as a union of states reached by C C C . If not, add its access sequence to C C C ; otherwise, discard the current branch. Incidentally, this procedure also produces the map δ C \delta_C δ C (Definition 5.1). Here, δ C : C × Σ → P f C \delta_C : C \times\Sigma\to\mathcal{P}_{f}C δ C : C × Σ → P f C is given by:
ε , a ↦ ε ∨ a a b , a ↦ ε ∨ a ∨ a b b a , a ↦ ε ∨ a ∨ a b a b b , a ↦ ε ∨ a ε , b ↦ ε a b , b ↦ ε ∨ a b b a , b ↦ ε ∨ a b a b b , b ↦ ε \begin{aligned}
\varepsilon,a &\mapsto\varepsilon\vee a & ab,a &\mapsto\varepsilon\vee a \vee abb & a,a &\mapsto\varepsilon\vee a \vee ab & abb,a &\mapsto\varepsilon\vee a \\
\varepsilon,b &\mapsto\varepsilon& ab,b &\mapsto\varepsilon\vee abb & a,b &\mapsto\varepsilon\vee ab & abb,b &\mapsto\varepsilon
\end{aligned} ε , a ε , b ↦ ε ∨ a ↦ ε ab , a ab , b ↦ ε ∨ a ∨ abb ↦ ε ∨ abb a , a a , b ↦ ε ∨ a ∨ ab ↦ ε ∨ ab abb , a abb , b ↦ ε ∨ a ↦ ε
State characteriser For an effectful state characteriser, we need to distinguish all pairs of inequivalent states in P f Q \mathcal{P}_{f}Q P f Q (and not just the reachable ones). We can take e.g. the set W : = { ε , a , a a , a a a } W := \{\varepsilon,a,aa,aaa\} W := { ε , a , aa , aaa } : the element ε \varepsilon ε distinguishes all sets containing q 3 q_3 q 3 from those not containing q 3 q_3 q 3 , the element a a a does the same for q 2 q_2 q 2 , and so on.
Test suite We conclude the example by constructing the effectful W-suite for k = 0 k = 0 k = 0 . As in Example 3.11, it is the map t : T → Σ ∗ t : T \to\Sigma^* t : T → Σ ∗ with T = C × ( { ε } ∪ Σ ) × W T = C \times(\{\varepsilon\} \cup\Sigma) \times W T = C × ({ ε } ∪ Σ ) × W and t ( u , a , v ) = u a v t(u,a,v) = uav t ( u , a , v ) = u a v . The resulting test suite has 24 words (after removing duplicates).
When considering the effectful W-suite for the entire family A n A_n A n , we observe that the sizes of effectful state covers and state characterisers are linear in n n n : both contain exactly n + 2 n + 2 n + 2 elements. This makes the resulting test suite quadratic in n n n (for a fixed k k k ). This is more efficient than constructing a W-suite for the determinised automata. In particular, the automaton V A n \mathsf{V}A_n V A n has 2 n + 1 2^{n+1} 2 n + 1 states, which is thus the size of the minimal state cover. This leads to a test suite of exponential size. (The state characteriser is still linear with n + 1 n + 1 n + 1 elements.)
We should remark that completeness means something different in these two testing scenarios. In the non-deterministic case, the test suite is complete for the class of NFAs for which C = { ε , a , a b , a b b } C = \{\varepsilon,a,ab,abb\} C = { ε , a , ab , abb } is an effectful state cover. This also includes DFAs, but only those with at most ∣ C ∣ = 4 |C| = 4 ∣ C ∣ = 4 states. The deterministic W-suite is similar but the state cover contains more elements, and hence the associated fault domain contains larger DFAs (but no NFAs).
Weighted automata
We instantiate the automata-theoretic definitions of Section 4 to obtain weighted finite automata (WFA), using weights from the ring Z \mathbb{Z} Z . As semirings, rings are quite special since they have additive inverses; this greatly simplifies the computation of state covers and state characterisers. However, even though we work with Z \mathbb{Z} Z in this example, our theory in § 4 applies in principle to arbitrary commutative semirings, such as the tropical semiring.
Similar to NFAs (Example 4.6), we use the data F : = ( − ) × Σ F := (-) \times\Sigma F := ( − ) × Σ , I : = O : = 1 I := O := 1 I := O := 1 and choose the monad T X : = Lin Z ( X ) : = { v : X → Z ∣ v ( x ) ≠ 0 for finitely many x } TX := \operatorname{Lin}_{\mathbb{Z}}(X) := \{v : X \to\mathbb{Z} \mid v(x) \ne0 \text{ for finitely many } x\} T X := Lin Z ( X ) := { v : X → Z ∣ v ( x ) = 0 for finitely many x } to capture weighted transitions. The set Lin Z ( X ) \operatorname{Lin}_{\mathbb{Z}}(X) Lin Z ( X ) consists of all formal linear combinations of elements in X X X .
Morphisms A → B A \to B A → B in the Kleisli category Kl ( Lin Z ) \operatorname{Kl}(\operatorname{Lin}_{\mathbb{Z}}) Kl ( Lin Z ) are functions A → Lin Z ( B ) A \to\operatorname{Lin}_{\mathbb{Z}}(B) A → Lin Z ( B ) ; these assign to every input in A A A a linear combination of elements in B B B . The Eilenberg-Moore category EM ( Lin Z ) \operatorname{EM}(\operatorname{Lin}_{\mathbb{Z}}) EM ( Lin Z ) is the category of Z \mathbb{Z} Z -modules (i.e. Abelian groups) and linear maps.
We already saw that Assumption 4.2 holds, and one can also verify that Assumptions 4.3 and 4.5 are satisfied. By Theorems 4.4 and 4.7 , we obtain both a Kleisli extension F K l F_{\mathrm{Kl}} F Kl and an Eilenberg-Moore extension F E M F_{\mathrm{EM}} F EM . Unfolding these definitions, a finite F K l F_{\mathrm{Kl}} F Kl -automaton consists of: a finite set Q Q Q of states; a weighted transition function δ : Q × Σ → Q \delta: Q \times\Sigma\to Q δ : Q × Σ → Q , assigning to each state q ∈ Q q \in Q q ∈ Q and letter s ∈ Σ s \in\Sigma s ∈ Σ a linear combination of successor states; a morphism i : 1 → Q i : 1 \to Q i : 1 → Q , given by an initial vector in Z Q \mathbb{Z}^{Q} Z Q ; and a morphism o : Q → 1 o : Q \to1 o : Q → 1 , given by a final vector in Z Q \mathbb{Z}^{Q} Z Q .
Many variations of weighted automata appear in the literature (see e.g. [50 , 20 , 14 , 26 , 21 ] ), mostly differing in the way transitions are defined (e.g. using matrices). These are equivalent to our definition (provided Q Q Q and Σ \Sigma Σ are finite sets), which is in line with the work of Arbib and Manes [5 , 6 ] . We note that F E M F_{\mathrm{EM}} F EM -automata closely resemble the linear weighted automata of [14 ] , and the functor K K K coincides with their ‘weighted powerset construction’ that maps a WFA to a deterministic automaton whose states are formal linear combinations of states of the original WFA. We refer to such formal linear combinations of states as configurations .
Example WFA We consider a modification of the NFA A n A_n A n from § 6.1 to weighted automata B n B_n B n , obtained by assigning weight 2 to the a a a -loop on q 0 q_0 q 0 and weight 1 to all other transitions. The initial weight is 1 for initial states and 0 for the others, and similarly, the final weight is 1 for accepting states and 0 for the rest. The case B 2 B_2 B 2 is depicted in Figure 3 .
Figure 3. The weighted automaton B 2 B_2 B 2 for the weighted language L ~ 2 \widetilde{L}_2 L 2 .
State cover In the case of WFAs, Proposition 5.2 specialises to the following:
Proposition 6.2. Let S S S be a WFA and write R = im ( r V ‾ S ) R = \operatorname{im}(r_{\overline{V}S}) R = im ( r V S ) for the set of reachable configurations of V ‾ S \overline{V}S V S . A set C ⊆ Σ ∗ C \subseteq\Sigma^* C ⊆ Σ ∗ of words is an effective state cover for S S S iff e ∈ C e \in C e ∈ C and for all q ∈ R q \in R q ∈ R , there exist v 1 , … , v n ∈ C v_1,\ldots,v_n \in C v 1 , … , v n ∈ C and a 1 , … , a n ∈ Z a_1,\ldots,a_n \in\mathbb{Z} a 1 , … , a n ∈ Z such that ∑ i = 1 n a i V ‾ S ( v i ) = q \sum_{i=1}^{n} a_i\overline{V}S(v_i) = q ∑ i = 1 n a i V S ( v i ) = q .
Instead of unions, we are now allowed to use linear combinations of configurations to cover additional configurations. In particular, we can use subtraction and multiplication by a scalar, which allows for much greater flexibility and thus leads to smaller state covers.
Analogously to the case of NFAs, an effectful state cover can be constructed incrementally by performing a traversal on the configuration space and extending the state cover any time we encounter a configuration that is linearly independent. In this example, C : = { ε , a , a a , a a a } C := \{\varepsilon, a, aa, aaa\} C := { ε , a , aa , aaa } is an effectful state cover. Again, we obtain δ C : C × Σ → Lin Z ( C ) \delta_C : C \times\Sigma\to\operatorname{Lin}_{\mathbb{Z}}(C) δ C : C × Σ → Lin Z ( C ) and we highlight one equation to show the linear structure: δ C ( a , b ) = 2 ⋅ ε − 2 ⋅ a + 1 ⋅ a a \delta_C(a,b) = 2 \cdot\varepsilon- 2 \cdot a + 1 \cdot aa δ C ( a , b ) = 2 ⋅ ε − 2 ⋅ a + 1 ⋅ aa .
State characteriser We can show that, for a WFA S S S with state space Q Q Q , the observability map of the automaton V ‾ S \overline{V}S V S is a linear map Lin Z ( Q ) → Z Σ ∗ \operatorname{Lin}_{\mathbb{Z}}(Q) \to\mathbb{Z}^{\Sigma^*} Lin Z ( Q ) → Z Σ ∗ from the configuration space to the space of weighted languages (equipped with the pointwise structure induced by Z \mathbb{Z} Z ). Thus, to distinguish configurations, we can use the module structure of the configuration space: two states are equivalent on a set T T T if and only if the language of their difference assigns 0 to all words in T T T . Hence, for the state characteriser, we need to pick a set of words W W W such that, for all configurations v v v , if ℓ V ‾ S ( v ) ( u ) = 0 \ell_{\overline{V}S}(v)(u) = 0 ℓ V S ( v ) ( u ) = 0 for all u ∈ W u \in W u ∈ W , then ℓ V ‾ S ( v ) = 0 \ell_{\overline{V}S}(v) = 0 ℓ V S ( v ) = 0 .
As an example, given the configuration v = x 0 ⋅ q 0 + x 1 ⋅ q 1 + x 2 ⋅ q 2 + x 3 ⋅ q 3 v = x_0 \cdot q_0 + x_1 \cdot q_1 + x_2 \cdot q_2 + x_3 \cdot q_3 v = x 0 ⋅ q 0 + x 1 ⋅ q 1 + x 2 ⋅ q 2 + x 3 ⋅ q 3 , we have ℓ V ‾ S ( v ) ( ε ) = x 3 \ell_{\overline{V}S}(v)(\varepsilon) = x_3 ℓ V S ( v ) ( ε ) = x 3 . Therefore, the condition that the output be 0 yields the requirement x 3 = 0 x_3 = 0 x 3 = 0 . Similarly, the input a a a yields the requirement x 2 = 0 x_2 = 0 x 2 = 0 , a a aa aa yields x 1 = 0 x_1 = 0 x 1 = 0 , and a a a aaa aaa yields x 0 = 0 x_0 = 0 x 0 = 0 . Hence, we can take W : = { ε , a , a a , a a a } W := \{\varepsilon, a, aa, aaa\} W := { ε , a , aa , aaa } : if a configuration v v v outputs zero on all these words, then we know that v = 0 v = 0 v = 0 (and ℓ V ‾ S ( v ) = 0 \ell_{\overline{V}S}(v) = 0 ℓ V S ( v ) = 0 in particular).
Test suite Like before, the effectful W-suite is given by T = C × ( { ε } ∪ Σ ) × W T = C \times(\{\varepsilon\} \cup\Sigma) \times W T = C × ({ ε } ∪ Σ ) × W , and it again has 24 words. For arbitrary n n n , the minimal state cover and state characteriser for B n B_n B n will both contain n + 2 n + 2 n + 2 words, and the resulting test suite will be quadratic in n n n .
Related work
Conformance testing of non-deterministic systems has been considered before by Petrenko and Yevtushenko [52 ] . A big difference between our work and theirs is how non-determinism is observed. In their setting, non-determinism means that each run may produce a different output, even for a single test. Hence, it may be necessary to run the same test multiple times. In our case, a non-deterministic automaton always accepts a word if there is some accepting run. In short, we assume the observable behaviour is a deterministic function Σ ∗ → 2 \Sigma^* \to2 Σ ∗ → 2 .
Another difference is the overall approach. We try to generalise the known W-method and then describe the fault domain; they fix the fault domain upfront (all models of a certain size) and then construct a complete test suite. The work of Petrenko and Yevtushenko has lead to complete test suites for other conformance relations, such as ioco [15 ] . Moreover, it has been formalised by Sachtleben in Isabelle/HOL [55 ] .
Our framework in § 3 is a mild generalisation of the one in [39 ] : the present generalisation works with an arbitrary strong endofunctor for describing the transition structure. This level of abstraction simplifies many definitions and proofs. Moreover, it applies to deterministic tree automata, but the details are left for future work. The main extension of the current paper is a systematic framework for effectful automata.
In van Heerdt’s thesis [26 ] , the L* learning algorithm is generalised to a categorical framework. An earlier article [29 ] , § 6 also includes an outline of a general approach to conformance testing, based on cofree algebras and factorisation systems instead of the monoidal closed structure in the current paper and [39 ] . However, the completeness theorem of [29 ] has different conditions on the (implicit) fault domain: notably, the implementations are assumed to be observable and to have no more states than the specification. Again, another key difference with the current paper is that we focus explicitly on effectful automata.
Distributive laws of functors over monads (and monads over functors) also play a key role in coalgebraic determinisation and trace semantics (e.g. [32 , 25 ] ). We follow an algebraic approach to automata in the style of Arbib and Manes instead of a coalgebraic one. Determinisation and minimisation for these types of automata was studied in [27 ] .
Conclusion
We introduced a general categorical framework for testing effectful automata, which are Arbib and Manes style algebraic automata in the Kleisli category of a monad. The key step underlying our approach is to develop the theory of the W-method and its completeness instead in the Eilenberg-Moore category of the monad at hand, resulting in the notion of effectful W-method and its completeness. We instantiated the theory to obtain test suites for non-deterministic automata and weighted automata over the integers.
Future work Besides word automata, the framework in § 3 also covers deterministic bottom-up tree automata [18 ] . Although our categorical testing framework in § 3 does apply to this case, we did not pursue tree automata in the present paper because Assumption 4.13 is not satisfied for the given strength and distributive law. One possible approach to solve this issue is to involve contexts , as done also e.g. in [28 ] .
Probabilistic automata can be modelled as effectful automata for the finite-support distribution monad; hence, our W-method applies here as well. However, we think such stochastic models need additional analysis: our test suite expects an exact output distribution for each test, but probabilistic systems in practice often cannot guarantee exact measurements and instead need to approximate the output distribution via sampling.
Our definition of state characteriser is as a map W → F ∗ 1 W \to F^{*}1 W → F ∗ 1 with a property of the induced map [ F ∗ 1 , O ] → [ W , O ] [F^{*}1,O] \to[W,O] [ F ∗ 1 , O ] → [ W , O ] on languages. This means that more refined test suites such as the Wp-method [23 ] and the HSI-method [51 ] cannot be captured, as they may require this set to depend on the state (or rather, the behaviour of the state). A possible generalisation is to consider a map [ F ∗ 1 , O ] → Z [F^{*}1,O] \to Z [ F ∗ 1 , O ] → Z as the required data, similar to the notion of wrapper in [26 ] .
In the examples that we considered, we did not have to minimise when moving from the Kleisli category to the Eilenberg-Moore category. In general, doing so might be useful to obtain smaller test suites. We leave an integration of the current framework with algorithms for minimising automata for future work.
Categorical preliminaries
We recall some standard categorical definitions that are used throughout the paper.
Definition A.1 [43 ] . (1) A monoidal category is a category C \mathcal{C} C equipped with
a functor ⊗ : C × C → C \otimes: \mathcal{C} \times\mathcal{C} \to\mathcal{C} ⊗ : C × C → C (called the tensor product),
an object 1 ∈ C \mathbb{1} \in\mathcal{C} 1 ∈ C (called the tensor unit),
a natural isomorphism α A , B , C : ( A ⊗ B ) ⊗ C → ∼ A ⊗ ( B ⊗ C ) \alpha_{A,B,C} : (A \otimes B) \otimes C \xrightarrow{\sim} A \otimes(B \otimes C) α A , B , C : ( A ⊗ B ) ⊗ C ∼ A ⊗ ( B ⊗ C ) (called the associator),
a natural isomorphism λ A : 1 ⊗ A → ∼ A \lambda_A : \mathbb{1} \otimes A \xrightarrow{\sim} A λ A : 1 ⊗ A ∼ A (called the left unitor), and
a natural isomorphism ρ A : A ⊗ 1 → ∼ A \rho_A : A \otimes\mathbb{1} \xrightarrow{\sim} A ρ A : A ⊗ 1 ∼ A (called the right unitor)
such that the following diagrams commute:
( ( A ⊗ B ) ⊗ C ) ⊗ D → α A , B , C ⊗ 1 D ( A ⊗ ( B ⊗ C ) ) ⊗ D α A ⊗ B , C , D ↓ ↓ α A , B ⊗ C , D ( A ⊗ B ) ⊗ ( C ⊗ D ) → α A , B , C ⊗ D A ⊗ ( B ⊗ ( C ⊗ D ) ) 1 A ⊗ α B , C , D ↑ \begin{CD}
((A \otimes B) \otimes C) \otimes D @>{\alpha_{A,B,C} \otimes\mathbb{1}_D}>> (A \otimes(B \otimes C)) \otimes D \\
@V{\alpha_{A \otimes B,C,D}}VV @VV{\alpha_{A,B \otimes C,D}}V \\
(A \otimes B) \otimes(C \otimes D) @>>{\alpha_{A,B,C \otimes D}}> A \otimes(B \otimes(C \otimes D)) \\
@. @A{\mathbb{1}_A \otimes\alpha_{B,C,D}}AA
\end{CD} (( A ⊗ B ) ⊗ C ) ⊗ D α A ⊗ B , C , D ↓ ⏐ ( A ⊗ B ) ⊗ ( C ⊗ D ) α A , B , C ⊗ 1 D α A , B , C ⊗ D ( A ⊗ ( B ⊗ C )) ⊗ D ↓ ⏐ α A , B ⊗ C , D A ⊗ ( B ⊗ ( C ⊗ D )) 1 A ⊗ α B , C , D ⏐ ↑ ( A ⊗ 1 ) ⊗ B → α A , 1 , B A ⊗ ( 1 ⊗ B ) ρ A ⊗ 1 B ↓ ↓ 1 A ⊗ λ B A ⊗ B = A ⊗ B \begin{CD}
(A \otimes\mathbb{1}) \otimes B @>{\alpha_{A,\mathbb{1},B}}>> A \otimes(\mathbb{1} \otimes B) \\
@V{\rho_A \otimes\mathbb{1}_B}VV @VV{\mathbb{1}_A \otimes\lambda_B}V \\
A \otimes B @= A \otimes B
\end{CD} ( A ⊗ 1 ) ⊗ B ρ A ⊗ 1 B ↓ ⏐ A ⊗ B α A , 1 , B A ⊗ ( 1 ⊗ B ) ↓ ⏐ 1 A ⊗ λ B A ⊗ B (2) A symmetric monoidal category is a monoidal category equipped with an additional natural isomorphism β A , B : A ⊗ B → ∼ B ⊗ A \beta_{A,B} : A \otimes B \xrightarrow{\sim} B \otimes A β A , B : A ⊗ B ∼ B ⊗ A (called the braiding) such that β B , A ∘ β A , B = 1 A ⊗ B \beta_{B,A} \circ\beta_{A,B} = \mathbb{1}_{A \otimes B} β B , A ∘ β A , B = 1 A ⊗ B and the following diagram commutes:
( A ⊗ B ) ⊗ C → α A , B , C A ⊗ ( B ⊗ C ) → β A , B ⊗ C ( B ⊗ C ) ⊗ A β A , B ⊗ 1 C ↓ ↑ α B , C , A ( B ⊗ A ) ⊗ C → α B , A , C B ⊗ ( A ⊗ C ) → 1 B ⊗ β A , C B ⊗ ( C ⊗ A ) \begin{CD}
(A \otimes B) \otimes C @>{\alpha_{A,B,C}}>> A \otimes(B \otimes C) @>{\beta_{A,B \otimes C}}>> (B \otimes C) \otimes A \\
@V{\beta_{A,B} \otimes\mathbb{1}_C}VV @. @AA{\alpha_{B,C,A}}A \\
(B \otimes A) \otimes C @>>{\alpha_{B,A,C}}> B \otimes(A \otimes C) @>>{\mathbb{1}_B \otimes\beta_{A,C}}> B \otimes(C \otimes A)
\end{CD} ( A ⊗ B ) ⊗ C β A , B ⊗ 1 C ↓ ⏐ ( B ⊗ A ) ⊗ C α A , B , C α B , A , C A ⊗ ( B ⊗ C ) B ⊗ ( A ⊗ C ) β A , B ⊗ C 1 B ⊗ β A , C ( B ⊗ C ) ⊗ A ⏐ ↑ α B , C , A B ⊗ ( C ⊗ A ) (3) A monoidal category C \mathcal{C} C is closed if for all A ∈ C A \in\mathcal{C} A ∈ C , the functor ( − ) ⊗ A (-) \otimes A ( − ) ⊗ A has a right adjoint [ A , − ] [A,-] [ A , − ] , called the internal hom. A (symmetric) monoidal closed category is a (symmetric) monoidal category that is closed.
Definition A.2 [38 ] . Let C \mathcal{C} C be a monoidal category and let F : C → C F : \mathcal{C} \to\mathcal{C} F : C → C be an endofunctor. A left strength for F F F is a natural transformation σ A , B : A ⊗ F B → F ( A ⊗ B ) \sigma_{A,B} : A \otimes FB \to F(A \otimes B) σ A , B : A ⊗ F B → F ( A ⊗ B ) making the following diagrams commute:
( A ⊗ B ) ⊗ F C → α A , B , F C A ⊗ ( B ⊗ F C ) σ A ⊗ B , C ↓ ↓ 1 A ⊗ σ B , C F ( ( A ⊗ B ) ⊗ C ) → F α A , B , C F ( A ⊗ ( B ⊗ C ) ) ↑ σ A , B ⊗ C \begin{CD}
(A \otimes B) \otimes FC @>{\alpha_{A,B,FC}}>> A \otimes(B \otimes FC) \\
@V{\sigma_{A \otimes B,C}}VV @VV{\mathbb{1}_A \otimes\sigma_{B,C}}V \\
F((A \otimes B) \otimes C) @>>{F\alpha_{A,B,C}}> F(A \otimes(B \otimes C)) \\
@. @AA{\sigma_{A,B \otimes C}}A
\end{CD} ( A ⊗ B ) ⊗ F C σ A ⊗ B , C ↓ ⏐ F (( A ⊗ B ) ⊗ C ) α A , B , F C F α A , B , C A ⊗ ( B ⊗ F C ) ↓ ⏐ 1 A ⊗ σ B , C F ( A ⊗ ( B ⊗ C )) ⏐ ↑ σ A , B ⊗ C 1 ⊗ F A → σ 1 , A F ( 1 ⊗ A ) λ F A ↓ ↓ F λ A F A = F A \begin{CD}
\mathbb{1} \otimes FA @>{\sigma_{\mathbb{1},A}}>> F(\mathbb{1} \otimes A) \\
@V{\lambda_{FA}}VV @VV{F\lambda_A}V \\
FA @= FA
\end{CD} 1 ⊗ F A λ F A ↓ ⏐ F A σ 1 , A F ( 1 ⊗ A ) ↓ ⏐ F λ A F A A (left) strong functor on C \mathcal{C} C is an endofunctor F : C → C F : \mathcal{C} \to\mathcal{C} F : C → C equipped with a left strength σ \sigma σ .
We also have the notion of right strength, which is defined symmetrically and involves a natural transformation F A ⊗ B → F ( A ⊗ B ) FA \otimes B \to F(A \otimes B) F A ⊗ B → F ( A ⊗ B ) . In a symmetric monoidal category, the two notions are interdefinable using the braiding β \beta β .
Commutative monads on symmetric monoidal closed categories were originally defined by Kock [36 ] as strong monads satisfying a certain condition. It was shown in [36 , 38 ] that commutative monads on symmetric monoidal (closed) categories are equivalent to symmetric monoidal monads . In this paper, we mainly rely on the ‘double strength’ θ \theta θ of monoidal monads, so we state the definition in monoidal form. We chose to use the term ‘commutative’ in the paper since that is slightly more common in a theoretical computer science context.
Definition A.3 [36 , 38 ] . Let C C C be a monoidal category. A monoidal monad on C C C is a monad ( T , μ , η ) (T,\mu,\eta) ( T , μ , η ) equipped with a natural transformation θ A , B : T A ⊗ T B → T ( A ⊗ B ) \theta_{A,B}: TA \otimes TB \to T(A \otimes B) θ A , B : T A ⊗ T B → T ( A ⊗ B ) making the following diagrams commute:
( T A ⊗ T B ) ⊗ T C → θ A , B ⊗ 1 T C T ( A ⊗ B ) ⊗ T C α T A , T B , T C ↓ ↓ θ A ⊗ B , C T A ⊗ ( T B ⊗ T C ) → 1 T A ⊗ θ B , C T A ⊗ T ( B ⊗ C ) 1 T A ⊗ T α B , C ↓ ↓ T α A , B , C T A ⊗ T ( B ⊗ C ) → θ A , B ⊗ C T ( A ⊗ ( B ⊗ C ) ) \begin{CD}
(TA \otimes TB) \otimes TC @>{\theta_{A,B}\otimes1_{TC}}>> T(A \otimes B) \otimes TC \\
@V{\alpha_{TA,TB,TC}}VV @VV{\theta_{A\otimes B,C}}V \\
TA \otimes(TB \otimes TC) @>{1_{TA}\otimes\theta_{B,C}}>> TA \otimes T(B \otimes C) \\
@V{1_{TA}\otimes T\alpha_{B,C}}VV @VV{T\alpha_{A,B,C}}V \\
TA \otimes T(B \otimes C) @>{\theta_{A,B\otimes C}}>> T(A \otimes(B \otimes C))
\end{CD} ( T A ⊗ T B ) ⊗ T C α T A , T B , T C ↓ ⏐ T A ⊗ ( T B ⊗ T C ) 1 T A ⊗ T α B , C ↓ ⏐ T A ⊗ T ( B ⊗ C ) θ A , B ⊗ 1 T C 1 T A ⊗ θ B , C θ A , B ⊗ C T ( A ⊗ B ) ⊗ T C ↓ ⏐ θ A ⊗ B , C T A ⊗ T ( B ⊗ C ) ↓ ⏐ T α A , B , C T ( A ⊗ ( B ⊗ C )) 1 ⊗ T A → λ T A T A η 1 ⊗ 1 T A ↓ ↑ T λ A T 1 ⊗ T A → θ 1 , A T ( 1 ⊗ A ) T A ⊗ 1 → ρ T A T A 1 T A ⊗ η 1 ↓ ↑ T ρ A T A ⊗ T 1 → θ A , 1 T ( A ⊗ 1 ) \begin{CD}
\mathbf{1}\otimes TA @>{\lambda_{TA}}>> TA \\
@V{\eta_{\mathbf{1}}\otimes1_{TA}}VV @AA{T\lambda_A}A \\
T\mathbf{1}\otimes TA @>{\theta_{\mathbf{1},A}}>> T(\mathbf{1}\otimes A)
\end{CD}
\qquad
\begin{CD}
TA\otimes\mathbf{1} @>{\rho_{TA}}>> TA \\
@V{1_{TA}\otimes\eta_{\mathbf{1}}}VV @AA{T\rho_A}A \\
TA\otimes T\mathbf{1} @>{\theta_{A,\mathbf{1}}}>> T(A\otimes\mathbf{1})
\end{CD} 1 ⊗ T A η 1 ⊗ 1 T A ↓ ⏐ T 1 ⊗ T A λ T A θ 1 , A T A ⏐ ↑ T λ A T ( 1 ⊗ A ) T A ⊗ 1 1 T A ⊗ η 1 ↓ ⏐ T A ⊗ T 1 ρ T A θ A , 1 T A ⏐ ↑ T ρ A T ( A ⊗ 1 ) T 2 A ⊗ T 2 B → θ T A , T B T ( T A ⊗ T B ) → T θ A , B T 2 ( A ⊗ B ) μ A ⊗ μ B ↓ ↓ μ A ⊗ B T A ⊗ T B → θ A , B T ( A ⊗ B ) A ⊗ B → η A ⊗ B T ( A ⊗ B ) η A ⊗ η B ↓ ↑ θ A , B T A ⊗ T B \begin{CD}
T^{2}A\otimes T^{2}B @>{\theta_{TA,TB}}>> T(TA\otimes TB) @>{T\theta_{A,B}}>> T^{2}(A\otimes B) \\
@V{\mu_A\otimes\mu_B}VV @. @VV{\mu_{A\otimes B}}V \\
TA\otimes TB @>{\theta_{A,B}}>> T(A\otimes B)
\end{CD}
\qquad
\begin{CD}
A\otimes B @>{\eta_{A\otimes B}}>> T(A\otimes B) \\
@V{\eta_A\otimes\eta_B}VV @AA{\theta_{A,B}}A \\
TA\otimes TB @.
\end{CD} T 2 A ⊗ T 2 B μ A ⊗ μ B ↓ ⏐ T A ⊗ T B θ T A , T B θ A , B T ( T A ⊗ T B ) T ( A ⊗ B ) T θ A , B T 2 ( A ⊗ B ) ↓ ⏐ μ A ⊗ B A ⊗ B η A ⊗ η B ↓ ⏐ T A ⊗ T B η A ⊗ B T ( A ⊗ B ) ⏐ ↑ θ A , B
If C C C is a symmetric monoidal category, then a symmetric monoidal monad is a monoidal monad satisfying the following additional condition:
T A ⊗ T B → θ A , B T ( A ⊗ B ) β T A , T B ↓ ↑ T β A , B T B ⊗ T A → θ B , A T ( B ⊗ A ) \begin{CD}
TA\otimes TB @>{\theta_{A,B}}>> T(A\otimes B) \\
@V{\beta_{TA,TB}}VV @AA{T\beta_{A,B}}A \\
TB\otimes TA @>{\theta_{B,A}}>> T(B\otimes A)
\end{CD} T A ⊗ T B β T A , T B ↓ ⏐ T B ⊗ T A θ A , B θ B , A T ( A ⊗ B ) ⏐ ↑ T β A , B T ( B ⊗ A )
Distributive laws between monads were defined by Beck [10 ] to study composite monads. In [6 ] , they were generalised to distribute laws of functors over monads.
Definition A.4 [10 , 6 ] . Let F : C → C F:C\to C F : C → C be an endofunctor and let ( T , μ , η ) (T,\mu,\eta) ( T , μ , η ) be a monad on C C C . A distributive law of F F F over T T T is a natural transformation γ : F T → T F \gamma:FT\to TF γ : F T → T F making the following diagrams commute:
F T 2 → γ T T F T → T γ T 2 F F μ ↓ ↓ μ F F T → γ T F F → η F T F F η ↓ ↓ T η F T → γ T F \begin{CD}
FT^{2} @>{\gamma T}>> TFT @>{T\gamma}>> T^{2}F \\
@V{F\mu}VV @. @VV{\mu F}V \\
FT @>{\gamma}>> TF
\end{CD}
\qquad
\begin{CD}
F @>{\eta F}>> TF \\
@V{F\eta}VV @VV{T\eta}V \\
FT @>{\gamma}>> TF
\end{CD} F T 2 F μ ↓ ⏐ F T γ T γ T F T T F T γ T 2 F ↓ ⏐ μ F F F η ↓ ⏐ F T η F γ T F ↓ ⏐ T η T F
Construction of σ ∗ \sigma^{*} σ ∗
For a varietor F F F with strength σ \sigma σ , the construction of a strength σ ∗ \sigma^{*} σ ∗ for F ∗ F^{*} F ∗ is somewhat folklore. McDermott and Uustalu [44 ] provide a nice characterisation in terms of strongly free algebras . We summarise their results in Proposition B.2.
▶ Definition B.1. Let C \mathcal{C} C be a monoidal category, let F : C → C F:\mathcal{C}\to\mathcal{C} F : C → C be a functor with strength σ \sigma σ , and let A ∈ C A\in\mathcal{C} A ∈ C . A strongly free F F F -algebra over A A A consists of an F F F -algebra ( F ∗ A , ζ A ) (F^*A,\zeta_A) ( F ∗ A , ζ A ) and a map η A : A → F ∗ A \eta_A:A\to F^*A η A : A → F ∗ A s.t. for all objects X ∈ C X\in\mathcal{C} X ∈ C , F F F -algebras ( B , b ) (B,b) ( B , b ) , and maps f : X ⊗ A → B f:X\otimes A\to B f : X ⊗ A → B , there exists a unique map f ~ : X ⊗ F ∗ A → B \widetilde{f}:X\otimes F^*A\to B f : X ⊗ F ∗ A → B making the following diagrams commute:
X ⊗ F F ∗ A → σ X , F ∗ A F ( X ⊗ F ∗ A ) → F f ~ F B ↓ 1 X ⊗ ζ A ↓ b X ⊗ F ∗ A → f ~ B X ⊗ A → f B ↓ 1 X ⊗ η A ↑ f ~ X ⊗ F ∗ A \begin{array}{ccccc}
X\otimes FF^*A & \xrightarrow{\sigma_{X,F^*A}} & F(X\otimes F^*A) & \xrightarrow{F\widetilde{f}} & FB \\
\downarrow{1_X\otimes\zeta_A} & & & & \downarrow{b} \\
X\otimes F^*A & \xrightarrow{\widetilde{f}} & B
\end{array}
\qquad
\begin{array}{ccc}
X\otimes A & \xrightarrow{f} & B \\
\downarrow{1_X\otimes\eta_A} & & \uparrow{\widetilde{f}} \\
X\otimes F^*A & &
\end{array} X ⊗ F F ∗ A ↓ 1 X ⊗ ζ A X ⊗ F ∗ A σ X , F ∗ A f F ( X ⊗ F ∗ A ) B F f F B ↓ b X ⊗ A ↓ 1 X ⊗ η A X ⊗ F ∗ A f B ↑ f
▶ Proposition B.2. Let C \mathcal{C} C be a monoidal closed category and let F : C → C F:\mathcal{C}\to\mathcal{C} F : C → C be a functor with strength σ \sigma σ . Then every free F F F -algebra is strongly free. In particular, if F F F is a varietor, then F ∗ F^* F ∗ has a strength σ ∗ \sigma^* σ ∗ uniquely characterised by the fact that the following diagrams commute:
A ⊗ F F ∗ B → σ A , F ∗ B F ( A ⊗ F ∗ B ) → F σ A , B ∗ F F ∗ ( A ⊗ B ) ↓ 1 A ⊗ ζ B ↓ ζ A ⊗ B A ⊗ F ∗ B → σ A , B ∗ F ∗ ( A ⊗ B ) A ⊗ B → η A ⊗ B F ∗ ( A ⊗ B ) ↓ 1 A ⊗ η B ↑ σ A , B ∗ A ⊗ F ∗ B \begin{array}{ccccc}
A\otimes FF^*B & \xrightarrow{\sigma_{A,F^*B}} & F(A\otimes F^*B) & \xrightarrow{F\sigma^*_{A,B}} & FF^*(A\otimes B) \\
\downarrow{1_A\otimes\zeta_B} & & & & \downarrow{\zeta_{A\otimes B}} \\
A\otimes F^*B & \xrightarrow{\sigma^*_{A,B}} & F^*(A\otimes B)
\end{array}
\qquad
\begin{array}{ccc}
A\otimes B & \xrightarrow{\eta_{A\otimes B}} & F^*(A\otimes B) \\
\downarrow{1_A\otimes\eta_B} & & \uparrow{\sigma^*_{A,B}} \\
A\otimes F^*B & &
\end{array} A ⊗ F F ∗ B ↓ 1 A ⊗ ζ B A ⊗ F ∗ B σ A , F ∗ B σ A , B ∗ F ( A ⊗ F ∗ B ) F ∗ ( A ⊗ B ) F σ A , B ∗ F F ∗ ( A ⊗ B ) ↓ ζ A ⊗ B A ⊗ B ↓ 1 A ⊗ η B A ⊗ F ∗ B η A ⊗ B F ∗ ( A ⊗ B ) ↑ σ A , B ∗
Proof of Theorem 3.10
The proof presented here is a generalisation (and simplification) of the one in [39 Appendix C] . We shall prove the following statement, which can be seen as a simplified version of the W-method where k = 0 k=0 k = 0 .
Theorem C.1. Let S S S and M M M be two automata in Aut O ( F ) \operatorname{Aut}_{\mathcal{O}}(F) Aut O ( F ) , let ( c , δ C ) (c,\delta_C) ( c , δ C ) be a state cover for M M M , and let w w w be a state characteriser for S S S . Suppose S S S is observable, and let t : = c ↑ ⋅ w t:=c^{\uparrow}\cdot w t := c ↑ ⋅ w . Then B S ∘ t = B M ∘ t B_S\circ t=B_M\circ t B S ∘ t = B M ∘ t implies B S = B M B_S=B_M B S = B M .
The completeness of the W-method follows from this special case.
Proof of Theorem 3.10. Writing t : = c ↑ k + 1 ⋅ w t:=c^{\uparrow k+1}\cdot w t := c ↑ k + 1 ⋅ w , let M ∈ U c k M\in U_c^k M ∈ U c k , and suppose B S ∘ t = B M ∘ t B_S\circ t=B_M\circ t B S ∘ t = B M ∘ t . By the definition of U c k U_c^k U c k (Definition 3.9 ), there exists δ C \delta_C δ C such that ( c ↑ k , δ C ) (c^{\uparrow k},\delta_C) ( c ↑ k , δ C ) is a state cover for M M M . By assumption, we also have a state characteriser w w w for S S S , and we know that S S S is observable. Since ( c ↑ k ) ↑ = c ↑ k + 1 (c^{\uparrow k})^{\uparrow}=c^{\uparrow k+1} ( c ↑ k ) ↑ = c ↑ k + 1 , Theorem C.1 implies B S = B M B_S=B_M B S = B M .
Before embarking on the proof of Theorem C.1 , we need some auxiliary results.
▶ Proposition C.2. The following triangle commutes:
F ∗ I ⊗ 1 → ρ F ∗ I F ∗ I ↓ 1 F ∗ I ⊗ η 1 ↗ F ∗ I ⊗ F ∗ 1 → ξ F ∗ I \begin{array}{ccccc}
F^*I\otimes1 & \xrightarrow{\rho_{F^*I}} & F^*I \\
\downarrow{1_{F^*I}\otimes\eta_1} & \nearrow& \\
F^*I\otimes F^*1 & \xrightarrow{\xi} & F^*I
\end{array} F ∗ I ⊗ 1 ↓ 1 F ∗ I ⊗ η 1 F ∗ I ⊗ F ∗ 1 ρ F ∗ I ↗ ξ F ∗ I F ∗ I
Proof. The desired triangle is the outside of the commutative diagram below, where the left triangle commutes by Proposition B.2, the middle square commutes by the naturality of η \eta η , and the right triangle commutes by the definition of ζ I ∗ \zeta_I^* ζ I ∗ .
F ∗ I ⊗ 1 → ρ F ∗ I ↓ 1 ⊗ η ↓ η F ∗ I ⊗ F ∗ 1 → σ ∗ F ∗ ( F ∗ I ⊗ 1 ) → F ∗ ρ F ∗ F ∗ I → ζ I ∗ F ∗ I \begin{array}{ccccc}
F^*I\otimes1 & \xrightarrow{\rho} & F^*I \\
\downarrow{1\otimes\eta} & & \downarrow{\eta} \\
F^*I\otimes F^*1 & \xrightarrow{\sigma^*} & F^*(F^*I\otimes1) \xrightarrow{F^*\rho} F^*F^*I \xrightarrow{\zeta_I^*} F^*I
\end{array} F ∗ I ⊗ 1 ↓ 1 ⊗ η F ∗ I ⊗ F ∗ 1 ρ σ ∗ F ∗ I ↓ η F ∗ ( F ∗ I ⊗ 1 ) F ∗ ρ F ∗ F ∗ I ζ I ∗ F ∗ I
Proposition C.3. Let A = ( Q , δ , i , o ) \mathcal{A}=(Q,\delta,i,o) A = ( Q , δ , i , o ) be an automaton. Then the following commutes:
F ∗ I ⊗ F ∗ 1 → ξ F ∗ I r A ⊗ 1 F ∗ 1 ↓ ↓ r A Q ⊗ F ∗ 1 → τ A Q \begin{CD}
F^{*}I\otimes F^{*}1 @>{\xi}>> F^{*}I \\
@V{r_{\mathcal{A}}\otimes1_{F^{*}1}}VV @VV{r_{\mathcal{A}}}V \\
Q\otimes F^{*}1 @>{\tau_{\mathcal{A}}}>> Q
\end{CD} F ∗ I ⊗ F ∗ 1 r A ⊗ 1 F ∗ 1 ↓ ⏐ Q ⊗ F ∗ 1 ξ τ A F ∗ I ↓ ⏐ r A Q
Proof. The desired square is the outside of the following commuting diagram:
F ∗ I ⊗ F ∗ 1 → σ ∗ F ∗ ( F ∗ I ⊗ 1 ) → F ∗ ρ F ∗ F ∗ I → ξ I ∗ F ∗ I r A ⊗ 1 ↓ ↓ F ∗ ( r A ⊗ 1 ) ↓ F ∗ r A ↓ r A Q ⊗ F ∗ 1 → σ ∗ F ∗ ( Q ⊗ 1 ) → F ∗ ρ F ∗ Q → δ ∗ Q \begin{CD}
F^{*}I\otimes F^{*}1 @>{\sigma^{*}}>> F^{*}(F^{*}I\otimes1) @>{F^{*}\rho}>> F^{*}F^{*}I @>{\xi_{I}^{*}}>> F^{*}I \\
@V{r_{\mathcal{A}}\otimes1}VV @VV{F^{*}(r_{\mathcal{A}}\otimes1)}V @VV{F^{*}r_{\mathcal{A}}}V @VV{r_{\mathcal{A}}}V \\
Q\otimes F^{*}1 @>{\sigma^{*}}>> F^{*}(Q\otimes1) @>{F^{*}\rho}>> F^{*}Q @>{\delta^{*}}>> Q
\end{CD} F ∗ I ⊗ F ∗ 1 r A ⊗ 1 ↓ ⏐ Q ⊗ F ∗ 1 σ ∗ σ ∗ F ∗ ( F ∗ I ⊗ 1 ) ↓ ⏐ F ∗ ( r A ⊗ 1 ) F ∗ ( Q ⊗ 1 ) F ∗ ρ F ∗ ρ F ∗ F ∗ I ↓ ⏐ F ∗ r A F ∗ Q ξ I ∗ δ ∗ F ∗ I ↓ ⏐ r A Q
The leftmost and the middle square commute by the naturality of σ ∗ \sigma^{*} σ ∗ and of η \eta η , respectively. The rightmost square commutes since both sides are F F F -algebra homomorphisms out of a free algebra such that precomposing them with η F ∗ I \eta_{F^{*}I} η F ∗ I gives r A r_{\mathcal{A}} r A .
The remainder of this section is devoted to proving Theorem C.1. Hence, we fix a specification S = ( S , δ S , i S , o S ) \mathcal{S}=(S,\delta_{S},i_{S},o_{S}) S = ( S , δ S , i S , o S ) and an implementation M = ( M , δ M , i M , o M ) \mathcal{M}=(M,\delta_{M},i_{M},o_{M}) M = ( M , δ M , i M , o M ) . The strategy is to construct a ‘bisimulation’ between S \mathcal{S} S and M \mathcal{M} M , i.e. a span S ← r 1 R → r 2 M \mathcal{S}\xleftarrow{r_{1}}\mathcal{R}\xrightarrow{r_{2}}\mathcal{M} S r 1 R r 2 M in the category of automata. Since automata connected by a homomorphism share the same behaviour, the theorem follows. The bisimulation R \mathcal{R} R is constructed using the state cover, and the morphisms r 1 r_{1} r 1 and r 2 r_{2} r 2 are given by the reachability maps. The next two lemmas cover parts of this proof.
Lemma C.4. Under the conditions of Theorem C.1, the following diagram commutes:
C → c F ∗ I → r M M c ↓ ↓ o M F ∗ I O r S ↓ S → o S O \begin{CD}
C @>{c}>> F^{*}I @>{r_{\mathcal{M}}}>> M \\
@V{c}VV @. @VV{o_{\mathcal{M}}}V \\
F^{*}I @. @. O \\
@V{r_{\mathcal{S}}}VV @. @. \\
S @>{o_{\mathcal{S}}}>> O
\end{CD} C c ↓ ⏐ F ∗ I r S ↓ ⏐ S c o S F ∗ I O r M M ↓ ⏐ o M O Proof. By assumption, we have o S ∘ r S ∘ t = B S ∘ t = B M ∘ t = o M ∘ r M ∘ t o_{\mathcal{S}}\circ r_{\mathcal{S}}\circ t=B_{\mathcal{S}}\circ t=B_{\mathcal{M}}\circ t=o_{\mathcal{M}}\circ r_{\mathcal{M}}\circ t o S ∘ r S ∘ t = B S ∘ t = B M ∘ t = o M ∘ r M ∘ t . Thus, it suffices to show that t ∘ f = c t\circ f=c t ∘ f = c for some morphism f : C → C ↑ ⊗ W f:C\to C^{\uparrow}\otimes W f : C → C ↑ ⊗ W . Since w w w is a state characteriser, we have η 1 ≤ w \eta_{1}\leq w η 1 ≤ w , i.e. there is a morphism i W : 1 → W i_{W}:1\to W i W : 1 → W with w ∘ i W = η 1 w\circ i_{W}=\eta_{1} w ∘ i W = η 1 . Hence, we can take f : = C → ρ C − 1 C ⊗ 1 → κ 1 ⊗ i W ( C + F C ) ⊗ W = C ↑ ⊗ W f:=C\xrightarrow{\rho_{C}^{-1}}C\otimes1\xrightarrow{\kappa_{1}\otimes i_{W}}(C+FC)\otimes W=C^{\uparrow}\otimes W f := C ρ C − 1 C ⊗ 1 κ 1 ⊗ i W ( C + F C ) ⊗ W = C ↑ ⊗ W .
The equality t ∘ f = c t\circ f=c t ∘ f = c follows from the following commuting diagram, using Proposition C.2:
C → ρ C − 1 C ⊗ 1 → κ 1 ⊗ i W C ↑ ⊗ W c ↓ ↓ c ⊗ 1 1 ↓ c ↑ ⊗ w F ∗ I → ρ F ∗ I − 1 F ∗ I ⊗ 1 → 1 F ∗ I ⊗ η 1 F ∗ I ⊗ F ∗ 1 ρ F ∗ I ↓ ↓ ξ F ∗ I = F ∗ I \begin{CD}
C @>{\rho_{C}^{-1}}>> C\otimes1 @>{\kappa_{1}\otimes i_{W}}>> C^{\uparrow}\otimes W \\
@V{c}VV @VV{c\otimes1_{1}}V @VV{c^{\uparrow}\otimes w}V \\
F^{*}I @>{\rho_{F^{*}I}^{-1}}>> F^{*}I\otimes1 @>{1_{F^{*}I}\otimes\eta_{1}}>> F^{*}I\otimes F^{*}1 \\
@. @V{\rho_{F^{*}I}}VV @VV{\xi}V \\
@. F^{*}I @= F^{*}I
\end{CD} C c ↓ ⏐ F ∗ I ρ C − 1 ρ F ∗ I − 1 C ⊗ 1 ↓ ⏐ c ⊗ 1 1 F ∗ I ⊗ 1 ρ F ∗ I ↓ ⏐ F ∗ I κ 1 ⊗ i W 1 F ∗ I ⊗ η 1 C ↑ ⊗ W ↓ ⏐ c ↑ ⊗ w F ∗ I ⊗ F ∗ 1 ↓ ⏐ ξ F ∗ I
Lemma C.5. Under the conditions of Theorem C.1, the following diagram commutes:
F S ← F r S F F ∗ I ← F c F C → F c F F ∗ I → F r M F M ↓ δ S ↓ δ C ↓ δ M S ← r S F ∗ I ← c C → c F ∗ I → r M M \begin{array}{ccccc}
FS & \xleftarrow{F r_S} & FF^*I & \xleftarrow{F c} & FC \xrightarrow{F c} FF^*I \xrightarrow{F r_M} FM \\
\downarrow{\delta_S} & & & \downarrow{\delta_C} & & & \downarrow{\delta_M} \\
S & \xleftarrow{r_S} & F^*I & \xleftarrow{c} & C \xrightarrow{c} F^*I \xrightarrow{r_M} M
\end{array} F S ↓ δ S S F r S r S F F ∗ I F ∗ I F c ↓ δ C c F C F c F F ∗ I F r M F M C c F ∗ I r M M ↓ δ M Proof. The right-hand rectangle commutes since r M ∘ c r_M \circ c r M ∘ c is an F F F -algebra homomorphism by the definition of state cover. For the left-hand rectangle, we use that S S S is observable and that w w w is a state characteriser for S S S . Therefore, it suffices to show that the two sides of the rectangle become equal after postcomposing with [ w , 1 O ] ∘ ℓ S [w,1_O] \circ\ell_S [ w , 1 O ] ∘ ℓ S . This follows from the commuting diagram below, where we use again that ( c , δ C ) (c,\delta_C) ( c , δ C ) is a state cover.
F C = F C → δ C C → c F ∗ I → r S S ↓ F c ↓ F c ↓ c ↓ ℓ S F F ∗ I F F ∗ I F ∗ I [ F ∗ 1 , O ] ↓ F r S ↓ F r M ↓ r M ↓ [ w , 1 O ] F S ⟶ F M ⟶ M ⟶ [ F ∗ 1 , O ] ⟶ [ W , O ] ↓ δ S ↓ δ M ↓ ℓ M ↙ [ w , 1 O ] S → ℓ S [ F ∗ 1 , O ] → [ w , 1 O ] [ W , O ] \begin{array}{ccccccccc}
FC & = & FC & \xrightarrow{\delta_C} & C & \xrightarrow{c} & F^*I & \xrightarrow{r_S} & S \\
\downarrow{F c} & & \downarrow{F c} & & \downarrow{c} & & & & \downarrow{\ell_S} \\
FF^*I & & FF^*I & & F^*I & & & & [F^*1,O] \\
\downarrow{F r_S} & & \downarrow{F r_M} & & \downarrow{r_M} & & & & \downarrow{[w,1_O]} \\
FS & \longrightarrow& FM & \longrightarrow& M & \longrightarrow& [F^*1,O] & \longrightarrow& [W,O] \\
\downarrow{\delta_S} & & & \downarrow{\delta_M} & \downarrow{\ell_M} & \swarrow{[w,1_O]} & & & \\
S & \xrightarrow{\ell_S} & [F^*1,O] & \xrightarrow{[w,1_O]} & [W,O] & & & &
\end{array} F C ↓ F c F F ∗ I ↓ F r S F S ↓ δ S S = ⟶ ℓ S F C ↓ F c F F ∗ I ↓ F r M F M [ F ∗ 1 , O ] δ C ⟶ ↓ δ M [ w , 1 O ] C ↓ c F ∗ I ↓ r M M ↓ ℓ M [ W , O ] c ⟶ ↙ [ w , 1 O ] F ∗ I [ F ∗ 1 , O ] r S ⟶ S ↓ ℓ S [ F ∗ 1 , O ] ↓ [ w , 1 O ] [ W , O ] It remains to show the commutativity of the areas labelled (1) and (2).
(1) Taking adjuncts and writing ε \varepsilon ε for the evaluation map, we need to show
ε ∘ ( 1 [ F ∗ 1 , O ] ⊗ w ) ∘ ( ( ℓ S ∘ r S ∘ c ) ⊗ 1 W ) = ε ∘ ( 1 [ F ∗ 1 , O ] ⊗ w ) ∘ ( ( ℓ M ∘ r M ∘ c ) ⊗ 1 W ) . \varepsilon\circ(1_{[F^*1,O]} \otimes w) \circ((\ell_S \circ r_S \circ c) \otimes1_W) = \varepsilon\circ(1_{[F^*1,O]} \otimes w) \circ((\ell_M \circ r_M \circ c) \otimes1_W). ε ∘ ( 1 [ F ∗ 1 , O ] ⊗ w ) ∘ (( ℓ S ∘ r S ∘ c ) ⊗ 1 W ) = ε ∘ ( 1 [ F ∗ 1 , O ] ⊗ w ) ∘ (( ℓ M ∘ r M ∘ c ) ⊗ 1 W ) . Rearranging and using the definition of the observability map, this is equivalent to
o S ∘ τ S ∘ ( r S ⊗ 1 F ∗ 1 ) ∘ ( c ⊗ w ) = o M ∘ τ M ∘ ( r M ⊗ 1 F ∗ 1 ) ∘ ( c ⊗ w ) . o_S \circ\tau_S \circ(r_S \otimes1_{F^*1}) \circ(c \otimes w) = o_M \circ\tau_M \circ(r_M \otimes1_{F^*1}) \circ(c \otimes w). o S ∘ τ S ∘ ( r S ⊗ 1 F ∗ 1 ) ∘ ( c ⊗ w ) = o M ∘ τ M ∘ ( r M ⊗ 1 F ∗ 1 ) ∘ ( c ⊗ w ) . This equality follows from the assumption B S ∘ t = B M ∘ t B_S \circ t = B_M \circ t B S ∘ t = B M ∘ t by precomposing both sides with ( κ 1 ⊗ 1 W ) : C ⊗ W → ( C + F F C ) ⊗ W = C ↑ ⊗ W (\kappa_1 \otimes1_W): C \otimes W \to(C +_F FC) \otimes W = C^{\uparrow} \otimes W ( κ 1 ⊗ 1 W ) : C ⊗ W → ( C + F F C ) ⊗ W = C ↑ ⊗ W . Equality of the left sides is justified by the diagram below, using Proposition C.3; the right side is treated analogously.
C ⊗ W → c ⊗ w F ∗ I ⊗ F ∗ 1 → r S ⊗ 1 S ⊗ F ∗ 1 ↓ κ 1 ⊗ 1 ↙ c ↑ ⊗ w ↓ ξ ↓ τ S C ↑ ⊗ W → t F ∗ I → r S S → o S O ↘ B S \begin{array}{ccccc}
C \otimes W & \xrightarrow{c \otimes w} & F^*I \otimes F^*1 & \xrightarrow{r_S \otimes1} & S \otimes F^*1 \\
\downarrow{\kappa_1 \otimes1} & \swarrow{c^{\uparrow}\otimes w} & \downarrow{\xi} & & \downarrow{\tau_S} \\
C^{\uparrow} \otimes W & \xrightarrow{t} & F^*I & \xrightarrow{r_S} & S \xrightarrow{o_S} O \\
& & & \searrow{B_S} & &
\end{array} C ⊗ W ↓ κ 1 ⊗ 1 C ↑ ⊗ W c ⊗ w ↙ c ↑ ⊗ w t F ∗ I ⊗ F ∗ 1 ↓ ξ F ∗ I r S ⊗ 1 r S ↘ B S S ⊗ F ∗ 1 ↓ τ S S o S O (2) The proof is similar to the previous part. Taking adjuncts, we need to show
ε ∘ ( 1 ⊗ w ) ∘ ( ( ℓ S ∘ δ S ∘ F r S ∘ F c ) ⊗ 1 ) = ε ∘ ( 1 ⊗ w ) ∘ ( ( ℓ M ∘ δ M ∘ F r M ∘ F c ) ⊗ 1 ) . \varepsilon\circ(1 \otimes w) \circ((\ell_S \circ\delta_S \circ F r_S \circ F c) \otimes1) = \varepsilon\circ(1 \otimes w) \circ((\ell_M \circ\delta_M \circ F r_M \circ F c) \otimes1). ε ∘ ( 1 ⊗ w ) ∘ (( ℓ S ∘ δ S ∘ F r S ∘ F c ) ⊗ 1 ) = ε ∘ ( 1 ⊗ w ) ∘ (( ℓ M ∘ δ M ∘ F r M ∘ F c ) ⊗ 1 ) . Rearranging and using the definition of the observability map, this is equivalent to
o S ∘ τ S ∘ ( δ S ⊗ 1 ) ∘ ( F r S ⊗ 1 ) ∘ ( F c ⊗ w ) = o M ∘ τ M ∘ ( δ M ⊗ 1 ) ∘ ( F r M ⊗ 1 ) ∘ ( F c ⊗ w ) . o_S \circ\tau_S \circ(\delta_S \otimes1) \circ(F r_S \otimes1) \circ(F c \otimes w) = o_M \circ\tau_M \circ(\delta_M \otimes1) \circ(F r_M \otimes1) \circ(F c \otimes w). o S ∘ τ S ∘ ( δ S ⊗ 1 ) ∘ ( F r S ⊗ 1 ) ∘ ( F c ⊗ w ) = o M ∘ τ M ∘ ( δ M ⊗ 1 ) ∘ ( F r M ⊗ 1 ) ∘ ( F c ⊗ w ) . This equality follows from the assumption B S ∘ t = B M ∘ t B_S \circ t = B_M \circ t B S ∘ t = B M ∘ t by precomposing both sides with ( κ 2 ⊗ 1 W ) : F C ⊗ W → ( C + F F C ) ⊗ W = C ↑ ⊗ W (\kappa_2 \otimes1_W): FC \otimes W \to(C +_F FC) \otimes W = C^{\uparrow} \otimes W ( κ 2 ⊗ 1 W ) : F C ⊗ W → ( C + F F C ) ⊗ W = C ↑ ⊗ W . Equality of the left sides
is justified by the diagram below, using Proposition C.3 and that r S r_S r S is an F F F -algebra homomorphism; the right side is treated analogously.
F C ⊗ W → F c ⊗ w F F ∗ I ⊗ F ∗ 1 → F r S ⊗ 1 F S ⊗ F ∗ 1 κ 2 ⊗ 1 ↓ ζ I ⊗ 1 ↓ δ S ⊗ 1 ↓ C † ⊗ W → c † ⊗ w F ∗ I ⊗ F ∗ 1 → r S ⊗ 1 S ⊗ F ∗ 1 t ↓ ξ ↓ τ S ↓ F ∗ I → r S S → o S O \begin{CD}
FC \otimes W @>{F c \otimes w}>> FF^* I \otimes F^*1 @>{F r_S \otimes1}>> FS \otimes F^*1 \\
@V{\kappa_2 \otimes1}VV @V{\zeta_I \otimes1}VV @V{\delta_S \otimes1}VV \\
C^\dagger\otimes W @>{c^\dagger\otimes w}>> F^* I \otimes F^*1 @>{r_S \otimes1}>> S \otimes F^*1 \\
@V{t}VV @V{\xi}VV @V{\tau_S}VV \\
F^*I @>{r_S}>> S @>{o_S}>> O
\end{CD} F C ⊗ W κ 2 ⊗ 1 ↓ ⏐ C † ⊗ W t ↓ ⏐ F ∗ I F c ⊗ w c † ⊗ w r S F F ∗ I ⊗ F ∗ 1 ζ I ⊗ 1 ↓ ⏐ F ∗ I ⊗ F ∗ 1 ξ ↓ ⏐ S F r S ⊗ 1 r S ⊗ 1 o S F S ⊗ F ∗ 1 δ S ⊗ 1 ↓ ⏐ S ⊗ F ∗ 1 τ S ↓ ⏐ O
Proof of Theorem C.1. Since ( c , δ C ) (c,\delta_C) ( c , δ C ) is a state cover, we have η I ≤ c \eta_I \leq c η I ≤ c , i.e. there exists a map i C : I → C i_C\colon I \to C i C : I → C with c ∘ i C = η I c \circ i_C = \eta_I c ∘ i C = η I . Thus, we can define an automaton R : = ( C , δ C , i C , B S ∘ c ) \mathcal{R} := (C,\delta_C,i_C,B_S \circ c) R := ( C , δ C , i C , B S ∘ c ) . Since r S ∘ c ∘ i C = r S ∘ η I = i S r_S \circ c \circ i_C = r_S \circ\eta_I = i_S r S ∘ c ∘ i C = r S ∘ η I = i S , the map r S ∘ c r_S \circ c r S ∘ c preserves initial states; similarly for r M ∘ c r_M \circ c r M ∘ c . By Lemmas C.4 and C.5, these maps also preserve transitions and outputs; hence, they are automata homomorphisms. Therefore, we obtain a span of automata S ← r S ∘ c R → r M ∘ c M S \xleftarrow{r_S \circ c} R \xrightarrow{r_M \circ c} M S r S ∘ c R r M ∘ c M . Since the existence of a homomorphism between two automata implies that they have the same behaviour [6 ] , it follows that B S = B M B_S = B_M B S = B M , as desired.
Proof of Theorem 4.7
We first recall Mulry’s construction1 of F E M F_{\mathrm{EM}} F EM and φ \varphi φ [47 Lemma 2.20] (which is slightly more general). We then verify properties (1) and (2) and conclude with the uniqueness argument.
Construction of F E M F_{\mathrm{EM}} F EM . For any T T T -algebra A = ( A , a ) A = (A,a) A = ( A , a ) , the parallel pair S F T A ⇉ S F A SF^T A \rightrightarrows SF A S F T A ⇉ S F A is reflexive, with common section S F η A T SF\eta^T_A S F η A T . Hence, we can define F E M A F_{\mathrm{EM}}A F EM A as the coequaliser
S F T A ⇉ μ F A ∘ S γ A S F a S F A → q A F E M A S F^T A \underset{SF a}{\overset{\mu_{F A} \circ S\gamma_A}{\rightrightarrows}} S F A \xrightarrow{q_A} F_{\mathrm{EM}} A S F T A S F a ⇉ μ F A ∘ S γ A S F A q A F EM A
in E M ( T ) \mathrm{EM}(T) EM ( T ) , which exists by Assumption 4.3. For a map of algebras f : A → B f\colon A \to B f : A → B , where B = ( B , b ) B = (B,b) B = ( B , b ) , we define the map F E M f F_{\mathrm{EM}}f F EM f using the universal property of the coequaliser F E M A F_{\mathrm{EM}}A F EM A :
S F T A → μ F A ∘ S γ A S F A → q A F E M A S F T f ↓ S F f ↓ F E M f ↓ S F T B → μ F B ∘ S γ B S F B → q B F E M B \begin{CD}
S F^T A @>{\mu_{F A} \circ S\gamma_A}>> S F A @>{q_A}>> F_{\mathrm{EM}} A \\
@V{S F^T f}VV @V{S F f}VV @V{F_{\mathrm{EM}}f}VV \\
S F^T B @>{\mu_{F B} \circ S\gamma_B}>> S F B @>{q_B}>> F_{\mathrm{EM}} B
\end{CD} S F T A S F T f ↓ ⏐ S F T B μ F A ∘ S γ A μ F B ∘ S γ B S F A S F f ↓ ⏐ S F B q A q B F EM A F EM f ↓ ⏐ F EM B
Here, the left square commutes ‘serially’: we have S F f ∘ μ F A ∘ S γ A = μ F B ∘ S γ B ∘ S F T f S F f \circ\mu_{F A} \circ S\gamma_A = \mu_{F B} \circ S\gamma_B \circ S F^T f S F f ∘ μ F A ∘ S γ A = μ F B ∘ S γ B ∘ S F T f by the naturality of μ \mu μ and γ \gamma γ , and S F f ∘ S F a = S F b ∘ S F T f S F f \circ S F a = S F b \circ S F^T f S F f ∘ S F a = S F b ∘ S F T f since f f f preserves the T T T -algebra structure. This implies that the morphism q B ∘ S F f q_B \circ S F f q B ∘ S F f coequalises the upper parallel pair; thus, the coequaliser F E M A F_{\mathrm{EM}}A F EM A induces a map F E M f : F E M A → F E M B F_{\mathrm{EM}}f\colon F_{\mathrm{EM}}A \to F_{\mathrm{EM}}B F EM f : F EM A → F EM B with F E M f ∘ q A = q B ∘ S F f F_{\mathrm{EM}}f \circ q_A = q_B \circ S F f F EM f ∘ q A = q B ∘ S F f . One can check that F E M F_{\mathrm{EM}} F EM preserves composition and identities using that q A q_A q A is an epi.
Construction of φ \varphi φ . Consider the following diagram:
S F T 2 A → μ F T A ∘ S γ T A S F T A → q S A F E M S A S γ T A ↓ S γ A ↓ φ A ↑ S T F T A S T F A S F A S T γ A ↓ μ F A ↑ q S A ∘ S F T η A T ↑ S T 2 F A → μ T F A S T F A → μ F A S F A \begin{CD}
SFT^{2}A @>{\mu_{FTA}\circ S\gamma_{TA}}>> SFTA @>{q_{SA}}>> F_{\mathrm{EM}}SA \\
@V{S\gamma_{TA}}VV @V{S\gamma_A}VV @A{\varphi_A}AA \\
STFTA @. STFA @. SFA \\
@V{ST\gamma_A}VV @. @A{\mu_{FA}}AA @A{q_{SA}\circ SFT\eta_A^T}AA \\
ST^{2}FA @>{\mu_{TFA}}>> STFA @>{\mu_{FA}}>> SFA
\end{CD} S F T 2 A S γ T A ↓ ⏐ S T F T A S T γ A ↓ ⏐ S T 2 F A μ F T A ∘ S γ T A μ T F A S F T A S γ A ↓ ⏐ S T F A S T F A q S A μ F A F EM S A φ A ⏐ ↑ S F A μ F A ⏐ ↑ S F A q S A ∘ S F T η A T ⏐ ↑
The left square commutes serially: the upper square commutes by the naturality of μ \mu μ , and the lower square commutes by the multiplication axiom of distributive laws. Since the bottom row is a fork, this implies that the morphism μ F A ∘ S γ A \mu_{FA}\circ S\gamma_A μ F A ∘ S γ A coequalises the upper parallel pair. Hence, we get an induced morphism φ A : F E M S A → S F A \varphi_A:F_{\mathrm{EM}}SA\to SFA φ A : F EM S A → S F A with φ A ∘ q S A = μ F A ∘ S γ A \varphi_A\circ q_{SA}=\mu_{FA}\circ S\gamma_A φ A ∘ q S A = μ F A ∘ S γ A .
It remains to check that φ \varphi φ is natural and an isomorphism. Naturality of φ \varphi φ follows from the following calculation using that q S A q_{SA} q S A is epic, where f : A → B f:A\to B f : A → B :
φ B ∘ F E M S f ∘ q S A = φ B ∘ q S B ∘ S F T f = μ F B ∘ S γ B ∘ S F T f = μ F B ∘ S T F f ∘ S γ A = S F f ∘ μ F A ∘ S γ A = S F f ∘ φ A ∘ q S A . \begin{aligned}
\varphi_B\circ F_{\mathrm{EM}}Sf\circ q_{SA}
&=\varphi_B\circ q_{SB}\circ SFTf
=\mu_{FB}\circ S\gamma_B\circ SFTf\\
&=\mu_{FB}\circ STFf\circ S\gamma_A
=SFf\circ\mu_{FA}\circ S\gamma_A
=SFf\circ\varphi_A\circ q_{SA}.
\end{aligned} φ B ∘ F EM S f ∘ q S A = φ B ∘ q S B ∘ S F T f = μ F B ∘ S γ B ∘ S F T f = μ F B ∘ S T F f ∘ S γ A = S F f ∘ μ F A ∘ S γ A = S F f ∘ φ A ∘ q S A .
The inverse of φ A \varphi_A φ A is φ A − 1 = q S A ∘ S F η A T \varphi_A^{-1}=q_{SA}\circ SF\eta_A^T φ A − 1 = q S A ∘ S F η A T . We check that both roundtrips are the identity:
φ A ∘ φ A − 1 = φ A ∘ q S A ∘ S F η A T = μ F A ∘ S γ A ∘ S F η A T = μ F A ∘ S η F A T = 1 , \varphi_A\circ\varphi_A^{-1}
=\varphi_A\circ q_{SA}\circ SF\eta_A^T
=\mu_{FA}\circ S\gamma_A\circ SF\eta_A^T
=\mu_{FA}\circ S\eta_{FA}^T
=1, φ A ∘ φ A − 1 = φ A ∘ q S A ∘ S F η A T = μ F A ∘ S γ A ∘ S F η A T = μ F A ∘ S η F A T = 1 ,
and, using the definition of q S A q_{SA} q S A as the coequaliser of μ F T A ∘ S γ T A \mu_{FTA}\circ S\gamma_{TA} μ F T A ∘ S γ T A and S F μ A SF\mu_A S F μ A :
φ A − 1 ∘ φ A ∘ q S A = q S A ∘ S F η A T ∘ μ F A ∘ S γ A = q S A ∘ μ F T A ∘ S T F η A T ∘ S γ A = q S A ∘ μ F T A ∘ S γ T A ∘ S F T η A T = q S A ∘ S F μ A ∘ S F T η A T = q S A , \begin{aligned}
\varphi_A^{-1}\circ\varphi_A\circ q_{SA}
&=q_{SA}\circ SF\eta_A^T\circ\mu_{FA}\circ S\gamma_A
=q_{SA}\circ\mu_{FTA}\circ STF\eta_A^T\circ S\gamma_A\\
&=q_{SA}\circ\mu_{FTA}\circ S\gamma_{TA}\circ SFT\eta_A^T
=q_{SA}\circ SF\mu_A\circ SFT\eta_A^T
=q_{SA},
\end{aligned} φ A − 1 ∘ φ A ∘ q S A = q S A ∘ S F η A T ∘ μ F A ∘ S γ A = q S A ∘ μ F T A ∘ S T F η A T ∘ S γ A = q S A ∘ μ F T A ∘ S γ T A ∘ S F T η A T = q S A ∘ S F μ A ∘ S F T η A T = q S A ,
which implies φ A − 1 ∘ φ A = 1 \varphi_A^{-1}\circ\varphi_A=1 φ A − 1 ∘ φ A = 1 since q S A q_{SA} q S A is epic.
Properties of F E M F_{\mathrm{EM}} F EM . We check that F E M F_{\mathrm{EM}} F EM satisfies properties (1) and (2) in the theorem.
(2) We use that q S T A q_{STA} q S T A is an epi and calculate as follows:
φ A ∘ F E M μ A ∘ q S T A = φ A ∘ q S A ∘ S F μ A = μ F A ∘ S γ A ∘ S F μ A = μ F A ∘ S μ F A ∘ S T γ A ∘ S γ T A = μ F A ∘ μ T F A ∘ S T γ A ∘ S γ T A = μ F A ∘ S γ A ∘ μ F T A ∘ S γ T A = μ F A ∘ S γ A ∘ φ T A ∘ q S T A . \begin{aligned}
\varphi_A\circ F_{\mathrm{EM}}\mu_A\circ q_{STA}
&=\varphi_A\circ q_{SA}\circ SF\mu_A
=\mu_{FA}\circ S\gamma_A\circ SF\mu_A\\
&=\mu_{FA}\circ S\mu_{FA}\circ ST\gamma_A\circ S\gamma_{TA}
=\mu_{FA}\circ\mu_{TFA}\circ ST\gamma_A\circ S\gamma_{TA}\\
&=\mu_{FA}\circ S\gamma_A\circ\mu_{FTA}\circ S\gamma_{TA}
=\mu_{FA}\circ S\gamma_A\circ\varphi_{TA}\circ q_{STA}.
\end{aligned} φ A ∘ F EM μ A ∘ q S T A = φ A ∘ q S A ∘ S F μ A = μ F A ∘ S γ A ∘ S F μ A = μ F A ∘ S μ F A ∘ S T γ A ∘ S γ T A = μ F A ∘ μ T F A ∘ S T γ A ∘ S γ T A = μ F A ∘ S γ A ∘ μ F T A ∘ S γ T A = μ F A ∘ S γ A ∘ φ T A ∘ q S T A .
(1) Let A = ( A , a ) A=(A,a) A = ( A , a ) be a T T T -algebra with canonical presentation S T A → μ A S A → a A STA\xrightarrow{\mu_A}SA\xrightarrow{a}A S T A μ A S A a A . We need to show that the top row in the following diagram is a coequaliser:
F E M S T A → F E M μ A F E M S A → F E M a F E M A φ T A ↓ ≅ φ A ↓ ≅ ∥ ↓ S F T A → μ F A ∘ S γ A S F A → q A F E M A (6) \begin{CD}
F_{\mathrm{EM}}STA @>{F_{\mathrm{EM}}\mu_A}>> F_{\mathrm{EM}}SA @>{F_{\mathrm{EM}}a}>> F_{\mathrm{EM}}A \\
@V{\varphi_{TA}}V{\cong}V @V{\varphi_A}V{\cong}V @V{\Vert}VV \\
SFTA @>{\mu_{FA}\circ S\gamma_A}>> SFA @>{q_A}>> F_{\mathrm{EM}}A \tag*{(6)}
\end{CD} F EM S T A φ T A ↓ ⏐ ≅ S F T A F EM μ A μ F A ∘ S γ A F EM S A φ A ↓ ⏐ ≅ S F A F EM a q A F EM A ∥ ↓ ⏐ F EM A (6)
The left square commutes serially: the upper square commutes by property (2), and the lower square commutes by the naturality of φ \varphi φ . The right square commutes since
q A ∘ φ A ∘ q S A = q A ∘ μ F A ∘ S γ A = q A ∘ S F a = F E M a ∘ q S A q_A\circ\varphi_A\circ q_{SA}
=q_A\circ\mu_{FA}\circ S\gamma_A
=q_A\circ SFa
=F_{\mathrm{EM}}a\circ q_{SA} q A ∘ φ A ∘ q S A = q A ∘ μ F A ∘ S γ A = q A ∘ S F a = F EM a ∘ q S A
and q S A q_{SA} q S A is an epi. Since all vertical arrows are isomorphisms and the bottom row is a coequaliser by definition, it follows that the top row is also a coequaliser.
Uniqueness. Let F E M ′ : E M ( T ) → E M ( T ) F'_{\mathrm{EM}}:\mathrm{EM}(T)\to\mathrm{EM}(T) F EM ′ : EM ( T ) → EM ( T ) be a functor and φ ′ : F E M ′ S ⟶ ≅ S F \varphi':F'_{\mathrm{EM}}S\overset{\cong}{\longrightarrow}SF φ ′ : F EM ′ S ⟶ ≅ S F a natural isomorphism satisfying (1) and (2). Then we get a diagram similar to (6):
F E M ′ S T A ⇉ F E M ′ S A ⟶ F E M ′ A ↓ φ T A ′ ↓ φ A ′ ↓ ι A S F T A ⇉ S F A ⟶ F E M A \begin{aligned}
F'_{\mathrm{EM}}STA &\rightrightarrows F'_{\mathrm{EM}}SA \longrightarrow F'_{\mathrm{EM}}A\\
\downarrow{\varphi'_{TA}} && \downarrow{\varphi'_A} \quad\downarrow{\iota_A}\\
SFTA &\rightrightarrows SFA \longrightarrow F_{\mathrm{EM}}A
\end{aligned} F EM ′ S T A ↓ φ T A ′ S F T A ⇉ F EM ′ S A ⟶ F EM ′ A ⇉ S F A ⟶ F EM A ↓ φ A ′ ↓ ι A
Again, the left squares commute by assumption of property (2) and naturality of φ ′ \varphi' φ ′ . Moreover, the top row is a coequaliser by assumption of property (1), and the bottom row is a coequaliser by definition. Since the left and middle vertical arrows are isomorphisms, we get an induced isomorphism ι A : F E M ′ A ⟶ ≅ F E M A \iota_A:F'_{\mathrm{EM}}A\overset{\cong}{\longrightarrow}F_{\mathrm{EM}}A ι A : F EM ′ A ⟶ ≅ F EM A with ι A ∘ F E M ′ a = q A ∘ φ A ′ \iota_A\circ F'_{\mathrm{EM}}a=q_A\circ\varphi'_A ι A ∘ F EM ′ a = q A ∘ φ A ′ .
To see that ι \iota ι is natural, let B = ( B , b ) B=(B,b) B = ( B , b ) be a T T T -algebra and f : A → B f:A\to B f : A → B a T T T -algebra map. We use that F E M ′ a F'_{\mathrm{EM}}a F EM ′ a is an epimorphism (since it is a coequaliser):
ι B ∘ F E M ′ f ∘ F E M ′ a = ι B ∘ F E M ′ b ∘ F E M ′ S f = q B ∘ φ B ′ ∘ F E M ′ S f = q B ∘ S f ∘ φ A ′ = F E M f ∘ q A ∘ φ A ′ = F E M f ∘ ι A ∘ F E M ′ a . \begin{aligned}
\iota_B\circ F'_{\mathrm{EM}}f\circ F'_{\mathrm{EM}}a
&=\iota_B\circ F'_{\mathrm{EM}}b\circ F'_{\mathrm{EM}}Sf
=q_B\circ\varphi'_B\circ F'_{\mathrm{EM}}Sf\\
&=q_B\circ Sf\circ\varphi'_A
=F_{\mathrm{EM}}f\circ q_A\circ\varphi'_A
=F_{\mathrm{EM}}f\circ\iota_A\circ F'_{\mathrm{EM}}a.
\end{aligned} ι B ∘ F EM ′ f ∘ F EM ′ a = ι B ∘ F EM ′ b ∘ F EM ′ S f = q B ∘ φ B ′ ∘ F EM ′ S f = q B ∘ S f ∘ φ A ′ = F EM f ∘ q A ∘ φ A ′ = F EM f ∘ ι A ∘ F EM ′ a .
Similarly, we have φ A ∘ ι S A = φ A ′ \varphi_A\circ\iota_{SA}=\varphi'_A φ A ∘ ι S A = φ A ′ since F E M ′ μ A F'_{\mathrm{EM}}\mu_A F EM ′ μ A is an epimorphism and
φ A ∘ ι S A ∘ F E M ′ μ A = φ A ∘ q S A ∘ φ T A ′ = μ F A ∘ S γ A ∘ φ T A ′ = φ A ′ ∘ F E M ′ μ A . \varphi_A\circ\iota_{SA}\circ F'_{\mathrm{EM}}\mu_A
=\varphi_A\circ q_{SA}\circ\varphi'_{TA}
=\mu_{FA}\circ S\gamma_A\circ\varphi'_{TA}
=\varphi'_A\circ F'_{\mathrm{EM}}\mu_A. φ A ∘ ι S A ∘ F EM ′ μ A = φ A ∘ q S A ∘ φ T A ′ = μ F A ∘ S γ A ∘ φ T A ′ = φ A ′ ∘ F EM ′ μ A .
Finally, if ι ′ : F E M ′ → F E M \iota':F'_{\mathrm{EM}}\to F_{\mathrm{EM}} ι ′ : F EM ′ → F EM is a natural transformation with φ ∘ ι S ′ = φ ′ \varphi\circ\iota'_S=\varphi' φ ∘ ι S ′ = φ ′ , then the diagram below commutes (where the triangle was shown to be commutative in diagram (6)):
F E M ′ S A ⟶ F E M ′ A ↓ ι S A ′ ↓ ι A ′ F E M S A ⟶ F E M A \begin{aligned}
F'_{\mathrm{EM}}SA &\longrightarrow F'_{\mathrm{EM}}A\\
\downarrow{\iota'_{SA}} && \downarrow{\iota'_A}\\
F_{\mathrm{EM}}SA &\longrightarrow F_{\mathrm{EM}}A
\end{aligned} F EM ′ S A ↓ ι S A ′ F EM S A ⟶ F EM ′ A ⟶ F EM A ↓ ι A ′
Since F E M ′ a F'_{\mathrm{EM}}a F EM ′ a is an epimorphism, we conclude ι A = ι A ′ \iota_A=\iota'_A ι A = ι A ′ , showing the uniqueness of ι \iota ι .
Proof of Lemma 4.10
The map ( φ K l ) A (\varphi_{\mathrm{Kl}})_A ( φ Kl ) A is defined to be identical to φ A \varphi_A φ A , which is an isomorphism. To see naturality, let f : A → T B f:A\to TB f : A → T B be a Kleisli map A → B A\to B A → B . By [46 Theorem 2.2] , the map F K l f : F A → F B F_{\mathrm{Kl}}f:FA\to FB F Kl f : F A → F B is defined as γ B ∘ F f \gamma_B\circ Ff γ B ∘ F f . Using this, the naturality of φ \varphi φ , and diagram (3), we calculate as follows:
( φ K l ) B ∘ F E M K f = φ B ∘ F E M μ B ∘ F E M S f = μ F B ∘ S γ B ∘ φ T B ∘ F E M S f = μ F B ∘ S γ B ∘ S f ∘ φ A = μ F B ∘ S F K l f ∘ φ A = K F K l f ∘ ( φ K l ) A . \begin{aligned}
(\varphi_{\mathrm{Kl}})_B\circ F_{\mathrm{EM}}Kf
&=\varphi_B\circ F_{\mathrm{EM}}\mu_B\circ F_{\mathrm{EM}}Sf
=\mu_{FB}\circ S\gamma_B\circ\varphi_{TB}\circ F_{\mathrm{EM}}Sf\\
&=\mu_{FB}\circ S\gamma_B\circ Sf\circ\varphi_A
=\mu_{FB}\circ SF_{\mathrm{Kl}}f\circ\varphi_A
=KF_{\mathrm{Kl}}f\circ(\varphi_{\mathrm{Kl}})_A.
\end{aligned} ( φ Kl ) B ∘ F EM K f = φ B ∘ F EM μ B ∘ F EM S f = μ F B ∘ S γ B ∘ φ T B ∘ F EM S f = μ F B ∘ S γ B ∘ S f ∘ φ A = μ F B ∘ S F Kl f ∘ φ A = K F Kl f ∘ ( φ Kl ) A .
Proof of Theorem 4.15
In this section, we work under Assumptions 4.2, 4.3, 4.5, and 4.13 and verify the conditions in Assumption 3.2 for C : = E M ( T ) \mathcal{C}:=\mathrm{EM}(T) C := EM ( T ) and F : = F E M \mathcal{F}:=F_{\mathrm{EM}} F := F EM . We begin with the base category.
Lemma F.1. The category E M ( T ) \mathrm{EM}(T) EM ( T ) is symmetric monoidal closed and cocomplete. Proof. By Assumption 4.2, C \mathcal{C} C is symmetric monoidal closed and has equalisers. Furthermore, by Assumption 4.3, T T T is commutative (hence monoidal) and EM ( T ) \operatorname{EM}(T) EM ( T ) has reflexive coequalisers (hence tensors [57 Section 2.2] ). Thus, applying [57 Corollary 2.5.7] , we obtain that EM ( T ) \operatorname{EM}(T) EM ( T ) is monoidal. In fact, examining the proof of [57 Corollary 2.5.7] , we conclude at once that EM ( T ) \operatorname{EM}(T) EM ( T ) is symmetric monoidal closed. Finally, since C \mathcal{C} C is cocomplete by Assumption 4.2, we deduce by [41 Corollary 2] that EM ( T ) \operatorname{EM}(T) EM ( T ) is cocomplete.
Before proceeding with the other conditions, we introduce some notation and results in connection with the monoidal closed structure of EM ( T ) \operatorname{EM}(T) EM ( T ) that will be used in the rest of this proof and also in later proofs. We write ⊠ \boxtimes ⊠ for the monoidal product in EM ( T ) \operatorname{EM}(T) EM ( T ) . The tensor unit in EM ( T ) \operatorname{EM}(T) EM ( T ) is S 1 S1 S 1 , and we write ρ T \rho^{T} ρ T for the right unitor in EM ( T ) \operatorname{EM}(T) EM ( T ) .
The tensor product ⊠ \boxtimes ⊠ in EM ( T ) \operatorname{EM}(T) EM ( T ) is constructed as a certain reflexive coequaliser, similarly to the construction of F EM F_{\operatorname{EM}} F EM . As shown in [57 Proposition 2.3.4] , this tensor product represents bimorphisms . Recall [57 Section 2.1] that for T T T -algebras ( A , a ) (A,a) ( A , a ) , ( B , b ) (B,b) ( B , b ) , and ( C , c ) (C,c) ( C , c ) , a bimorphism ( A , a ) , ( B , b ) → ( C , c ) (A,a),(B,b)\to(C,c) ( A , a ) , ( B , b ) → ( C , c ) is a morphism f : A ⊗ B → C f:A\otimes B\to C f : A ⊗ B → C in C \mathcal{C} C such that the diagram
T A ⊗ T B → θ A , B T ( A ⊗ B ) → T f T C a ⊗ b ↓ ↓ c A ⊗ B → f C \begin{CD}
TA\otimes TB @>{\theta_{A,B}}>> T(A\otimes B) @>{Tf}>> TC\\
@V{a\otimes b}VV @. @VV{c}V\\
A\otimes B @>{f}>> C
\end{CD} T A ⊗ T B a ⊗ b ↓ ⏐ A ⊗ B θ A , B f T ( A ⊗ B ) C T f T C ↓ ⏐ c
commutes. Then for any pair of algebras A , B A,B A , B , we have a bimorphism ω A , B : A , B → A ⊠ B \omega_{A,B}:A,B\to A\boxtimes B ω A , B : A , B → A ⊠ B satisfying the following universal property: for all algebras C C C and bimorphisms f : A , B → C f:A,B\to C f : A , B → C , there exists a unique algebra morphism f ˉ : A ⊠ B → C \bar{f}:A\boxtimes B\to C f ˉ : A ⊠ B → C such that U f ˉ ∘ ω A , B = f U\bar{f}\circ\omega_{A,B}=f U f ˉ ∘ ω A , B = f . Furthermore, the morphisms ω A , B : U A ⊗ U B → U ( A ⊠ B ) \omega_{A,B}:UA\otimes UB\to U(A\boxtimes B) ω A , B : U A ⊗ U B → U ( A ⊠ B ) form a natural transformation.
Lemma F.2. We have isomorphisms θ ˉ A , B : S A ⊠ S B → S ( A ⊗ B ) \bar{\theta}_{A,B}:SA\boxtimes SB\to S(A\otimes B) θ ˉ A , B : S A ⊠ S B → S ( A ⊗ B ) , natural in A , B ∈ C A,B\in\mathcal{C} A , B ∈ C , making the following diagram commute:
T A ⊗ T B → θ A , B T ( A ⊗ B ) ↓ ↓ U S A ⊗ U S B → ω S A , S B U ( S A ⊠ S B ) → U θ ˉ A , B U S ( A ⊗ B ) \begin{CD}
TA\otimes TB @>{\theta_{A,B}}>> T(A\otimes B)\\
@VVV @VVV\\
USA\otimes USB @>{\omega_{SA,SB}}>> U(SA\boxtimes SB) @>{U\bar{\theta}_{A,B}}>> US(A\otimes B)
\end{CD} T A ⊗ T B ↓ ⏐ U S A ⊗ U S B θ A , B ω S A , S B T ( A ⊗ B ) ↓ ⏐ U ( S A ⊠ S B ) U θ ˉ A , B U S ( A ⊗ B ) Proof. The morphism θ ˉ A , B \bar{\theta}_{A,B} θ ˉ A , B is obtained by applying the universal property of ⊠ \boxtimes ⊠ to θ A , B \theta_{A,B} θ A , B , which is a bimorphism S A , S B → S ( A ⊗ B ) SA,SB\to S(A\otimes B) S A , S B → S ( A ⊗ B ) by the multiplication axiom for θ \theta θ . Then the diagram above commutes by definition. The naturality of θ ˉ \bar{\theta} θ ˉ follows from uniqueness for ⊠ \boxtimes ⊠ :
U θ ˉ A ′ , B ′ ∘ U ( S f ⊠ S g ) ∘ ω S A , S B = U θ ˉ A ′ , B ′ ∘ ω S A ′ , S B ′ ∘ ( U S f ⊗ U S g ) = θ A ′ , B ′ ∘ ( T f ⊗ T g ) = T ( f ⊗ g ) ∘ θ A , B = U S ( f ⊗ g ) ∘ U θ ˉ A , B ∘ ω S A , S B . U\bar{\theta}_{A',B'}\circ U(Sf\boxtimes Sg)\circ\omega_{SA,SB}
=
U\bar{\theta}_{A',B'}\circ\omega_{SA',SB'}\circ(USf\otimes USg)
=
\theta_{A',B'}\circ(Tf\otimes Tg)
=
T(f\otimes g)\circ\theta_{A,B}
=
US(f\otimes g)\circ U\bar{\theta}_{A,B}\circ\omega_{SA,SB}. U θ ˉ A ′ , B ′ ∘ U ( S f ⊠ S g ) ∘ ω S A , S B = U θ ˉ A ′ , B ′ ∘ ω S A ′ , S B ′ ∘ ( U S f ⊗ U S g ) = θ A ′ , B ′ ∘ ( T f ⊗ T g ) = T ( f ⊗ g ) ∘ θ A , B = U S ( f ⊗ g ) ∘ U θ ˉ A , B ∘ ω S A , S B . The inverse of θ ˉ A , B \bar{\theta}_{A,B} θ ˉ A , B is given by the free T T T -extension of the composite
A ⊗ B → η A T ⊗ η B T T A ⊗ T B = U S A ⊗ U S B → ω S A , S B U ( S A ⊠ S B ) . A\otimes B\xrightarrow{\eta^{T}_{A}\otimes\eta^{T}_{B}}TA\otimes TB=USA\otimes USB\xrightarrow{\omega_{SA,SB}}U(SA\boxtimes SB). A ⊗ B η A T ⊗ η B T T A ⊗ T B = U S A ⊗ U S B ω S A , S B U ( S A ⊠ S B ) . We check that the two roundtrips are the identity. We have
U θ ˉ A , B ∘ U θ ˉ A , B − 1 ∘ η A ⊗ B T = U θ ˉ A , B ∘ ω S A , S B ∘ ( η A T ⊗ η B T ) = θ A , B ∘ ( η A T ⊗ η B T ) = η A ⊗ B T . U\bar{\theta}_{A,B}\circ U\bar{\theta}^{-1}_{A,B}\circ\eta^{T}_{A\otimes B}
=
U\bar{\theta}_{A,B}\circ\omega_{SA,SB}\circ(\eta^{T}_{A}\otimes\eta^{T}_{B})
=
\theta_{A,B}\circ(\eta^{T}_{A}\otimes\eta^{T}_{B})
=
\eta^{T}_{A\otimes B}. U θ ˉ A , B ∘ U θ ˉ A , B − 1 ∘ η A ⊗ B T = U θ ˉ A , B ∘ ω S A , S B ∘ ( η A T ⊗ η B T ) = θ A , B ∘ ( η A T ⊗ η B T ) = η A ⊗ B T . @♀♀♀♀♀♀references
which implies θ ˉ A , B ∘ θ ˉ A , B − 1 = 1 \bar{\theta}_{A,B} \circ\bar{\theta}^{-1}_{A,B} = 1 θ ˉ A , B ∘ θ ˉ A , B − 1 = 1 using the adjunction S ⊣ U S \dashv U S ⊣ U . Furthermore, writing ν \nu ν for the algebra structure of S A ⊠ S B SA \boxtimes SB S A ⊠ S B and using that ω S A , S B \omega_{SA,SB} ω S A , S B is a bimorphism, we have
U θ ˉ A , B − 1 ∘ U θ ˉ A , B ∘ ω S A , S B = ν ∘ T ω S A , S B ∘ T ( η A T ⊗ η B T ) ∘ θ A , B = ν ∘ T ω S A , S B ∘ θ T A , T B ∘ ( T η A T ⊗ T η B T ) = ω S A , S B ∘ ( μ A ⊗ μ B ) ∘ ( T η A T ⊗ T η B T ) = ω S A , S B , \begin{aligned}
U\bar{\theta}^{-1}_{A,B} \circ U\bar{\theta}_{A,B} \circ\omega_{SA,SB} &= \nu\circ T\omega_{SA,SB} \circ T(\eta^{T}_{A} \otimes\eta^{T}_{B}) \circ\theta_{A,B}\\
&= \nu\circ T\omega_{SA,SB} \circ\theta_{TA,TB} \circ(T\eta^{T}_{A} \otimes T\eta^{T}_{B})\\
&= \omega_{SA,SB} \circ(\mu_{A} \otimes\mu_{B}) \circ(T\eta^{T}_{A} \otimes T\eta^{T}_{B}) = \omega_{SA,SB},
\end{aligned} U θ ˉ A , B − 1 ∘ U θ ˉ A , B ∘ ω S A , S B = ν ∘ T ω S A , S B ∘ T ( η A T ⊗ η B T ) ∘ θ A , B = ν ∘ T ω S A , S B ∘ θ T A , T B ∘ ( T η A T ⊗ T η B T ) = ω S A , S B ∘ ( μ A ⊗ μ B ) ∘ ( T η A T ⊗ T η B T ) = ω S A , S B ,
implying θ ˉ A , B − 1 ∘ θ ˉ A , B = 1 \bar{\theta}^{-1}_{A,B} \circ\bar{\theta}_{A,B} = 1 θ ˉ A , B − 1 ∘ θ ˉ A , B = 1 by the uniqueness part of the universal property of ⊠ \boxtimes ⊠ .
Lemma F.3. The following diagram commutes:
S T A ⊠ S T B → θ ˉ T A , T B S ( T A ⊗ T B ) → S θ A , B S T ( A ⊗ B ) ↓ μ A ⊠ μ B ↓ μ A ⊗ B S A ⊠ S B → θ ˉ A , B S ( A ⊗ B ) \begin{array}{ccccc}
STA \boxtimes STB & \xrightarrow{\bar{\theta}_{TA,TB}} & S(TA \otimes TB) & \xrightarrow{S\theta_{A,B}} & ST(A \otimes B)\\
\downarrow{\mu_A\boxtimes\mu_B} & & & & \downarrow{\mu_{A\otimes B}}\\
SA \boxtimes SB & \xrightarrow{\bar{\theta}_{A,B}} & & & S(A \otimes B)
\end{array} S T A ⊠ S T B ↓ μ A ⊠ μ B S A ⊠ S B θ ˉ T A , T B θ ˉ A , B S ( T A ⊗ T B ) S θ A , B S T ( A ⊗ B ) ↓ μ A ⊗ B S ( A ⊗ B ) Proof. It suffices to show that the two sides become equal after precomposition with ω \omega ω . This holds by the naturality of ω \omega ω , Lemma F.2, and the multiplication axiom for θ \theta θ :
U θ ˉ A , B ∘ U ( μ A ⊠ μ B ) ∘ ω S T A , S T B = U θ ˉ A , B ∘ ω S A , S B ∘ ( μ A ⊗ μ B ) = θ A , B ∘ ( μ A ⊗ μ B ) = μ A ⊗ B ∘ T θ A , B ∘ θ T A , T B = μ A ⊗ B ∘ U S θ A , B ∘ U θ ˉ T A , T B ∘ ω S T A , S T B . \begin{aligned}
U\bar{\theta}_{A,B} \circ U(\mu_A\boxtimes\mu_B) \circ\omega_{STA,STB}
&= U\bar{\theta}_{A,B} \circ\omega_{SA,SB} \circ(\mu_A \otimes\mu_B)\\
&= \theta_{A,B} \circ(\mu_A \otimes\mu_B)\\
&= \mu_{A\otimes B} \circ T\theta_{A,B} \circ\theta_{TA,TB}\\
&= \mu_{A\otimes B} \circ US\theta_{A,B} \circ U\bar{\theta}_{TA,TB} \circ\omega_{STA,STB}.
\end{aligned} U θ ˉ A , B ∘ U ( μ A ⊠ μ B ) ∘ ω S T A , S T B = U θ ˉ A , B ∘ ω S A , S B ∘ ( μ A ⊗ μ B ) = θ A , B ∘ ( μ A ⊗ μ B ) = μ A ⊗ B ∘ T θ A , B ∘ θ T A , T B = μ A ⊗ B ∘ U S θ A , B ∘ U θ ˉ T A , T B ∘ ω S T A , S T B .
As for the closed structure of E M ( T ) \mathrm{EM}(T) EM ( T ) , we write [ − , − ] T [-,-]_T [ − , − ] T for the internal hom in E M ( T ) \mathrm{EM}(T) EM ( T ) . Recall from [37 ] that for algebras ( A , a ) (A,a) ( A , a ) and ( B , b ) (B,b) ( B , b ) , (the carrier of) the algebra [ ( A , a ) , ( B , b ) ] T [(A,a),(B,b)]_T [( A , a ) , ( B , b ) ] T is given by the equaliser of [ A , B ] → [ a , 1 ] [ T A , B ] [A,B] \xrightarrow{[a,1]} [TA,B] [ A , B ] [ a , 1 ] [ T A , B ] and [ A , B ] → χ A , B [ T A , T B ] → [ 1 , b ] [ T A , B ] [A,B] \xrightarrow{\chi_{A,B}} [TA,TB] \xrightarrow{[1,b]} [TA,B] [ A , B ] χ A , B [ T A , T B ] [ 1 , b ] [ T A , B ] , where χ \chi χ is the enrichment of T T T , which can be defined for any commutative monad on a monoidal closed category (see e.g. [38 ] ). Hence, we have a family m A , B : U [ A , B ] T → [ U A , U B ] m_{A,B}: U[A,B]_T \to[UA,UB] m A , B : U [ A , B ] T → [ U A , U B ] for algebras A and B, and this family is natural in A and B. We write Λ T ( f ) : A → [ B , C ] T \Lambda^T(f): A \to[B,C]_T Λ T ( f ) : A → [ B , C ] T for the currying of a T T T -algebra map f : A ⊠ B → C f: A \boxtimes B \to C f : A ⊠ B → C . The evaluation map ε A , B T : [ A , B ] T ⊠ A → B \varepsilon^T_{A,B}: [A,B]_T \boxtimes A \to B ε A , B T : [ A , B ] T ⊠ A → B in E M ( T ) \mathrm{EM}(T) EM ( T ) is defined using the universal property of tensor products as the unique morphism making the following diagram commute, where ε \varepsilon ε is the evaluation map in C \mathcal{C} C :
U [ A , B ] T ⊗ U A → m A , B ⊗ 1 [ U A , U B ] ⊗ U A ↓ ω [ A , B ] T , A ↓ ε U A , U B U ( [ A , B ] T ⊠ A ) → U ε A , B T U B (7) \begin{array}{ccccc}
U[A,B]_T \otimes UA & \xrightarrow{m_{A,B}\otimes1} & [UA,UB]\otimes UA\\
\downarrow{\omega_{[A,B]_T,A}} & & \downarrow{\varepsilon_{UA,UB}}\\
U([A,B]_T\boxtimes A) & \xrightarrow{U\varepsilon^T_{A,B}} & UB \tag*{(7)}
\end{array} U [ A , B ] T ⊗ U A ↓ ω [ A , B ] T , A U ([ A , B ] T ⊠ A ) m A , B ⊗ 1 U ε A , B T [ U A , U B ] ⊗ U A ↓ ε U A , U B U B (7)
Proposition F.4. There is a natural family of isomorphisms ψ A , B : U [ S A , B ] T → ∼ [ A , U B ] \psi_{A,B}: U[SA,B]_T \xrightarrow{\sim} [A,UB] ψ A , B : U [ S A , B ] T ∼ [ A , U B ] for A ∈ C A \in\mathcal{C} A ∈ C and B ∈ E M ( T ) B \in\mathrm{EM}(T) B ∈ EM ( T ) , where ψ A , B \psi_{A,B} ψ A , B is given by the composite
U [ S A , B ] T → m S A , B [ U S A , U B ] = [ T A , U B ] → [ η A T , 1 ] [ A , U B ] . U[SA,B]_T \xrightarrow{m_{SA,B}} [USA,UB] = [TA,UB] \xrightarrow{[\eta^T_A,1]} [A,UB]. U [ S A , B ] T m S A , B [ U S A , U B ] = [ T A , U B ] [ η A T , 1 ] [ A , U B ] . The family ψ A , B \psi_{A,B} ψ A , B internalises the natural bijection E M ( T ) ( S A , B ) ≅ C ( A , U B ) \mathrm{EM}(T)(SA,B) \cong\mathcal{C}(A,UB) EM ( T ) ( S A , B ) ≅ C ( A , U B ) arising from the adjunction S ⊣ U S \dashv U S ⊣ U .
Proof. The naturality of ψ \psi ψ is clear since it is a composite of natural transformations. Writing B = ( B , b ) B=(B,b) B = ( B , b ) , the inverse of ψ A , B \psi_{A,B} ψ A , B is obtained by factoring the composite
[ A , U B ] = [ A , B ] → χ A , B [ T A , T B ] → [ 1 , b ] [ T A , B ] = [ U S A , U B ] . [A,UB] = [A,B] \xrightarrow{\chi_{A,B}} [TA,TB] \xrightarrow{[1,b]} [TA,B] = [USA,UB]. [ A , U B ] = [ A , B ] χ A , B [ T A , T B ] [ 1 , b ] [ T A , B ] = [ U S A , U B ] .
through the equaliser m S A , B m_{S A,B} m S A , B of [ μ A , 1 ] [\mu_A,1] [ μ A , 1 ] and [ 1 , b ] ∘ χ T A , B [1,b]\circ\chi_{T A,B} [ 1 , b ] ∘ χ T A , B . This is possible since
[ 1 , b ] ∘ χ T A , B ∘ [ 1 , b ] ∘ χ A , B = [ 1 , b ] ∘ [ 1 , T b ] ∘ χ T A , T B ∘ χ A , B = [ 1 , b ] ∘ [ 1 , μ B ] ∘ χ T A , T B ∘ χ A , B = ( ∗ ) [ 1 , b ] ∘ [ μ A , 1 ] ∘ χ A , B = [ μ A , 1 ] ∘ [ 1 , b ] ∘ χ A , B . \begin{aligned}
[1,b]\circ\chi_{T A,B}\circ[1,b]\circ\chi_{A,B}=[1,b]\circ[1,Tb]\circ\chi_{T A,T B}\circ\chi_{A,B} \\
&=[1,b]\circ[1,\mu_B]\circ\chi_{T A,T B}\circ\chi_{A,B}\overset{(*)}{=}[1,b]\circ[\mu_A,1]\circ\chi_{A,B}=[\mu_A,1]\circ[1,b]\circ\chi_{A,B}.
\end{aligned} [ 1 , b ] ∘ χ T A , B ∘ [ 1 , b ] ∘ χ A , B = [ 1 , b ] ∘ [ 1 , T b ] ∘ χ T A , T B ∘ χ A , B = [ 1 , b ] ∘ [ 1 , μ B ] ∘ χ T A , T B ∘ χ A , B = ( ∗ ) [ 1 , b ] ∘ [ μ A , 1 ] ∘ χ A , B = [ μ A , 1 ] ∘ [ 1 , b ] ∘ χ A , B .
where in (*) we used that μ \mu μ is an enriched natural transformation. We check that this indeed defines an inverse. Since η T \eta^T η T is an enriched natural transformation, we have
ψ A , B ∘ ψ A , B − 1 = [ η A T , 1 ] ∘ m S A , B ∘ ψ A , B − 1 = [ η A T , 1 ] ∘ [ 1 , b ] ∘ χ A , B = [ 1 , b ] ∘ [ η A T , 1 ] ∘ χ A , B = [ 1 , b ] ∘ [ 1 , η B T ] = 1. \begin{aligned}
\psi_{A,B}\circ\psi^{-1}_{A,B}=[\eta^T_A,1]\circ m_{S A,B}\circ\psi^{-1}_{A,B}=[\eta^T_A,1]\circ[1,b]\circ\chi_{A,B} \\
&=[1,b]\circ[\eta^T_A,1]\circ\chi_{A,B}=[1,b]\circ[1,\eta^T_B]=1.
\end{aligned} ψ A , B ∘ ψ A , B − 1 = [ η A T , 1 ] ∘ m S A , B ∘ ψ A , B − 1 = [ η A T , 1 ] ∘ [ 1 , b ] ∘ χ A , B = [ 1 , b ] ∘ [ η A T , 1 ] ∘ χ A , B = [ 1 , b ] ∘ [ 1 , η B T ] = 1.
Finally, using the definition of m S A , B m_{S A,B} m S A , B as an equaliser, we have
m S A , B ∘ ψ A , B − 1 ∘ ψ A , B = [ 1 , b ] ∘ χ A , B ∘ [ η A T , 1 ] ∘ m S A , B = [ 1 , b ] ∘ [ T η A T , 1 ] ∘ χ T A , B ∘ m S A , B = [ T η A T , 1 ] ∘ [ 1 , b ] ∘ χ T A , B ∘ m S A , B = [ T η A T , 1 ] ∘ [ μ A , 1 ] ∘ m S A , B = m S A , B , \begin{aligned}
m_{S A,B}\circ\psi^{-1}_{A,B}\circ\psi_{A,B}=[1,b]\circ\chi_{A,B}\circ[\eta^T_A,1]\circ m_{S A,B}=[1,b]\circ[T\eta^T_A,1]\circ\chi_{T A,B}\circ m_{S A,B} \\
&=[T\eta^T_A,1]\circ[1,b]\circ\chi_{T A,B}\circ m_{S A,B}=[T\eta^T_A,1]\circ[\mu_A,1]\circ m_{S A,B}=m_{S A,B},
\end{aligned} m S A , B ∘ ψ A , B − 1 ∘ ψ A , B = [ 1 , b ] ∘ χ A , B ∘ [ η A T , 1 ] ∘ m S A , B = [ 1 , b ] ∘ [ T η A T , 1 ] ∘ χ T A , B ∘ m S A , B = [ T η A T , 1 ] ∘ [ 1 , b ] ∘ χ T A , B ∘ m S A , B = [ T η A T , 1 ] ∘ [ μ A , 1 ] ∘ m S A , B = m S A , B ,
which implies ψ A , B − 1 ∘ ψ A , B = 1 \psi^{-1}_{A,B}\circ\psi_{A,B}=1 ψ A , B − 1 ∘ ψ A , B = 1 since m S A , B m_{S A,B} m S A , B is monic. ◀
In the remaining proofs, we will frequently omit the forgetful functor U U U . Thus, if A = ( A , a ) A=(A,a) A = ( A , a ) and B = ( B , b ) B=(B,b) B = ( B , b ) are T T T -algebras, then we will write e.g. ω A , B : A ⊗ B → A ⊠ B \omega_{A,B}:A\otimes B\to A\boxtimes B ω A , B : A ⊗ B → A ⊠ B and m A , B : [ A , B ] T → [ A , B ] m_{A,B}:[A,B]_T\to[A,B] m A , B : [ A , B ] T → [ A , B ] .
We now move on to showing that F E M F_{\mathrm{EM}} F EM admits a strength.
Lemma F.5. There is a family of maps ( σ E M ) A , B : A ⊠ F E M B → F E M ( A ⊠ B ) (\sigma_{\mathrm{EM}})_{A,B}:A\boxtimes F_{\mathrm{EM}}B\to F_{\mathrm{EM}}(A\boxtimes B) ( σ EM ) A , B : A ⊠ F EM B → F EM ( A ⊠ B ) , natural in A A A and B B B , that makes the following diagram commute (where φ \varphi φ and θ ˉ \bar{\theta} θ ˉ are the isomorphisms from Theorem 4.7 and Lemma F.2 , respectively):
S A ⊠ F E M S B → ( σ E M ) S A , S B F E M ( S A ⊠ S B ) → F E M θ ˉ A , B F E M S ( A ⊗ B ) ↓ 1 S A ⊠ φ B ↓ φ A ⊗ B S A ⊠ S F B → θ ˉ A , F B S ( A ⊗ F B ) → S σ A , B S F ( A ⊗ B ) (8) \begin{aligned}
S A\boxtimes F_{\mathrm{EM}}S B&\xrightarrow{(\sigma_{\mathrm{EM}})_{S A,S B}}F_{\mathrm{EM}}(S A\boxtimes S B)\xrightarrow{F_{\mathrm{EM}}\bar{\theta}_{A,B}}F_{\mathrm{EM}}S(A\otimes B)\\
\downarrow{1_{S A}\boxtimes\varphi_B}&&\downarrow{\varphi_{A\otimes B}}\\
S A\boxtimes S F B&\xrightarrow{\bar{\theta}_{A,F B}}S(A\otimes F B)\xrightarrow{S\sigma_{A,B}}S F(A\otimes B) \tag*{(8)}
\end{aligned} S A ⊠ F EM S B ↓ 1 S A ⊠ φ B S A ⊠ S F B ( σ EM ) S A , S B F EM ( S A ⊠ S B ) F EM θ ˉ A , B F EM S ( A ⊗ B ) θ ˉ A , F B S ( A ⊗ F B ) S σ A , B S F ( A ⊗ B ) ↓ φ A ⊗ B (8) The diagram above is reminiscent of the one in Assumption 4.13. It expresses that on free algebras, σ E M \sigma_{\mathrm{EM}} σ EM coincides with S σ S\sigma S σ (up to φ \varphi φ and θ ˉ \bar{\theta} θ ˉ ).
Proof. To construct ( σ E M ) A , B (\sigma_{\mathrm{EM}})_{A,B} ( σ EM ) A , B , we use the observation that the domain of ( σ E M ) A , B (\sigma_{\mathrm{EM}})_{A,B} ( σ EM ) A , B can be described as a coequaliser. To see this, note that since E M ( T ) \mathrm{EM}(T) EM ( T ) is a symmetric monoidal closed category by Lemma F.1, all functors of the form A ⊠ ( − ) A\boxtimes(-) A ⊠ ( − ) or ( − ) ⊠ B (-)\boxtimes B ( − ) ⊠ B for A , B ∈ E M ( T ) A,B\in\mathrm{EM}(T) A , B ∈ EM ( T ) preserve reflexive coequalisers. Hence, by the dual of [34 Corollary 1.2.12] , the tensor product ⊠ \boxtimes ⊠ preserves reflexive coequalisers in both variables together (meaning that it maps pairs of reflexive coequaliser diagrams to coequaliser diagrams). Furthermore, we know by Theorem 4.7 that F E M F_{\mathrm{EM}} F EM preserves canonical presentations. Applying these facts to the canonical presentations of A = ( A , a ) A=(A,a) A = ( A , a ) and B = ( B , b ) B=(B,b) B = ( B , b ) , we get that the left column in the diagram below is a coequaliser:
S T A ⊠ F E M S T B → χ T A , T B F E M ( S T A ⊠ S T B ) ↓ μ A ⊠ F E M μ B ↓ F E M ( μ A ⊠ μ B ) S A ⊠ F E M S B → χ A , B F E M ( S A ⊠ S B ) ↓ a ⊠ F E M b ↓ F E M ( a ⊠ b ) A ⊠ F E M B → ( σ E M ) A , B F E M ( A ⊠ B ) (9) \begin{aligned}
S T A\boxtimes F_{\mathrm{EM}}S T B&\xrightarrow{\chi_{T A,T B}}F_{\mathrm{EM}}(S T A\boxtimes S T B)\\
\downarrow{\mu_A\boxtimes F_{\mathrm{EM}}\mu_B}&&\downarrow{F_{\mathrm{EM}}(\mu_A\boxtimes\mu_B)}\\
S A\boxtimes F_{\mathrm{EM}}S B&\xrightarrow{\chi_{A,B}}F_{\mathrm{EM}}(S A\boxtimes S B)\\
\downarrow{a\boxtimes F_{\mathrm{EM}}b}&&\downarrow{F_{\mathrm{EM}}(a\boxtimes b)}\\
A\boxtimes F_{\mathrm{EM}}B&\xrightarrow{(\sigma_{\mathrm{EM}})_{A,B}}F_{\mathrm{EM}}(A\boxtimes B) \tag*{(9)}
\end{aligned} S T A ⊠ F EM S T B ↓ μ A ⊠ F EM μ B S A ⊠ F EM S B ↓ a ⊠ F EM b A ⊠ F EM B χ T A , T B F EM ( S T A ⊠ S T B ) χ A , B F EM ( S A ⊠ S B ) ( σ EM ) A , B F EM ( A ⊠ B ) ↓ F EM ( μ A ⊠ μ B ) ↓ F EM ( a ⊠ b ) (9)
Hence, if we can construct a family χ A , B : S A ⊠ F E M S B → F E M ( S A ⊠ S B ) \chi_{A,B}:SA\boxtimes\mathrm{FEM}SB\to\mathrm{FEM}(SA\boxtimes SB) χ A , B : S A ⊠ FEM S B → FEM ( S A ⊠ S B ) making the top square in the diagram above serially commutative, then we get an induced morphism ( σ E M ) A , B (\sigma_{\mathrm{EM}})_{A,B} ( σ EM ) A , B making the lower square commute.
To make sure that the resulting map is natural, χ A , B \chi_{A,B} χ A , B should be equal to ( σ E M ) S A , S B (\sigma_{\mathrm{EM}})_{SA,SB} ( σ EM ) S A , S B , the value of which is forced by diagram (8) . Thus, we define χ A , B \chi_{A,B} χ A , B as the composite
S A ⊠ F E M S B ⟶ ≅ S ( A ⊗ F B ) → S σ A , B S F ( A ⊗ B ) ⟶ ≅ F E M ( S A ⊠ S B ) . SA\boxtimes\mathrm{FEM}SB \overset{\cong}{\longrightarrow} S(A\otimes FB)\xrightarrow{S\sigma_{A,B}}SF(A\otimes B)\overset{\cong}{\longrightarrow}\mathrm{FEM}(SA\boxtimes SB). S A ⊠ FEM S B ⟶ ≅ S ( A ⊗ F B ) S σ A , B S F ( A ⊗ B ) ⟶ ≅ FEM ( S A ⊠ S B ) .
where the first isomorphism is the composite
S A ⊠ F E M S B → ≅ 1 ⊠ φ B S A ⊠ S F B → ≅ θ ˉ A , F B S ( A ⊗ F B ) . SA\boxtimes\mathrm{FEM}SB\xrightarrow[\cong]{1\boxtimes\varphi_B}SA\boxtimes SFB\xrightarrow[\cong]{\bar{\theta}_{A,FB}}S(A\otimes FB). S A ⊠ FEM S B 1 ⊠ φ B ≅ S A ⊠ S F B θ ˉ A , F B ≅ S ( A ⊗ F B ) .
and the second isomorphism is (the inverse of) the composite
F E M ( S A ⊠ S B ) → ≅ F E M θ ˉ A , B F E M S ( A ⊗ B ) → ≅ φ A ⊗ B S F ( A ⊗ B ) . \mathrm{FEM}(SA\boxtimes SB)\xrightarrow[\cong]{\mathrm{FEM}\bar{\theta}_{A,B}}\mathrm{FEM}S(A\otimes B)\xrightarrow[\cong]{\varphi_{A\otimes B}}SF(A\otimes B). FEM ( S A ⊠ S B ) FEM θ ˉ A , B ≅ FEM S ( A ⊗ B ) φ A ⊗ B ≅ S F ( A ⊗ B ) .
Since χ \chi χ is a composite of natural transformations, it is itself natural. This implies that the upper square in (9) involving the algebra maps a a a and b b b is commutative. The other upper square is obtained by composing the following three diagrams horizontally:
S T A ⊠ F E M S T B → ≅ 1 ⊠ φ S T A ⊠ S F T B → ≅ θ ˉ S ( T A ⊗ F T B ) ↓ μ ⊠ F E M μ ↓ μ ∘ S θ ∘ S ( 1 ⊗ γ ) S A ⊠ F E M S B → ≅ 1 ⊠ φ S A ⊠ S F B → ≅ θ ˉ S ( A ⊗ F B ) \begin{aligned}
&ST A\boxtimes\mathrm{FEM}ST B \xrightarrow[\cong]{1\boxtimes\varphi}ST A\boxtimes SFT B\xrightarrow[\cong]{\bar{\theta}}S(TA\otimes FTB)\\
&\qquad\downarrow{\mu\boxtimes\mathrm{FEM}\mu}\hspace{8.5em}\downarrow{\mu\circ S\theta\circ S(1\otimes\gamma)}\\
&SA\boxtimes\mathrm{FEM}SB\xrightarrow[\cong]{1\boxtimes\varphi}SA\boxtimes SFB\xrightarrow[\cong]{\bar{\theta}}S(A\otimes FB)
\end{aligned} S T A ⊠ FEM S T B 1 ⊠ φ ≅ S T A ⊠ S F T B θ ˉ ≅ S ( T A ⊗ F T B ) ↓ μ ⊠ FEM μ ↓ μ ∘ S θ ∘ S ( 1 ⊗ γ ) S A ⊠ FEM S B 1 ⊠ φ ≅ S A ⊠ S F B θ ˉ ≅ S ( A ⊗ F B )
S ( T A ⊗ F T B ) → S σ S F ( T A ⊗ T B ) ↓ μ ∘ S θ ∘ S ( 1 ⊗ γ ) ↓ μ ∘ S γ ∘ S F θ S ( A ⊗ F B ) → S σ S F ( A ⊗ B ) \begin{aligned}
&S(TA\otimes FTB)\xrightarrow{S\sigma}SF(TA\otimes TB)\\
&\qquad\downarrow{\mu\circ S\theta\circ S(1\otimes\gamma)}\hspace{8em}\downarrow{\mu\circ S\gamma\circ SF\theta}\\
&S(A\otimes FB)\xrightarrow{S\sigma}SF(A\otimes B)
\end{aligned} S ( T A ⊗ F T B ) S σ S F ( T A ⊗ T B ) ↓ μ ∘ S θ ∘ S ( 1 ⊗ γ ) ↓ μ ∘ S γ ∘ S F θ S ( A ⊗ F B ) S σ S F ( A ⊗ B )
S F ( T A ⊗ T B ) → ≅ φ F E M S ( T A ⊗ T B ) → ≅ F E M θ ˉ F E M ( S T A ⊠ S T B ) ↓ μ ∘ S γ ∘ S F θ ↓ F E M ( μ ⊠ μ ) S F ( A ⊗ B ) ← ≅ φ F E M S ( A ⊗ B ) ← ≅ F E M θ ˉ F E M ( S A ⊠ S B ) \begin{aligned}
&SF(TA\otimes TB)\xrightarrow[\cong]{\varphi}\mathrm{FEM}S(TA\otimes TB)\xrightarrow[\cong]{\mathrm{FEM}\bar{\theta}}\mathrm{FEM}(STA\boxtimes STB)\\
&\qquad\downarrow{\mu\circ S\gamma\circ SF\theta}\hspace{8.5em}\downarrow{\mathrm{FEM}(\mu\boxtimes\mu)}\\
&SF(A\otimes B)\xleftarrow[\cong]{\varphi}\mathrm{FEM}S(A\otimes B)\xleftarrow[\cong]{\mathrm{FEM}\bar{\theta}}\mathrm{FEM}(SA\boxtimes SB)
\end{aligned} S F ( T A ⊗ T B ) φ ≅ FEM S ( T A ⊗ T B ) FEM θ ˉ ≅ FEM ( S T A ⊠ S T B ) ↓ μ ∘ S γ ∘ S F θ ↓ FEM ( μ ⊠ μ ) S F ( A ⊗ B ) φ ≅ FEM S ( A ⊗ B ) FEM θ ˉ ≅ FEM ( S A ⊠ S B )
We now verify the commutativity of each of the three diagrams above in order.
(1) The first diagram commutes by diagram (3) , Lemma F.3, and the naturality of θ ˉ \bar{\theta} θ ˉ :
S T A ⊠ F E M S T B → ≅ 1 ⊠ φ S T A ⊠ S F T B → ≅ θ ˉ S ( T A ⊗ F T B ) ↓ μ ⊠ F E M μ ↓ S ( 1 ⊗ γ ) ↓ S ( 1 ⊗ γ ) S A ⊠ F E M S B → ≅ 1 ⊠ φ S A ⊠ S F B → ≅ θ ˉ S ( A ⊗ F B ) \begin{aligned}
&STA\boxtimes\mathrm{FEM}STB\xrightarrow[\cong]{1\boxtimes\varphi}STA\boxtimes SFTB\xrightarrow[\cong]{\bar{\theta}}S(TA\otimes FTB)\\
&\qquad\downarrow{\mu\boxtimes\mathrm{FEM}\mu}\hspace{5.8em}\downarrow{S(1\otimes\gamma)}\hspace{5.8em}\downarrow{S(1\otimes\gamma)}\\
&SA\boxtimes\mathrm{FEM}SB\xrightarrow[\cong]{1\boxtimes\varphi}SA\boxtimes SFB\xrightarrow[\cong]{\bar{\theta}}S(A\otimes FB)
\end{aligned} S T A ⊠ FEM S T B 1 ⊠ φ ≅ S T A ⊠ S F T B θ ˉ ≅ S ( T A ⊗ F T B ) ↓ μ ⊠ FEM μ ↓ S ( 1 ⊗ γ ) ↓ S ( 1 ⊗ γ ) S A ⊠ FEM S B 1 ⊠ φ ≅ S A ⊠ S F B θ ˉ ≅ S ( A ⊗ F B )
S T A ⊠ S F T B → ≅ 1 ⊠ S γ S T A ⊠ S T F B → θ ˉ S ( T A ⊗ T F B ) ↓ μ ⊠ μ ↓ μ ⊠ μ ↓ S θ S A ⊠ S F B → θ ˉ S ( A ⊗ F B ) \begin{aligned}
&STA\boxtimes SFTB\xrightarrow[\cong]{1\boxtimes S\gamma}STA\boxtimes STFB\xrightarrow{\bar{\theta}}S(TA\otimes TFB)\\
&\qquad\downarrow{\mu\boxtimes\mu}\hspace{8em}\downarrow{\mu\boxtimes\mu}\hspace{8em}\downarrow{S\theta}\\
&SA\boxtimes SFB\xrightarrow{\bar{\theta}}S(A\otimes FB)
\end{aligned} S T A ⊠ S F T B 1 ⊠ S γ ≅ S T A ⊠ S T F B θ ˉ S ( T A ⊗ T F B ) ↓ μ ⊠ μ ↓ μ ⊠ μ ↓ S θ S A ⊠ S F B θ ˉ S ( A ⊗ F B )
(2) The second diagram commutes by Assumption 4.13 and the naturality of μ \mu μ :
S ( T A ⊗ F T B ) → σ S F ( T A ⊗ T B ) ↓ S ( 1 ⊗ γ ) ↓ S F θ S ( T A ⊗ T F B ) S F T ( A ⊗ B ) ↓ S θ ↓ S γ S T ( A ⊗ F B ) → S T σ S T F ( A ⊗ B ) ↓ μ ↓ μ S ( A ⊗ F B ) → σ S F ( A ⊗ B ) \begin{array}{ccc}
S(TA\otimes FTB) & \xrightarrow{\sigma} & SF(TA\otimes TB) \\
\downarrow{S(1\otimes\gamma)} & & \downarrow{SF\theta} \\
S(TA\otimes TFB) & & SFT(A\otimes B) \\
\downarrow{S\theta} & & \downarrow{S\gamma} \\
ST(A\otimes FB) & \xrightarrow{ST\sigma} & STF(A\otimes B) \\
\downarrow{\mu} & & \downarrow{\mu} \\
S(A\otimes FB) & \xrightarrow{\sigma} & SF(A\otimes B)
\end{array} S ( T A ⊗ F T B ) ↓ S ( 1 ⊗ γ ) S ( T A ⊗ T F B ) ↓ S θ S T ( A ⊗ F B ) ↓ μ S ( A ⊗ F B ) σ S T σ σ S F ( T A ⊗ T B ) ↓ S F θ S F T ( A ⊗ B ) ↓ S γ S T F ( A ⊗ B ) ↓ μ S F ( A ⊗ B )
(3) The third diagram commutes by Lemma F.3, diagram (3), and the naturality of φ \varphi φ :
F E M ( S T A ⊠ S T B ) → F E M θ ˉ F E M S ( T A ⊗ T B ) → φ S F ( T A ⊗ T B ) ↓ F E M ( μ ⊠ μ ) ↓ F E M S θ ↓ S F θ F E M ( S A ⊠ S B ) → F E M θ ˉ F E M S ( A ⊗ B ) → φ S F ( A ⊗ B ) ↓ F E M μ ↓ S γ S T F ( A ⊗ B ) S T F ( A ⊗ B ) ↓ μ S F ( A ⊗ B ) \begin{array}{ccccc}
F_{\mathrm{EM}}(ST A\boxtimes ST B) & \xrightarrow{F_{\mathrm{EM}}\bar{\theta}} & F_{\mathrm{EM}}S(TA\otimes TB) & \xrightarrow{\varphi} & SF(TA\otimes TB) \\
\downarrow{F_{\mathrm{EM}}(\mu\boxtimes\mu)} & & \downarrow{F_{\mathrm{EM}}S\theta} & & \downarrow{SF\theta} \\
F_{\mathrm{EM}}(SA\boxtimes SB) & \xrightarrow{F_{\mathrm{EM}}\bar{\theta}} & F_{\mathrm{EM}}S(A\otimes B) & \xrightarrow{\varphi} & SF(A\otimes B) \\
& & \downarrow{F_{\mathrm{EM}}\mu} & & \downarrow{S\gamma} \\
& & STF(A\otimes B) & & STF(A\otimes B) \\
& & & & \downarrow{\mu} \\
& & & & SF(A\otimes B)
\end{array} F EM ( S T A ⊠ S T B ) ↓ F EM ( μ ⊠ μ ) F EM ( S A ⊠ S B ) F EM θ ˉ F EM θ ˉ F EM S ( T A ⊗ T B ) ↓ F EM S θ F EM S ( A ⊗ B ) ↓ F EM μ S T F ( A ⊗ B ) φ φ S F ( T A ⊗ T B ) ↓ S F θ S F ( A ⊗ B ) ↓ S γ S T F ( A ⊗ B ) ↓ μ S F ( A ⊗ B )
It remains to show that σ E M \sigma_{\mathrm{EM}} σ EM is natural and that diagram (8) commutes. The naturality of σ E M \sigma_{\mathrm{EM}} σ EM is a consequence of the naturality of χ \chi χ . The commutativity of diagram (8) can be shown using the definition of σ E M \sigma_{\mathrm{EM}} σ EM , the upper square in (9), and that μ ⊠ F E M μ \mu\boxtimes F_{\mathrm{EM}}\mu μ ⊠ F EM μ is an epi. ◀
Lemma F.6. The natural transformation σ E M \sigma_{\mathrm{EM}} σ EM from Lemma F.5 is a strength for F E M F_{\mathrm{EM}} F EM .
Proof. We need to show that σ E M \sigma_{\mathrm{EM}} σ EM is compatible with the left unitor and the associator of E M ( T ) \mathrm{EM}(T) EM ( T ) . This follows via routine diagram chasing using that σ E M \sigma_{\mathrm{EM}} σ EM is natural and that ⊠ \boxtimes ⊠ preserves reflexive coequalisers. ◀
There is a generalisation of diagram (8) to free algebras, which we shall need later.
Lemma F.7. The following diagram commutes:
\begin{array}{ccccc}
SA\boxtimes F_{\mathrm{EM}}^{*}SB & \xrightarrow{(\sigma_{\mathrm{EM}}^{*})_{SA,SB}} & F_{\mathrm{EM}}^{*}(SA\boxtimes SB) & \xrightarrow{F_{\mathrm{EM}}^{*}\bar{\theta}_{A,B}} & F_{\mathrm{EM}}^{*}S(A\otimes B) \\
\downarrow{1_{SA\boxtimes\varphi_{B}^{*}} & & & & \downarrow{\varphi_{A\otimes B}^{*}} \\
SA\boxtimes SF^{*}B & \xrightarrow{\bar{\theta}_{A,F^{*}B}} & S(A\otimes F^{*}B) & \xrightarrow{\sigma_{A,B}^{*}} & SF^{*}(A\otimes B)
\end{array}}
Proof. Use diagram (8) and Proposition B.2. ◀
Finally, we show that F E M F_{\mathrm{EM}} F EM is a varietor. We do this in two steps.
Proposition F.8. The functor F E M F_{\mathrm{EM}} F EM preserves colimits of all shapes that F F F and T T T preserve.
Proof. Let D = ( A i ) i ∈ I D = (A_i)_{i \in\mathcal{I}} D = ( A i ) i ∈ I be a diagram I → EM ( T ) \mathcal{I} \to\operatorname{EM}(T) I → EM ( T ) of arbitrary shape I \mathcal{I} I with A i = ( A i , a i ) A_i = (A_i, a_i) A i = ( A i , a i ) , and let A = ( A , a ) A = (A, a) A = ( A , a ) be a colimit of D D D with coprojections κ i : A i → A \kappa_i: A_i \to A κ i : A i → A . We need to show that F EM κ i : F EM A i → F EM A F_{\operatorname{EM}}\kappa_i: F_{\operatorname{EM}}A_i \to F_{\operatorname{EM}}A F EM κ i : F EM A i → F EM A is a colimiting cocone. That is, for any cocone ( f i ) i ∈ I (f_i)_{i \in\mathcal{I}} ( f i ) i ∈ I with f i : F EM A i → B f_i: F_{\operatorname{EM}}A_i \to B f i : F EM A i → B , we have to find a unique T T T -algebra map f : F EM A → B f: F_{\operatorname{EM}}A \to B f : F EM A → B such that f ∘ F EM κ i = f i f \circ F_{\operatorname{EM}}\kappa_i = f_i f ∘ F EM κ i = f i for all i ∈ I i \in\mathcal{I} i ∈ I , as indicated in the diagram below.
F EM S T A i → φ S F T A i → S F T κ i S F T A ← φ F EM S T A F EM μ ↓ μ ∘ S γ ↓ μ ∘ S γ ↓ ↓ F EM μ F EM S A i → φ S F A i → S F κ i S F A ← φ F EM S A F EM a i ↓ ↓ F EM a F EM A i → F EM κ i F EM A → f B ↘ f i \begin{CD}
F_{\operatorname{EM}}ST A_i @>{\varphi}>> SFT A_i @>{SFT\kappa_i}>> SFT A @<{\varphi}<< F_{\operatorname{EM}}ST A \\
@V{F_{\operatorname{EM}}\mu}VV @V{\mu\circ S\gamma}VV @V{\mu\circ S\gamma}VV @VV{F_{\operatorname{EM}}\mu}V \\
F_{\operatorname{EM}}S A_i @>{\varphi}>> SFA_i @>{SF\kappa_i}>> SFA @<{\varphi}<< F_{\operatorname{EM}}SA \\
@V{F_{\operatorname{EM}}a_i}VV @. @. @VV{F_{\operatorname{EM}}a}V \\
F_{\operatorname{EM}}A_i @>{F_{\operatorname{EM}}\kappa_i}>> F_{\operatorname{EM}}A @>{f}>> B \\
@. \searrow_{f_i} @.
\end{CD} F EM S T A i F EM μ ↓ ⏐ F EM S A i F EM a i ↓ ⏐ F EM A i φ φ F EM κ i ↘ f i S F T A i μ ∘ S γ ↓ ⏐ S F A i F EM A S F T κ i S F κ i f S F T A μ ∘ S γ ↓ ⏐ S F A B φ φ F EM S T A ↓ ⏐ F EM μ F EM S A ↓ ⏐ F EM a
To construct f ˉ \bar{f} f ˉ , we use the colimit preservation properties of the functors involved. Firstly, since F EM F_{\operatorname{EM}} F EM preserves canonical presentations and φ ∗ \varphi^* φ ∗ is an isomorphism, it suffices to find a map f ˉ : S F A → B \bar{f}: SFA \to B f ˉ : S F A → B such that f ˉ ∘ S F κ i ∘ φ ∗ = f i ∘ F EM a i \bar{f} \circ SF\kappa_i \circ\varphi^* = f_i \circ F_{\operatorname{EM}}a_i f ˉ ∘ S F κ i ∘ φ ∗ = f i ∘ F EM a i for all i ∈ I i \in\mathcal{I} i ∈ I . Next, we note that F F F and T T T (and hence U U U ) preserve colimits of shape I \mathcal{I} I by assumption, and S S S preserves all colimits since it is a left adjoint. Hence, the cocones ( S F κ i ) i ∈ I (SF\kappa_i)_{i \in\mathcal{I}} ( S F κ i ) i ∈ I and ( S F T κ i ) i ∈ I (SFT\kappa_i)_{i \in\mathcal{I}} ( S F T κ i ) i ∈ I are both colimiting. Thus, to construct f ˉ \bar{f} f ˉ , it suffices to find a cocone over S ∘ F ∘ U ∘ D S \circ F \circ U \circ D S ∘ F ∘ U ∘ D , and we can choose ( f i ∘ F EM a i ∘ ( φ ∗ ) − 1 ) i ∈ I (f_i \circ F_{\operatorname{EM}}a_i \circ(\varphi^*)^{-1})_{i \in\mathcal{I}} ( f i ∘ F EM a i ∘ ( φ ∗ ) − 1 ) i ∈ I . The verification that this is a cocone and that the universal property holds now follows from elementary calculations; we omit the details. ◀
Lemma F.9. The functor F EM F_{\operatorname{EM}} F EM is a varietor.
Proof. It is well-known [1 , 35 ] that a given functor H : A → A H: \mathcal{A} \to\mathcal{A} H : A → A is a varietor already if A \mathcal{A} A has and H H H preserves colimits of ω \omega ω -chains. We have seen in Lemma F.1 that EM ( T ) \operatorname{EM}(T) EM ( T ) is cocomplete. Hence, it suffices to show that F EM F_{\operatorname{EM}} F EM preserves colimits of ω \omega ω -chains. Since both F F F and T T T preserve colimits of ω \omega ω -chains by Assumptions 4.2 and 4.3, this follows from Proposition F.8. ◀
Proof of Theorem 4.15. Consequence of Lemmas F.1, F.6, and F.9. ◀
Lifting functors and adjunctions to algebras and automata
We recall the result of Hermida and Jacobs [31 ] and generalise it slightly to automata. If L ⊣ R L \dashv R L ⊣ R is an adjunction, we write f # : L A → B f^\# : LA \to B f # : L A → B for the adjunct of a morphism A → R B A \to RB A → R B , and similarly, we write g b : A → R B g^b : A \to RB g b : A → R B for the adjunct of g : L A → B g: LA \to B g : L A → B .
Theorem G.1. Let ν : H L → L G \nu: HL \to LG ν : H L → L G be a natural transformation as in the following situation:
A → L B G ↓ ↓ H A → L B ↖ ν \begin{CD}
\mathcal{A} @>{L}>> \mathcal{B} \\
@V{G}VV @VV{H}V \\
\mathcal{A} @>{L}>> \mathcal{B} \\
@. \nwarrow_{\nu} @.
\end{CD} A G ↓ ⏐ A L L ↖ ν B ↓ ⏐ H B Then there is an induced functor L ‾ : Alg ( G ) → Alg ( H ) \overline{L}: \operatorname{Alg}(G) \to\operatorname{Alg}(H) L : Alg ( G ) → Alg ( H ) given by L ‾ ( A , a ) : = ( L A , L a ∘ ν A ) \overline{L}(A, a) := (LA, La \circ\nu_A) L ( A , a ) := ( L A , L a ∘ ν A ) and L ‾ f : = L f \overline{L}f := Lf L f := L f . If ν \nu ν is an isomorphism, then any adjunction L ⊣ R L \dashv R L ⊣ R with unit ι \iota ι and counit $\delta
:::`
lifts to an adjunction L ˉ ⊣ R ˉ \bar{L} \dashv\bar{R} L ˉ ⊣ R ˉ where the functor R ˉ \bar{R} R ˉ is induced by the natural transformation2 ^{2} 2 ν ~ \tilde{\nu} ν ~ given by ν ~ : = G R → ι G R R L G R → R ν − 1 R R H L R → R H δ R H \tilde{\nu} := GR \xrightarrow{\iota_{GR}} RLGR \xrightarrow{R\nu^{-1}R} RHLR \xrightarrow{RH\delta} RH ν ~ := GR ι GR R L GR R ν − 1 R R H L R R H δ R H .
A ⇄ L R B ⟹ Alg ( G ) ⇄ L ˉ R ˉ Alg ( H ) \mathcal{A} \underset{R}{\overset{L}{\rightleftarrows}} \mathcal{B}
\qquad\Longrightarrow\qquad
\operatorname{Alg}(G) \underset{\bar{R}}{\overset{\bar{L}}{\rightleftarrows}} \operatorname{Alg}(H) A R ⇄ L B ⟹ Alg ( G ) R ˉ ⇄ L ˉ Alg ( H )
Lifting means that the natural bijection Alg ( G ) ( ( A , a ) , R ˉ ( B , b ) ) ≅ Alg ( H ) ( L ˉ ( A , a ) , ( B , b ) ) \operatorname{Alg}(G)((A,a),\bar{R}(B,b)) \cong\operatorname{Alg}(H)(\bar{L}(A,a),(B,b)) Alg ( G ) (( A , a ) , R ˉ ( B , b )) ≅ Alg ( H ) ( L ˉ ( A , a ) , ( B , b )) is the restriction of the bijection A ( A , R B ) ≅ B ( L A , B ) \mathcal{A}(A,RB) \cong\mathcal{B}(LA,B) A ( A , R B ) ≅ B ( L A , B ) to algebra homomorphisms.
We state a variant of Theorem G.1 for pointed algebras. For a fixed I I I , an ( I - ) (I\text{-}) ( I - ) pointed G G G -algebra is a G G G -algebra ( A , a ) (A,a) ( A , a ) equipped with a point I → A I \to A I → A , and a pointed homomorphism is a G G G -algebra homomorphism that preserves the point. These form a category Alg I ( G ) \operatorname{Alg}_{I}(G) Alg I ( G ) .
Theorem G.2. In the situation of Theorem G.1 and for a fixed object I ∈ A I \in\mathcal{A} I ∈ A , we have an induced functor L ˉ : Alg I ( G ) → Alg L I ( H ) \bar{L}\colon\operatorname{Alg}_{I}(G) \to\operatorname{Alg}_{LI}(H) L ˉ : Alg I ( G ) → Alg L I ( H ) given by L ˉ ( A , a , i ) : = ( L A , L a ∘ ν A , L i ) \bar{L}(A,a,i) := (LA,La \circ\nu_{A},Li) L ˉ ( A , a , i ) := ( L A , L a ∘ ν A , L i ) and L ˉ f : = L f \bar{L}f := Lf L ˉ f := L f . If ν \nu ν is an isomorphism, then an adjunction L ⊣ R L \dashv R L ⊣ R lifts to pointed algebras:
A ⇄ L R B ⟹ Alg I ( G ) ⇄ L ˉ R ˉ Alg L I ( H ) \mathcal{A} \underset{R}{\overset{L}{\rightleftarrows}} \mathcal{B}
\qquad\Longrightarrow\qquad
\operatorname{Alg}_{I}(G) \underset{\bar{R}}{\overset{\bar{L}}{\rightleftarrows}} \operatorname{Alg}_{LI}(H) A R ⇄ L B ⟹ Alg I ( G ) R ˉ ⇄ L ˉ Alg L I ( H ) Here, L ˉ \bar{L} L ˉ is defined as above, and R ˉ \bar{R} R ˉ is given by R ˉ ( B , b , j ) : = ( R B , R b ∘ ν ~ B , j ♭ ) \bar{R}(B,b,j) := (RB,Rb \circ\tilde{\nu}_{B},j^{\flat}) R ˉ ( B , b , j ) := ( R B , R b ∘ ν ~ B , j ♭ ) and R ˉ g : = R g \bar{R}g := Rg R ˉ g := R g . Again, the natural bijection Alg I ( G ) ( ( A , a , i ) , R ˉ ( B , b , j ) ) ≅ Alg L I ( H ) ( L ˉ ( A , a , i ) , ( B , b , j ) ) \operatorname{Alg}_{I}(G)((A,a,i),\bar{R}(B,b,j)) \cong\operatorname{Alg}_{LI}(H)(\bar{L}(A,a,i),(B,b,j)) Alg I ( G ) (( A , a , i ) , R ˉ ( B , b , j )) ≅ Alg L I ( H ) ( L ˉ ( A , a , i ) , ( B , b , j )) is the restriction of the bijection A ( A , R B ) ≅ B ( L A , B ) \mathcal{A}(A,RB) \cong\mathcal{B}(LA,B) A ( A , R B ) ≅ B ( L A , B ) to pointed algebra homomorphisms.
Proof. The proof is analogous to Theorem G.1. One has to check additionally that L ˉ f \bar{L}f L ˉ f (respectively R ˉ g \bar{R}g R ˉ g ) is pointed if f f f (respectively g g g ) is pointed, and that f f f is pointed iff f ♭ f^{\flat} f ♭ is pointed. These are all routine calculations.
If A \mathcal{A} A and B \mathcal{B} B have coproducts, then Theorem G.2 also follows directly from Theorem G.1 if we take G : = I + G ( − ) G := I + G(-) G := I + G ( − ) , H : = L I + H ( − ) H := LI + H(-) H := L I + H ( − ) , and ν : = L I + H L G A → 1 + ν L I + L G A → [ κ 1 , κ 2 ] L ( I + G A ) \nu:= LI + HLGA \xrightarrow{1+\nu} LI + LGA \xrightarrow{[\kappa_{1},\kappa_{2}]} L(I+GA) ν := L I + H L G A 1 + ν L I + L G A [ κ 1 , κ 2 ] L ( I + G A ) (the composite is an isomorphism if ν \nu ν is since L L L , being a left adjoint, preserves colimits). Then Alg ( I + G ( − ) ) \operatorname{Alg}(I+G(-)) Alg ( I + G ( − )) and Alg ( L I + H ( − ) ) \operatorname{Alg}(LI+H(-)) Alg ( L I + H ( − )) are isomorphic to Alg I ( G ) \operatorname{Alg}_{I}(G) Alg I ( G ) and Alg L I ( H ) \operatorname{Alg}_{LI}(H) Alg L I ( H ) , respectively. One can then verify that L ˉ \bar{L} L ˉ and R ˉ \bar{R} R ˉ are as given above.
Proof of Theorem 4.11. By entirely analogous considerations as in the proof of Theorem G.2, we get that for a natural isomorphism ν : H L → ≅ L G \nu\colon HL \xrightarrow{\cong} LG ν : H L ≅ L G and a fixed O ∈ B O \in\mathcal{B} O ∈ B , an adjunction L ⊣ R L \dashv R L ⊣ R lifts to an adjunction
Aut I R O ( G ) ⇄ L ˉ R ˉ Aut L I O ( H ) \operatorname{Aut}_{I}^{RO}(G) \underset{\bar{R}}{\overset{\bar{L}}{\rightleftarrows}} \operatorname{Aut}_{LI}^{O}(H) Aut I R O ( G ) R ˉ ⇄ L ˉ Aut L I O ( H )
where L ˉ \bar{L} L ˉ and R ˉ \bar{R} R ˉ are given by
L ˉ ( Q , δ , i , o ) : = ( L Q , L δ ∘ ν , L i , o # ) , L ˉ f : = L f , \bar{L}(Q,\delta,i,o) := (LQ,L\delta\circ\nu,Li,o^{\#}), \qquad\bar{L}f := Lf, L ˉ ( Q , δ , i , o ) := ( L Q , L δ ∘ ν , L i , o # ) , L ˉ f := L f ,
R ˉ ( Q , δ , i , o ) : = ( R Q , R δ ∘ ν ~ , i ♭ , R o ) , R ˉ g : = R g . \bar{R}(Q,\delta,i,o) := (RQ,R\delta\circ\tilde{\nu},i^{\flat},Ro), \qquad\bar{R}g := Rg. R ˉ ( Q , δ , i , o ) := ( R Q , R δ ∘ ν ~ , i ♭ , R o ) , R ˉ g := R g .
Hence, we obtain the adjunctions in the right triangle of (2) , where the adjunction E ‾ ⊣ V ‾ \overline{E} \dashv\overline{V} E ⊣ V is induced by the identity natural transformation on F K l E = E F F_{KlE}=EF F K l E = E F and the adjunction S ‾ ⊣ U ‾ \overline{S} \dashv\overline{U} S ⊣ U is induced by φ \varphi φ . The algebra part of K ‾ \overline{K} K is induced by φ K l \varphi_{Kl} φ K l (see Lemma 4.10 ) as in Theorem G.1 ; additionally, K ‾ \overline{K} K sends the input and outputs maps i i i and o o o to K i Ki K i and K o Ko K o , respectively. ◀
Proof of Proposition 4.16. The result follows from Theorem G.2 applied to the adjunction E ⊣ V E \dashv V E ⊣ V , using the fact that a free algebra over A A A is the same thing as an initial A A A -pointed algebra, and that left adjoints preserve initial objects. ◀
Let us write ( F E M ∗ A , ( ζ E M ) A , ( η E M ) A ) (F^{*}_{\mathrm{EM}}A,(\zeta_{\mathrm{EM}})_{A},(\eta_{\mathrm{EM}})_{A}) ( F EM ∗ A , ( ζ EM ) A , ( η EM ) A ) for the free F E M F_{\mathrm{EM}} F EM -algebra over A ∈ E M ( T ) A \in\mathrm{EM}(T) A ∈ EM ( T ) .
Proof of Proposition 4.17. Similarly to Proposition 4.16, we apply Theorem G.2 to the adjunction S ⊣ U S \dashv U S ⊣ U to deduce the first part of the statement. Since initial (or free) objects are unique up to unique isomorphism, we obtain, for each A ∈ C A \in C A ∈ C , a unique isomorphism of F E M F_{\mathrm{EM}} F EM -algebras φ A ∗ : ( F E M ∗ S A , ( ζ E M ) A ) → ≅ ( S F ∗ A , S ζ A ∘ φ A ) \varphi^{*}_{A}:(F^{*}_{\mathrm{EM}}SA,(\zeta_{\mathrm{EM}})_{A}) \xrightarrow{\cong} (SF^{*}A,S\zeta_{A}\circ\varphi_{A}) φ A ∗ : ( F EM ∗ S A , ( ζ EM ) A ) ≅ ( S F ∗ A , S ζ A ∘ φ A ) s.t. φ A ∗ ∘ ( η E M ) S A = S η A \varphi_{A}^{*}\circ(\eta_{\mathrm{EM}})_{SA}=S\eta_{A} φ A ∗ ∘ ( η EM ) S A = S η A . ◀
Proof of Proposition 5.2
Let us write c : C → F ∗ I c:C\to F^{*}I c : C → F ∗ I for the inclusion of the subset C ⊆ F ∗ I C\subseteq F^{*}I C ⊆ F ∗ I . Note that the condition η I ( a ) ∈ C \eta_{I}(a)\in C η I ( a ) ∈ C (a ∈ I a\in I a ∈ I ) is equivalent to the statement that η I \eta_{I} η I factors through c c c , which is equivalent to the existence of a morphism i C : η I → c i_{C}:\eta_{I}\to c i C : η I → c . Hence, it remains to show that a map δ C \delta_{C} δ C making diagram (5) commute exists if and only if the second condition holds.
For the ‘if’ direction, let us denote the image factorisation of r U S # r_{US}^{\#} r U S # by F ∗ I → e R → m Q F^{*}I \xrightarrow{e} R \xrightarrow{m} Q F ∗ I e R m Q . First choose for every q ∈ R q\in R q ∈ R an element z ∈ T C z\in TC z ∈ T C such that r U S # ( T c ( z ) ) = q r_{US}^{\#}(Tc(z))=q r U S # ( T c ( z )) = q (such a z z z exists by assumption). This defines a function s : R → T C s:R\to TC s : R → T C satisfying r U S # ∘ T c ∘ s = m r_{US}^{\#}\circ Tc\circ s=m r U S # ∘ T c ∘ s = m . Then we can define δ C \delta_{C} δ C as the composite F C → F c F F ∗ I → ζ I F ∗ I → e R → s T C FC \xrightarrow{Fc} FF^{*}I \xrightarrow{\zeta_{I}} F^{*}I \xrightarrow{e} R \xrightarrow{s} TC F C F c F F ∗ I ζ I F ∗ I e R s T C . This makes diagram (5) commute since r U S # ∘ T c ∘ δ C = r U S # ∘ T c ∘ s ∘ e ∘ ζ I ∘ F c = m ∘ e ∘ ζ I ∘ F c = r U S ∘ ζ I ∘ F c r_{US}^{\#}\circ Tc\circ\delta_{C}=r_{US}^{\#}\circ Tc\circ s\circ e\circ\zeta_{I}\circ Fc=m\circ e\circ\zeta_{I}\circ Fc=r_{US}\circ\zeta_{I}\circ Fc r U S # ∘ T c ∘ δ C = r U S # ∘ T c ∘ s ∘ e ∘ ζ I ∘ F c = m ∘ e ∘ ζ I ∘ F c = r U S ∘ ζ I ∘ F c .
Conversely, let δ C : F C → T C \delta_{C}:FC\to TC δ C : F C → T C be a morphism making (5) commute and let i C : η I → c i_{C}:\eta_{I}\to c i C : η I → c . Define Z ⊆ F ∗ I Z\subseteq F^{*}I Z ⊆ F ∗ I as Z : = { v ∈ F ∗ I ∣ ∃ z ∈ T C . r U S # ( T c ( z ) ) = r U S ( v ) } Z:=\{v\in F^{*}I\mid\exists z\in TC.\ r_{US}^{\#}(Tc(z))=r_{US}(v)\} Z := { v ∈ F ∗ I ∣ ∃ z ∈ T C . r U S # ( T c ( z )) = r U S ( v )} . By the definition of R R R , we have for all q ∈ R q\in R q ∈ R some v ∈ F ∗ I v\in F^{*}I v ∈ F ∗ I such that r U S ( v ) = q r_{US}(v)=q r U S ( v ) = q . Hence, it suffices to show that Z = F ∗ I Z=F^{*}I Z = F ∗ I , which is equivalent to the inclusion map m : Z → F ∗ I m:Z\to F^{*}I m : Z → F ∗ I being an isomorphism.
Our strategy is to use ‘induction’, i.e. to show that Z Z Z carries a pointed F F F -algebra structure that makes m m m a pointed homomorphism from Z Z Z into the free algebra F ∗ I F^{*}I F ∗ I . Then m m m is an isomorphism since it is a subobject of the initial object in the category of pointed F F F -algebras.
To construct the pointed F F F -algebra structure on Z Z Z , we use that Z Z Z can be characterised categorically as the image of the projection r r r in the following pullback diagram:
P → r F ∗ I p ↓ ↓ r U S T C → T c T F ∗ I → r U S # Q \begin{CD}
P @>r>> F^{*}I \\
@VpVV @VVr_{US}V \\
TC @>T c>> TF^{*}I @>r_{US}^{\#}>> Q
\end{CD} P p ↓ ⏐ T C r T c F ∗ I ↓ ⏐ r U S T F ∗ I r U S # Q
Hence, to show that a morphism v : A → F ∗ I v:A\to F^{*}I v : A → F ∗ I factors through m : Z → F ∗ I m:Z\to F^{*}I m : Z → F ∗ I , it suffices to give a morphism u : A → T C u:A\to TC u : A → T C such that r U S # ∘ T c ∘ u = r U S ∘ v r_{US}^{\#}\circ Tc\circ u=r_{US}\circ v r U S # ∘ T c ∘ u = r U S ∘ v . In particular, η I : I → F ∗ I \eta_{I}:I\to F^{*}I η I : I → F ∗ I factors through m m m since r U S # ∘ T c ∘ η C T ∘ i C = r U S # ∘ η F ∗ I T ∘ c ∘ i C = r U S ∘ η I r_{US}^{\#}\circ Tc\circ\eta_{C}^{T}\circ i_{C}=r_{US}^{\#}\circ\eta_{F^{*}I}^{T}\circ c\circ i_{C}=r_{US}\circ\eta_{I} r U S # ∘ T c ∘ η C T ∘ i C = r U S # ∘ η F ∗ I T ∘ c ∘ i C = r U S ∘ η I . This gives us a point i Z : I → Z i_{Z}:I\to Z i Z : I → Z satisfying m ∘ i Z = η I m\circ i_{Z}=\eta_{I} m ∘ i Z = η I .
For the algebra structure on Z Z Z , we need a lemma:
Lemma H.1. Let ( A , α ) (A,\alpha) ( A , α ) be an F E M \mathrm{FEM} FEM -algebra, where A = ( A , a ) A=(A,a) A = ( A , a ) , and let us denote the structure map of U ‾ ( A , α ) \overline{U}(A,\alpha) U ( A , α ) by α ˉ : F A → A \bar{\alpha}:FA\to A α ˉ : F A → A . Then the following diagram commutes:
F T A → γ A T F A → T α ˉ T A F a ↓ a ↓ F A → α ˉ A \begin{CD}
FTA @>{\gamma_A}>> TFA @>{T\bar{\alpha}}>> TA \\
@V{Fa}VV @. @V{a}VV \\
FA @>{\bar{\alpha}}>> A
\end{CD} F T A F a ↓ ⏐ F A γ A α ˉ T F A A T α ˉ T A a ↓ ⏐ Proof. Since the adjunction S ‾ ⊣ U ‾ \overline{S}\dashv\overline{U} S ⊣ U is induced by φ \varphi φ , the functor U ‾ \overline{U} U is induced by the natural transformation ψ : F U → U F E M \psi:F U\to U F_{\mathrm{EM}} ψ : F U → U F EM given by ψ ( B , b ) = F E M b ∘ φ B − 1 ∘ η F B T \psi_{(B,b)}=F_{\mathrm{EM}}b\circ\varphi_B^{-1}\circ\eta^T_{F B} ψ ( B , b ) = F EM b ∘ φ B − 1 ∘ η F B T (see Theorem G.1 ). Hence, we have α ˉ = α ∘ ψ A \bar{\alpha}=\alpha\circ\psi_A α ˉ = α ∘ ψ A . Writing ν \nu ν for the T T T -algebra structure of F E M A F_{\mathrm{EM}}A F EM A , the desired result follows from the following commuting diagram:
F T A → γ A T F A → T ψ A T F E M A → T α T A ∥ ↓ φ A ↑ ν ↓ a ↓ F T A → ψ S A F E M S A → F E M a F E M A → α A F a ↓ F A → φ A F E M A → α A \begin{CD}
FTA @>{\gamma_A}>> TFA @>{T\psi_A}>> T F_{\mathrm{EM}}A @>{T\alpha}>> TA \\
@V{\|}VV @A{\varphi_A}AA @V{\nu}VV @V{a}VV \\
FTA @>{\psi_{SA}}>> F_{\mathrm{EM}}SA @>{F_{\mathrm{EM}}a}>> F_{\mathrm{EM}}A @>{\alpha}>> A \\
@V{Fa}VV @. @. @. \\
FA @>{\varphi_A}>> F_{\mathrm{EM}}A @>{\alpha}>> A
\end{CD} F T A ∥ ↓ ⏐ F T A F a ↓ ⏐ F A γ A ψ S A φ A T F A φ A ⏐ ↑ F EM S A F EM A T ψ A F EM a α T F EM A ν ↓ ⏐ F EM A A T α α T A a ↓ ⏐ A The lower trapezoid commutes by the naturality of ψ \psi ψ , and the right-hand square commutes since α : F E M A → A \alpha:F_{\mathrm{EM}}A\to A α : F EM A → A is a T T T -algebra morphism. Furthermore, ( × ) (\times) ( × ) commutes since
φ A ∘ ψ S A = φ A ∘ F E M μ A ∘ φ T A − 1 ∘ η F T A T = μ F A ∘ T γ A ∘ η F T A T = μ F A ∘ η T F A T ∘ γ A = γ A , \varphi_A\circ\psi_{SA}=\varphi_A\circ F_{\mathrm{EM}}\mu_A\circ\varphi_{TA}^{-1}\circ\eta^T_{FTA}
=\mu_{FA}\circ T\gamma_A\circ\eta^T_{FTA}
=\mu_{FA}\circ\eta^T_{TFA}\circ\gamma_A
=\gamma_A, φ A ∘ ψ S A = φ A ∘ F EM μ A ∘ φ T A − 1 ∘ η F T A T = μ F A ∘ T γ A ∘ η F T A T = μ F A ∘ η T F A T ∘ γ A = γ A , using diagram (3). Finally, ( ∗ ) (*) ( ∗ ) commutes since
ν ∘ T ψ A ∘ φ A = ν ∘ T ( F E M a ∘ φ A − 1 ) ∘ T η F A T ∘ φ A = F E M a ∘ φ A − 1 ∘ μ F A ∘ T η F A T ∘ φ A = F E M a , \nu\circ T\psi_A\circ\varphi_A
=\nu\circ T(F_{\mathrm{EM}}a\circ\varphi_A^{-1})\circ T\eta^T_{FA}\circ\varphi_A
=F_{\mathrm{EM}}a\circ\varphi_A^{-1}\circ\mu_{FA}\circ T\eta^T_{FA}\circ\varphi_A
=F_{\mathrm{EM}}a, ν ∘ T ψ A ∘ φ A = ν ∘ T ( F EM a ∘ φ A − 1 ) ∘ T η F A T ∘ φ A = F EM a ∘ φ A − 1 ∘ μ F A ∘ T η F A T ∘ φ A = F EM a , using that F E M a ∘ φ A − 1 F_{\mathrm{EM}}a\circ\varphi_A^{-1} F EM a ∘ φ A − 1 is a T T T -algebra morphism S F A → F E M A SFA\to F_{\mathrm{EM}}A S F A → F EM A .
Now choose for each v ∈ Z v\in Z v ∈ Z some z ∈ T C z\in TC z ∈ T C such that r U ‾ S # ( T c ( z ) ) = r U ‾ S ( v ) r^{\#}_{\overline{U}S}(Tc(z))=r_{\overline{U}S}(v) r U S # ( T c ( z )) = r U S ( v ) (such a z z z exists by the definition of Z Z Z ). This defines a map s : Z → T C s:Z\to TC s : Z → T C that satisfies r U ‾ S # ∘ T c ∘ s = r U ‾ S ∘ m r^{\#}_{\overline{U}S}\circ Tc\circ s=r_{\overline{U}S}\circ m r U S # ∘ T c ∘ s = r U S ∘ m . Let us write q : T Q → Q q:TQ\to Q q : T Q → Q for the T T T -algebra structure of Q Q Q and δ ˉ \bar{\delta} δ ˉ for the transition map of U ‾ S \overline{U}S U S , and consider the following diagram:
F Z → F m F F ∗ I → ζ F ∗ I F s ↓ F r U ‾ S ↓ r U ‾ S ↓ F T C → F T c F T F ∗ I → F T r U ‾ S F T Q → F q F Q γ ↓ γ ↓ γ ↓ δ ˉ ↓ T F C → T F T c T F F ∗ I → T F T r U ‾ S T F Q → q Q T δ C ↓ T δ ↓ T δ ˉ ↓ T 2 C → T 2 c T 2 F ∗ I → T r U ‾ S # T Q → q Q μ ↓ μ ↓ μ ↓ T C → T c T F ∗ I → r U ‾ S # Q \begin{CD}
FZ @>{Fm}>> FF^*I @>{\zeta}>> F^*I \\
@V{Fs}VV @V{F r_{\overline{U}S}}VV @V{r_{\overline{U}S}}VV \\
FTC @>{F Tc}>> FTF^*I @>{F T r_{\overline{U}S}}>> FTQ @>{Fq}>> FQ \\
@V{\gamma}VV @V{\gamma}VV @V{\gamma}VV @V{\bar{\delta}}VV \\
TFC @>{TF Tc}>> TFF^*I @>{TF T r_{\overline{U}S}}>> T FQ @>{q}>> Q \\
@V{T\delta_C}VV @V{T\delta}VV @V{T\bar{\delta}}VV @. \\
T^2C @>{T^2c}>> T^2F^*I @>{T r^{\#}_{\overline{U}S}}>> TQ @>{q}>> Q \\
@V{\mu}VV @V{\mu}VV @V{\mu}VV @. \\
TC @>{Tc}>> TF^*I @>{r^{\#}_{\overline{U}S}}>> Q
\end{CD} F Z F s ↓ ⏐ F T C γ ↓ ⏐ T F C T δ C ↓ ⏐ T 2 C μ ↓ ⏐ T C F m F T c T F T c T 2 c T c F F ∗ I F r U S ↓ ⏐ F T F ∗ I γ ↓ ⏐ T F F ∗ I T δ ↓ ⏐ T 2 F ∗ I μ ↓ ⏐ T F ∗ I ζ F T r U S T F T r U S T r U S # r U S # F ∗ I r U S ↓ ⏐ F T Q γ ↓ ⏐ T F Q T δ ˉ ↓ ⏐ T Q μ ↓ ⏐ Q F q q q F Q δ ˉ ↓ ⏐ Q Q
Here, (a) commutes by the definition of s s s , (b) commutes since r U S ‾ r_{\overline{US}} r U S is an F F F -algebra map ( F ∗ I , ζ ) → ( Q , δ ˉ ) (F^{*}I,\zeta) \to(Q,\bar{\delta}) ( F ∗ I , ζ ) → ( Q , δ ˉ ) , (c) commutes by Lemma H.1, (d) commutes by diagram (5) and the equality r U S ‾ ∘ ζ = δ ˉ ∘ F r U S ‾ r_{\overline{US}} \circ\zeta= \bar{\delta} \circ F r_{\overline{US}} r U S ∘ ζ = δ ˉ ∘ F r U S , (e) commutes since r U S ‾ # r^{\#}_{\overline{US}} r U S # is a T T T -algebra map S F ∗ I → ( Q , q ) SF^{*}I \to(Q,q) S F ∗ I → ( Q , q ) , the remaining squares commute by naturality, and the triangle commutes by definition. Hence, we obtain a map z : F Z → Z z: FZ \to Z z : F Z → Z such that m ∘ z = ζ I ∘ F m m \circ z = \zeta_I \circ Fm m ∘ z = ζ I ∘ F m . This, together with the equality m ∘ i Z = η I m \circ i_Z = \eta_I m ∘ i Z = η I , shows that m m m is a pointed homomorphism ( Z , z , i Z ) → ( F ∗ I , ζ , η I ) (Z,z,i_Z) \to(F^{*}I,\zeta,\eta_I) ( Z , z , i Z ) → ( F ∗ I , ζ , η I ) , which is what needed to show.
Proof of Theorem 5.5
Lemma I.1. Let a : B → F ∗ A a: B \to F^{*}A a : B → F ∗ A be a morphism in C \mathcal{C} C . Then a map h : A → B h: A \to B h : A → B in C \mathcal{C} C is a morphism η A → a \eta_A \to a η A → a if and only if S h : S A → S B Sh: SA \to SB S h : S A → S B is a morphism ( η E M ) S A → S ~ a (\eta_{\mathrm{EM}})_{SA} \to\widetilde{S}a ( η EM ) S A → S a .
Proof. Follows from the definition of S ~ \widetilde{S} S and the equality φ A ∘ ( η E M ) S A = S η A \varphi_A \circ(\eta_{\mathrm{EM}})_{SA} = S\eta_A φ A ∘ ( η EM ) S A = S η A .
Part (1)
Let us write S = ( Q , δ , i , o ) S = (Q,\delta,i,o) S = ( Q , δ , i , o ) , where Q = ( Q , q ) Q = (Q,q) Q = ( Q , q ) is a T T T -algebra. By Lemma I.1, we have i C : η I → c i_C: \eta_I \to c i C : η I → c if and only if S i C : ( η E M ) S I → S ~ c Si_C: (\eta_{\mathrm{EM}})_{SI} \to\widetilde{S}c S i C : ( η EM ) S I → S c . Furthermore, r S ∘ S ~ c r_S \circ\widetilde{S}c r S ∘ S c is an F E M F_{\mathrm{EM}} F EM -algebra morphism ( S C , K δ C ∘ φ C ) → ( Q , δ ) (SC,K\delta_C \circ\varphi_C) \to(Q,\delta) ( S C , K δ C ∘ φ C ) → ( Q , δ ) iff the outer square in the following diagram commutes:
F E M S C → F E M S ~ c F E M F E M ∗ S I → F E M r S F E M Q φ ↓ F E M φ ∗ ↓ δ ↓ S F C → S F c S F F ∗ I → S c S F ∗ I → r S Q K δ C ↓ r U S ‾ # ↓ ↓ ∥ S C → S c S F ∗ I → r U S ‾ # Q ∥ ↓ S ~ c ↓ ↓ ∥ S C → S ~ c F E M ∗ S I → r S Q \begin{CD}
F_{\mathrm{EM}}SC @>{F_{\mathrm{EM}}\widetilde{S}c}>> F_{\mathrm{EM}}F^{*}_{\mathrm{EM}}SI @>{F_{\mathrm{EM}}r_S}>> F_{\mathrm{EM}}Q \\
@V{\varphi}VV @V{F_{\mathrm{EM}}\varphi^{*}}VV @V{\delta}VV \\
SFC @>{SFc}>> SF F^{*}I @>{Sc}>> SF^{*}I @>{r_S}>> Q \\
@V{K\delta_C}VV @. @V{r^{\#}_{\overline{US}}}VV @VV{\|}V \\
SC @>{Sc}>> SF^{*}I @>{r^{\#}_{\overline{US}}}>> Q \\
@V{\|}VV @V{\widetilde{S}c}VV @VV{\|}V \\
SC @>{\widetilde{S}c}>> F^{*}_{\mathrm{EM}}SI @>{r_S}>> Q
\end{CD} F EM S C φ ↓ ⏐ S F C K δ C ↓ ⏐ S C ∥ ↓ ⏐ S C F EM S c S F c S c S c F EM F EM ∗ S I F EM φ ∗ ↓ ⏐ S F F ∗ I S F ∗ I S c ↓ ⏐ F EM ∗ S I F EM r S S c r U S # r S F EM Q δ ↓ ⏐ S F ∗ I r U S # ↓ ⏐ Q ↓ ⏐ ∥ Q r S Q ↓ ⏐ ∥
In the diagram above, all parts other than the one labelled ( ∗ ) (*) ( ∗ ) commute by the definition of S ~ \widetilde{S} S , the naturality of φ ∗ \varphi^{*} φ ∗ , Proposition 4.17, and the fact that the maps r S : ( F E M ∗ S I , ζ E M ) → ( Q , δ ) r_S: (F^{*}_{\mathrm{EM}}SI,\zeta_{\mathrm{EM}}) \to(Q,\delta) r S : ( F EM ∗ S I , ζ EM ) → ( Q , δ ) and φ ∗ : ( F E M ∗ S I , ( ζ E M ) I ) → ( S F ∗ I , S ζ I ∘ φ ∗ ) \varphi^{*}: (F^{*}_{\mathrm{EM}}SI,(\zeta_{\mathrm{EM}})_I) \to(SF^{*}I,S\zeta_I \circ\varphi^{*}) φ ∗ : ( F EM ∗ S I , ( ζ EM ) I ) → ( S F ∗ I , S ζ I ∘ φ ∗ ) are homomorphisms. Hence, the outer square commutes iff ( ∗ ) (*) ( ∗ ) commutes. Taking adjuncts along S ⊣ U S \dashv U S ⊣ U , this holds iff (5) commutes.
Part (2)
The proof of the second claim is much more involved. The key result is the following:
Proposition I.2. Let A = ( Q , δ , i , o ) A = (Q,\delta,i,o) A = ( Q , δ , i , o ) be an F E M F_{\mathrm{EM}} F EM -automaton with Q = ( Q , q ) Q = (Q,q) Q = ( Q , q ) a T T T -algebra. Let A ∈ C A \in\mathcal{C} A ∈ C , f , g : A → Q f,g: A \to Q f , g : A → Q , and w : W → F ∗ 1 w: W \to F^{*}1 w : W → F ∗ 1 be arbitrary. Then the composite
Q → ℓ A [ F E M ∗ S 1 , S O ] T → [ S ~ w , 1 ] T [ S W , S O ] T Q \xrightarrow{\ell_A} [F^{*}_{\mathrm{EM}}S1,SO]_T \xrightarrow{[\widetilde{S}w,1]_T} [SW,SO]_T Q ℓ A [ F EM ∗ S 1 , S O ] T [ S w , 1 ] T [ S W , S O ] T equalises f f f and g g g iff the composite
A → ℓ U A [ F ∗ 1 , T O ] → [ w , 1 ] [ W , T O ] A \xrightarrow{\ell_{UA}} [F^{*}1,TO] \xrightarrow{[w,1]} [W,TO] A ℓ U A [ F ∗ 1 , T O ] [ w , 1 ] [ W , T O ] does so.
With Proposition I.2 at hand, the proof of Theorem 5.5(2) is relatively straightforward.
Proof of Theorem 5.5(2). Let us write S = ( Q , δ , i , o ) \mathcal{S}=(Q,\delta,i,o) S = ( Q , δ , i , o ) , where Q = ( Q , q ) Q=(Q,q) Q = ( Q , q ) is a T T T -algebra. By Lemma I.1, we have i W : η 1 → w i_W:\eta_1\to w i W : η 1 → w iff S i W : ( η E M ) S 1 → S ~ w S i_W:(\eta_{\mathrm{EM}})S_1\to\widetilde{S}w S i W : ( η EM ) S 1 → S w . We prove the remaining implications in both directions.
( ⇒ ) (\Rightarrow) ( ⇒ ) Let f , g : A → Q f,g:A\to Q f , g : A → Q such that [ S ~ w , 1 ] T ∘ ℓ S ∘ f = [ S ~ w , 1 ] T ∘ ℓ S ∘ g [\widetilde{S}w,1]_T\circ\ell_S\circ f=[\widetilde{S}w,1]_T\circ\ell_S\circ g [ S w , 1 ] T ∘ ℓ S ∘ f = [ S w , 1 ] T ∘ ℓ S ∘ g . By Proposition I.2, we have [ w , 1 ] ∘ ℓ U ‾ S ∘ f = [ w , 1 ] ∘ ℓ U ‾ S ∘ g [w,1]\circ\ell_{\overline{U}S}\circ f=[w,1]\circ\ell_{\overline{U}S}\circ g [ w , 1 ] ∘ ℓ U S ∘ f = [ w , 1 ] ∘ ℓ U S ∘ g . Since w w w is an effectful state characteriser, we get ℓ U ‾ S ∘ f = ℓ U ‾ S ∘ g \ell_{\overline{U}S}\circ f=\ell_{\overline{U}S}\circ g ℓ U S ∘ f = ℓ U S ∘ g . Applying Proposition I.2 again with w : = 1 w:=1 w := 1 and using that S ~ 1 \widetilde{S}1 S 1 is an isomorphism, we conclude that ℓ S ∘ f = ℓ S ∘ g \ell_S\circ f=\ell_S\circ g ℓ S ∘ f = ℓ S ∘ g .
( ⇐ ) (\Leftarrow) ( ⇐ ) Let f , g : A → Q f,g:A\to Q f , g : A → Q such that [ w , 1 ] ∘ ℓ U ‾ S ∘ f = [ w , 1 ] ∘ ℓ U ‾ S ∘ g [w,1]\circ\ell_{\overline{U}S}\circ f=[w,1]\circ\ell_{\overline{U}S}\circ g [ w , 1 ] ∘ ℓ U S ∘ f = [ w , 1 ] ∘ ℓ U S ∘ g . By Proposition I.2, we have [ S ~ w , 1 ] T ∘ ℓ S ∘ f = [ S ~ w , 1 ] T ∘ ℓ S ∘ g [\widetilde{S}w,1]_T\circ\ell_S\circ f=[\widetilde{S}w,1]_T\circ\ell_S\circ g [ S w , 1 ] T ∘ ℓ S ∘ f = [ S w , 1 ] T ∘ ℓ S ∘ g . Let us write f # : = q ∘ T f f^\#:=q\circ Tf f # := q ∘ T f for the free T T T -extension of f f f , and similarly for g g g ; these are T T T -algebra maps S A → Q SA\to Q S A → Q . Then, writing ν \nu ν for the algebra map of [ S W , S O ] T [SW,SO]_T [ S W , S O ] T , we have
[ S ~ w , 1 ] T ∘ ℓ S ∘ f # = [ S ~ w , 1 ] T ∘ ℓ S ∘ q ∘ T f = ν ∘ T ( [ S ~ w , 1 ] T ∘ ℓ S ∘ f ) = ν ∘ T ( [ S ~ w , 1 ] T ∘ ℓ S ∘ g ) = [ S ~ w , 1 ] T ∘ ℓ S ∘ q ∘ T g = [ S ~ w , 1 ] T ∘ ℓ S ∘ g # . \begin{aligned}
[\widetilde{S}w,1]_T\circ\ell_S\circ f^\#=[\widetilde{S}w,1]_T\circ\ell_S\circ q\circ Tf=\nu\circ T([\widetilde{S}w,1]_T\circ\ell_S\circ f) \\
&=\nu\circ T([\widetilde{S}w,1]_T\circ\ell_S\circ g)=[\widetilde{S}w,1]_T\circ\ell_S\circ q\circ Tg=[\widetilde{S}w,1]_T\circ\ell_S\circ g^\#.
\end{aligned} [ S w , 1 ] T ∘ ℓ S ∘ f # = [ S w , 1 ] T ∘ ℓ S ∘ q ∘ T f = ν ∘ T ([ S w , 1 ] T ∘ ℓ S ∘ f ) = ν ∘ T ([ S w , 1 ] T ∘ ℓ S ∘ g ) = [ S w , 1 ] T ∘ ℓ S ∘ q ∘ T g = [ S w , 1 ] T ∘ ℓ S ∘ g # .
Hence, since S ~ w \widetilde{S}w S w is a state characteriser, we get ℓ S ∘ f # = ℓ S ∘ g # \ell_S\circ f^\#=\ell_S\circ g^\# ℓ S ∘ f # = ℓ S ∘ g # , implying ℓ S ∘ f = ℓ S ∘ g \ell_S\circ f=\ell_S\circ g ℓ S ∘ f = ℓ S ∘ g . Applying Proposition I.2 again with w : = 1 w:=1 w := 1 , we conclude that ℓ U ‾ S ∘ f = ℓ U ‾ S ∘ g . ▲ \ell_{\overline{U}S}\circ f=\ell_{\overline{U}S}\circ g. \blacktriangle ℓ U S ∘ f = ℓ U S ∘ g . ▲
To prove Proposition I.2, we need some lemmas.
Lemma I.3. Let A = ( A , a ) A=(A,a) A = ( A , a ) and C = ( C , c ) C=(C,c) C = ( C , c ) be T T T -algebras, and let f : A ⊠ S B → C f:A\boxtimes SB\to C f : A ⊠ S B → C be a T T T -algebra map. Then the composite
A → Λ T ( f ) [ S B , C ] T → ψ [ B , C ] A\xrightarrow{\Lambda^T(f)}[SB,C]_T\xrightarrow{\psi}[B,C] A Λ T ( f ) [ S B , C ] T ψ [ B , C ] is equal to the currying (in C C C ) of the composite
A ⊗ B → 1 ⊗ η T A ⊗ T B → ω A ⊠ S B → f C . A\otimes B\xrightarrow{1\otimes\eta^T}A\otimes TB\xrightarrow{\omega}A\boxtimes SB\xrightarrow{f}C. A ⊗ B 1 ⊗ η T A ⊗ T B ω A ⊠ S B f C . Proof. The two morphisms are equal iff their adjuncts are equal. Hence, we need to prove ε ∘ ( ψ ⊗ 1 ) ∘ ( Λ T ( f ) ⊗ 1 ) = f ∘ ω ∘ ( 1 ⊗ η T ) \varepsilon\circ(\psi\otimes1)\circ(\Lambda^T(f)\otimes1)=f\circ\omega\circ(1\otimes\eta^T) ε ∘ ( ψ ⊗ 1 ) ∘ ( Λ T ( f ) ⊗ 1 ) = f ∘ ω ∘ ( 1 ⊗ η T ) . This follows from the following diagram, which commutes by the definition of ψ \psi ψ , the naturality of ω \omega ω , and diagram (7):
A ⊗ B → Λ T ( f ) ⊗ 1 [ S B , C ] T ⊗ B → ψ ⊗ 1 [ B , C ] ⊗ B 1 ⊗ η T ↓ 1 ⊗ η T ↓ 1 ⊗ η T ↓ ↓ ε A ⊗ T B → Λ T ( f ) ⊗ 1 [ S B , C ] T ⊗ T B → m ⊗ 1 [ T B , C ] ⊗ T B ω ↓ ω ↓ ↓ ε A ⊠ S B → Λ T ( f ) ⊠ 1 [ S B , C ] T ⊠ S B → ε T C \begin{CD}
A\otimes B @>{\Lambda^T(f)\otimes1}>> [SB,C]_T\otimes B @>{\psi\otimes1}>> [B,C]\otimes B \\
@V{1\otimes\eta^T}VV @V{1\otimes\eta^T}VV @V{1\otimes\eta^T}VV @VV{\varepsilon}V \\
A\otimes TB @>{\Lambda^T(f)\otimes1}>> [SB,C]_T\otimes TB @>{m\otimes1}>> [TB,C]\otimes TB \\
@V{\omega}VV @V{\omega}VV @. @VV{\varepsilon}V \\
A\boxtimes SB @>{\Lambda^T(f)\boxtimes1}>> [SB,C]_T\boxtimes SB @>{\varepsilon^T}>> C
\end{CD} A ⊗ B 1 ⊗ η T ↓ ⏐ A ⊗ T B ω ↓ ⏐ A ⊠ S B Λ T ( f ) ⊗ 1 Λ T ( f ) ⊗ 1 Λ T ( f ) ⊠ 1 [ S B , C ] T ⊗ B 1 ⊗ η T ↓ ⏐ [ S B , C ] T ⊗ T B ω ↓ ⏐ [ S B , C ] T ⊠ S B ψ ⊗ 1 m ⊗ 1 ε T [ B , C ] ⊗ B 1 ⊗ η T ↓ ⏐ [ T B , C ] ⊗ T B C ↓ ⏐ ε ↓ ⏐ ε
Proposition I.4. Let A = ( Q , δ , i , o ) \mathcal{A}=(Q,\delta,i,o) A = ( Q , δ , i , o ) be an F E M F_{\mathrm{EM}} F EM -automaton with Q = ( Q , q ) Q=(Q,q) Q = ( Q , q ) a T T T -algebra. Then the run map τ U ‾ A \tau_{\overline{U}\mathcal{A}} τ U A of the automaton U ‾ A \overline{U}\mathcal{A} U A is the composite
Q ⊗ F ∗ 1 → 1 ⊗ η T Q ⊗ T F ∗ 1 → ω Q ⊠ S F ∗ 1 → 1 ⊠ ( φ ∗ ) − 1 Q ⊠ F E M ∗ S 1 → τ A Q . Q\otimes F^{*}1\xrightarrow{1\otimes\eta^T}Q\otimes TF^{*}1\xrightarrow{\omega}Q\boxtimes SF^{*}1\xrightarrow{1\boxtimes(\varphi^{*})^{-1}}Q\boxtimes F_{\mathrm{EM}}^{*}S1\xrightarrow{\tau_{\mathcal{A}}}Q. Q ⊗ F ∗ 1 1 ⊗ η T Q ⊗ T F ∗ 1 ω Q ⊠ S F ∗ 1 1 ⊠ ( φ ∗ ) − 1 Q ⊠ F EM ∗ S 1 τ A Q .
Proof. Let us write δ ˉ : F Q → Q \bar{\delta}:FQ\to Q δ ˉ : F Q → Q for the F F F -algebra structure of U ‾ A \overline{U}A U A . Since ω \omega ω is natural and q ∘ η T = 1 q\circ\eta^{T}=1 q ∘ η T = 1 , we have
( 1 ⊠ ( φ ∗ ) − 1 ) ∘ ω ∘ ( 1 ⊠ η T ) = ω ∘ ( 1 ⊠ ( φ ∗ ) − 1 ) ∘ ( 1 ⊠ η T ) = ω ∘ ( q ⊠ 1 ) ∘ ( 1 ⊠ ( φ ∗ ) − 1 ) ∘ ( η T ⊠ η T ) . \begin{aligned}
\left(1\boxtimes(\varphi^{*})^{-1}\right)\circ\omega\circ\left(1\boxtimes\eta^{T}\right)
=\omega\circ\left(1\boxtimes(\varphi^{*})^{-1}\right)\circ\left(1\boxtimes\eta^{T}\right) \\
&=\omega\circ(q\boxtimes1)\circ\left(1\boxtimes(\varphi^{*})^{-1}\right)\circ\left(\eta^{T}\boxtimes\eta^{T}\right).
\end{aligned} ( 1 ⊠ ( φ ∗ ) − 1 ) ∘ ω ∘ ( 1 ⊠ η T ) = ω ∘ ( 1 ⊠ ( φ ∗ ) − 1 ) ∘ ( 1 ⊠ η T ) = ω ∘ ( q ⊠ 1 ) ∘ ( 1 ⊠ ( φ ∗ ) − 1 ) ∘ ( η T ⊠ η T ) .
Hence, it suffices to show that the outside of the following diagram commutes:
Q ⊠ F ∗ 1 → α ∗ F ∗ ( Q ⊠ 1 ) → F ∗ ρ F ∗ Q → δ ˉ ∗ Q ↓ η T ⊠ η T ↓ η T ↓ η T ↓ T Q ⊠ T F ∗ 1 → θ T ( Q ⊠ F ∗ 1 ) → T σ ∗ T F ∗ ( Q ⊠ 1 ) → T F ∗ ρ T F ∗ Q → ( δ ˉ ∗ ) # Q ∥ ↑ θ ˉ ↑ φ ∗ ↑ φ ∗ ∥ T Q ⊠ T F ∗ 1 → ω S Q ⊠ S F ∗ 1 F E M ∗ S ( Q ⊠ 1 ) → F E M ∗ S ρ F E M ∗ S Q ↑ 1 ⊠ η ∗ ↑ 1 ⊠ η ∗ ↑ F E M ∗ θ ˉ ↑ F E M ∗ τ T Q ⊠ F E M ∗ S 1 → ω S Q ⊠ F E M ∗ S 1 → σ E M ∗ F E M ∗ ( S Q ⊠ S 1 ) → F E M ∗ S ρ F E M ∗ S Q ↓ q ⊠ 1 ↓ q ⊠ 1 ↓ F E M ∗ ( q ⊠ 1 ) ↓ F E M ∗ q Q ⊠ F E M ∗ S 1 → ω Q ⊠ F E M ∗ S 1 → σ E M ∗ F E M ∗ ( Q ⊠ S 1 ) → F E M ∗ τ F E M ∗ Q → δ ∗ Q \begin{array}{ccccc}
Q\boxtimes F^{*}1 & \xrightarrow{\alpha^{*}} & F^{*}(Q\boxtimes1) & \xrightarrow{F^{*}\rho} & F^{*}Q \xrightarrow{\bar{\delta}^{*}} Q \\
\downarrow{\eta^{T}\boxtimes\eta^{T}} & & \downarrow{\eta^{T}} & & \downarrow{\eta^{T}} \ \downarrow\\
TQ\boxtimes TF^{*}1 & \xrightarrow{\theta} & T(Q\boxtimes F^{*}1) \xrightarrow{T\sigma^{*}} & TF^{*}(Q\boxtimes1) \xrightarrow{TF^{*}\rho} & TF^{*}Q \xrightarrow{(\bar{\delta}^{*})^{\#}} Q \\
\Vert& & \uparrow{\bar{\theta}} & & \uparrow{\varphi^{*}} \ \uparrow{\varphi^{*}} \ \Vert\\
TQ\boxtimes TF^{*}1 & \xrightarrow{\omega} & SQ\boxtimes SF^{*}1 & & F^{*}_{\mathrm{EM}}S(Q\boxtimes1) \xrightarrow{F^{*}_{\mathrm{EM}}S\rho} F^{*}_{\mathrm{EM}}SQ \\
\uparrow{1\boxtimes\eta^{*}} & & \uparrow{1\boxtimes\eta^{*}} & & \uparrow{F^{*}_{\mathrm{EM}}\bar{\theta}} \quad\uparrow{F^{*}_{\mathrm{EM}}\tau} \\
TQ\boxtimes F^{*}_{\mathrm{EM}}S1 & \xrightarrow{\omega} & SQ\boxtimes F^{*}_{\mathrm{EM}}S1 \xrightarrow{\sigma^{*}_{\mathrm{EM}}} & F^{*}_{\mathrm{EM}}(SQ\boxtimes S1) & \xrightarrow{F^{*}_{\mathrm{EM}}S\rho} F^{*}_{\mathrm{EM}}SQ \\
\downarrow{q\boxtimes1} & & \downarrow{q\boxtimes1} & \downarrow{F^{*}_{\mathrm{EM}}(q\boxtimes1)} & \downarrow{F^{*}_{\mathrm{EM}}q} \\
Q\boxtimes F^{*}_{\mathrm{EM}}S1 & \xrightarrow{\omega} & Q\boxtimes F^{*}_{\mathrm{EM}}S1 \xrightarrow{\sigma^{*}_{\mathrm{EM}}} & F^{*}_{\mathrm{EM}}(Q\boxtimes S1) \xrightarrow{F^{*}_{\mathrm{EM}}\tau} & F^{*}_{\mathrm{EM}}Q \xrightarrow{\delta^{*}} Q
\end{array} Q ⊠ F ∗ 1 ↓ η T ⊠ η T T Q ⊠ T F ∗ 1 ∥ T Q ⊠ T F ∗ 1 ↑ 1 ⊠ η ∗ T Q ⊠ F EM ∗ S 1 ↓ q ⊠ 1 Q ⊠ F EM ∗ S 1 α ∗ θ ω ω ω F ∗ ( Q ⊠ 1 ) ↓ η T T ( Q ⊠ F ∗ 1 ) T σ ∗ ↑ θ ˉ S Q ⊠ S F ∗ 1 ↑ 1 ⊠ η ∗ S Q ⊠ F EM ∗ S 1 σ EM ∗ ↓ q ⊠ 1 Q ⊠ F EM ∗ S 1 σ EM ∗ F ∗ ρ T F ∗ ( Q ⊠ 1 ) T F ∗ ρ F EM ∗ ( S Q ⊠ S 1 ) ↓ F EM ∗ ( q ⊠ 1 ) F EM ∗ ( Q ⊠ S 1 ) F EM ∗ τ F ∗ Q δ ˉ ∗ Q ↓ η T ↓ T F ∗ Q ( δ ˉ ∗ ) # Q ↑ φ ∗ ↑ φ ∗ ∥ F EM ∗ S ( Q ⊠ 1 ) F EM ∗ S ρ F EM ∗ S Q ↑ F EM ∗ θ ˉ ↑ F EM ∗ τ F EM ∗ S ρ F EM ∗ S Q ↓ F EM ∗ q F EM ∗ Q δ ∗ Q
In the diagram above, all unlabelled areas commute either by definition, naturality properties, the commutativity of T T T , Lemma F.2 , or Lemma F.7 . The area labelled ( × ) (\times) ( × ) commutes since ( S , θ ˉ , 1 ) (S,\bar{\theta},1) ( S , θ ˉ , 1 ) is a monoidal functor [57 Remark 2.7.3] . To show that ( ∗ ) (*) ( ∗ ) commutes, we use the freeness of F E M ∗ S Q F^{*}_{\mathrm{EM}}SQ F EM ∗ S Q and show that both sides are F E M F_{\mathrm{EM}} F EM -algebra homomorphisms such that precomposition with η E M \eta_{\mathrm{EM}} η EM results in the same morphism. By definition, the bottom side is a composite homomorphism ( F E M ∗ S Q , ζ E M ) → F E M ∗ q ( F E M ∗ Q , ζ E M ) → δ ∗ ( Q , δ ) (F^{*}_{\mathrm{EM}}SQ,\zeta_{\mathrm{EM}})\xrightarrow{F^{*}_{\mathrm{EM}}q}(F^{*}_{\mathrm{EM}}Q,\zeta_{\mathrm{EM}})\xrightarrow{\delta^{*}}(Q,\delta) ( F EM ∗ S Q , ζ EM ) F EM ∗ q ( F EM ∗ Q , ζ EM ) δ ∗ ( Q , δ ) and φ Q ∗ \varphi^{*}_{Q} φ Q ∗ is a homomorphism ( F E M ∗ S Q , ζ E M ) → S ( F ∗ Q , ζ ) (F^{*}_{\mathrm{EM}}SQ,\zeta_{\mathrm{EM}})\to S(F^{*}Q,\zeta) ( F EM ∗ S Q , ζ EM ) → S ( F ∗ Q , ζ ) . Furthermore, δ ˉ ∗ \bar{\delta}^{*} δ ˉ ∗ is an F F F -algebra homomorphism ( F ∗ Q , ζ ) → ( Q , δ ˉ ) = U ‾ ( Q , δ ) (F^{*}Q,\zeta)\to(Q,\bar{\delta})=\overline{U}(Q,\delta) ( F ∗ Q , ζ ) → ( Q , δ ˉ ) = U ( Q , δ ) by definition, so Theorem G.1 implies that ( δ ˉ ∗ ) # (\bar{\delta}^{*})^{\#} ( δ ˉ ∗ ) # is a homomorphism S ( F ∗ Q , ζ ) → ( Q , δ ) S(F^{*}Q,\zeta)\to(Q,\delta) S ( F ∗ Q , ζ ) → ( Q , δ ) . Finally, we have
δ ∗ ∘ F E M ∗ q ∘ η E M = δ ∗ ∘ η E M ∘ q = q = q ∘ S δ ˉ ∗ ∘ S η = ( δ ˉ ∗ ) # ∘ φ Q ∗ ∘ η E M , \delta^{*}\circ F^{*}_{\mathrm{EM}}q\circ\eta_{\mathrm{EM}}
=\delta^{*}\circ\eta_{\mathrm{EM}}\circ q
=q
=q\circ S\bar{\delta}^{*}\circ S\eta
=(\bar{\delta}^{*})^{\#}\circ\varphi^{*}_{Q}\circ\eta_{\mathrm{EM}}, δ ∗ ∘ F EM ∗ q ∘ η EM = δ ∗ ∘ η EM ∘ q = q = q ∘ S δ ˉ ∗ ∘ S η = ( δ ˉ ∗ ) # ∘ φ Q ∗ ∘ η EM ,
which concludes the proof.
Proof of Proposition I.2. Consider the following diagram:
Q → ℓ A [ F E M ∗ S 1 , S O ] T → [ S ~ w , 1 ] T [ S W , S O ] T ↘ ℓ U ‾ A ↓ [ ( φ ∗ ) − 1 , 1 ] T ↙ [ S w ~ , 1 ] T ↓ ψ [ S F ∗ 1 , S O ] T → [ S w , 1 ] T [ W , S O ] T ↓ ψ ↓ ψ [ F ∗ 1 , T O ] → [ w , 1 ] [ W , T O ] \begin{array}{ccccc}
Q & \xrightarrow{\ell_{A}} & [F^{*}_{\mathrm{EM}}S1,SO]_{T} & \xrightarrow{[\widetilde{S}w,1]_{T}} & [SW,SO]_{T} \\
& \searrow{\ell_{\overline{U}A}} & \downarrow{[(\varphi^{*})^{-1},1]_{T}} & \swarrow{[S\widetilde{w},1]_{T}} & \downarrow{\psi} \\
& & [SF^{*}1,SO]_{T} & \xrightarrow{[S w,1]_{T}} & [W,SO]_{T} \\
& & \downarrow{\psi} & & \downarrow{\psi} \\
& & [F^{*}1,TO] & \xrightarrow{[w,1]} & [W,TO]
\end{array} Q ℓ A ↘ ℓ U A [ F EM ∗ S 1 , S O ] T ↓ [( φ ∗ ) − 1 , 1 ] T [ S F ∗ 1 , S O ] T ↓ ψ [ F ∗ 1 , T O ] [ S w , 1 ] T ↙ [ S w , 1 ] T [ S w , 1 ] T [ w , 1 ] [ S W , S O ] T ↓ ψ [ W , S O ] T ↓ ψ [ W , T O ]
The square commutes by the naturality of ψ \psi ψ , the triangle above it commutes by the definition of S ~ \widetilde{S} S , and the triangle on the left commutes by Lemma I.3 and Proposition I.4 since
[ ( φ ∗ ) − 1 , 1 ] T ∘ ℓ A = Λ T ( ∘ ∘ τ A ∘ ( 1 ⊠ ( φ ∗ ) − 1 ) ) . \left[(\varphi^{*})^{-1},1\right]_{T}\circ\ell_{A}
=\Lambda^{T}\left(\circ\circ\tau_{A}\circ\left(1\boxtimes(\varphi^{*})^{-1}\right)\right). [ ( φ ∗ ) − 1 , 1 ] T ∘ ℓ A = Λ T ( ∘ ∘ τ A ∘ ( 1 ⊠ ( φ ∗ ) − 1 ) ) .
Hence, the top composite equalises f f f and g g g if and only if the bottom composite does. Since ψ \psi ψ is an isomorphism, the claim follows.
Proof of Lemma 5.6
Recall the concatenation map ξ \xi ξ from Definition 3.6 . Let us write ξ E M \xi_{\mathrm{EM}} ξ EM for the morphism ξ \xi ξ interpreted in E M ( T ) \mathrm{EM}(T) EM ( T ) .
Lemma J.1. The following diagram commutes:
F E M ∗ S I □ F E M ∗ S 1 → ξ E M F E M ∗ S I φ ∗ □ φ ∗ ↓ ↓ φ ∗ S F ∗ I □ S F ∗ 1 → θ ˉ S ( F ∗ I ⊗ F ∗ 1 ) → S ξ S F ∗ I \begin{CD}
F^{*}_{\mathrm{EM}}SI \mathbin{\square} F^{*}_{\mathrm{EM}}S1 @>{\xi_{\mathrm{EM}}}>> F^{*}_{\mathrm{EM}}SI \\
@V{\varphi^{*}\mathbin{\square}\varphi^{*}}VV @VV{\varphi^{*}}V \\
SF^{*}I \mathbin{\square} SF^{*}1 @>{\bar{\theta}}>> S(F^{*}I \otimes F^{*}1) @>{S\xi}>> SF^{*}I
\end{CD} F EM ∗ S I □ F EM ∗ S 1 φ ∗ □ φ ∗ ↓ ⏐ S F ∗ I □ S F ∗ 1 ξ EM θ ˉ F EM ∗ S I ↓ ⏐ φ ∗ S ( F ∗ I ⊗ F ∗ 1 ) S ξ S F ∗ I
Proof. Diagram chase using the naturality of φ ∗ \varphi^{*} φ ∗ , σ E M ∗ \sigma_{\mathrm{EM}}^{*} σ EM ∗ , ρ \rho ρ , and ρ T \rho^{T} ρ T , that φ ∗ \varphi^{*} φ ∗ is an F E M F_{\mathrm{EM}} F EM -algebra morphism ( F E M ∗ I , ζ E M ) → S ~ ( F ∗ I , ζ ) (F^{*}_{\mathrm{EM}}I,\zeta_{\mathrm{EM}}) \to\widetilde{S}(F^{*}I,\zeta) ( F EM ∗ I , ζ EM ) → S ( F ∗ I , ζ ) , that T T T is commutative, and Lemma F.7 .
Lemma J.2. For all k ∈ N k \in\mathbb{N} k ∈ N and a : A → F ∗ I a:A \to F^{*}I a : A → F ∗ I , there is an isomorphism making the diagram on the left commute. For a : A → F ∗ I a:A \to F^{*}I a : A → F ∗ I and b : B → F ∗ 1 b:B \to F^{*}1 b : B → F ∗ 1 , the diagram on the right commutes.
( S A ) ↑ k → ≅ S ( A ↑ k ) ( S ~ a ) ↑ k ↓ ↓ S ~ ( a ↑ k ) F E M ∗ S I = F E M ∗ S I S A □ S B → θ ˉ S ( A ⊗ B ) S ~ a ⋅ S ~ b ↓ ↓ S ~ ( a ⋅ b ) F E M ∗ S I = F E M ∗ S I \begin{CD}
(SA)^{\uparrow k} @>{\cong}>> S(A^{\uparrow k}) \\
@V{(\widetilde{S}a)^{\uparrow k}}VV @VV{\widetilde{S}(a^{\uparrow k})}V \\
F^{*}_{\mathrm{EM}}SI @= F^{*}_{\mathrm{EM}}SI
\end{CD}
\qquad
\begin{CD}
SA \mathbin{\square} SB @>{\bar{\theta}}>> S(A \otimes B) \\
@V{\widetilde{S}a\mathbin{\cdot}\widetilde{S}b}VV @VV{\widetilde{S}(a\cdot b)}V \\
F^{*}_{\mathrm{EM}}SI @= F^{*}_{\mathrm{EM}}SI
\end{CD} ( S A ) ↑ k ( S a ) ↑ k ↓ ⏐ F EM ∗ S I ≅ S ( A ↑ k ) ↓ ⏐ S ( a ↑ k ) F EM ∗ S I S A □ S B S a ⋅ S b ↓ ⏐ F EM ∗ S I θ ˉ S ( A ⊗ B ) ↓ ⏐ S ( a ⋅ b ) F EM ∗ S I
Proof. The first diagram is proved commutative by induction on k k k . The base case k = 0 k=0 k = 0 is trivial since a ↑ 0 = a a^{\uparrow0}=a a ↑ 0 = a . The inductive case follows from the special case k = 1 k=1 k = 1 , where we use the isomorphism φ ∗ \varphi^{*} φ ∗ and θ ˉ \bar{\theta} θ ˉ , that S S S preserves coproducts (being a left adjoint), and the definition of S ~ \widetilde{S} S . The second diagram commutes by the definition of S ~ \widetilde{S} S and Lemma J.1.
Proof of Lemma 5.6. Immediate from Lemma J.2.
Remaining proofs
Proof of Theorem 5.7. Follows from Theorems 3.10 , 4.15 , and 5.5 and Lemma 5.6 , noting that U c , E M k ⊆ U k k U^{k}_{c,\mathrm{EM}} \subseteq U^{k}_{k} U c , EM k ⊆ U k k in E M ( T ) \mathrm{EM}(T) EM ( T ) by Theorem 5.5 (1).
Proof of Corollary 5.8. Immediate consequence of Theorem 5.7 , using that E t Et E t is complete for S S S w.r.t. U c , K l k U^{k}_{c,\mathrm{Kl}} U c , Kl k iff S ~ t \widetilde{S}t S t is complete for K ‾ S \overline{K}S K S w.r.t. U c , E M k U^{k}_{c,\mathrm{EM}} U c , EM k . This latter fact relies on the equality B ‾ K S = K B S ∘ φ ∗ \overline{B}_{KS}=KB_{S}\circ\varphi^{*} B K S = K B S ∘ φ ∗ , which follows from Propositions 4.16 and 4.17 .
Additional details of the applications (NFA and WFA)
Nondeterministic automata
We give the precise definition of the NFA A n A_n A n accepting the language L n : = Σ ∗ a Σ n L_n := \Sigma^{*}a\Sigma^{n} L n := Σ ∗ a Σ n for arbitrary n n n as follows. The state space is the finite set Q : = { q i ∣ 0 ≤ i ≤ n + 1 } Q := \{q_i \mid0 \leq i \leq n+1\} Q := { q i ∣ 0 ≤ i ≤ n + 1 } with a single initial state Q 0 : = { q 0 } Q_0 := \{q_0\} Q 0 := { q 0 } . There is also a unique accepting state: A : = { q n + 1 } A := \{q_{n+1}\} A := { q n + 1 } . Finally, the transition function δ : Q × Σ → P f Q \delta:Q \times\Sigma\to\mathcal{P}_{f}Q δ : Q × Σ → P f Q is given by
δ ( q 0 , a ) : = { q 0 , q 1 } , δ ( q 0 , b ) : = { q 0 } , δ ( q i , s ) : = { q i + 1 } for 1 ≤ i ≤ n and s ∈ Σ , δ ( q n + 1 , s ) : = ∅ for s ∈ Σ . \begin{aligned}
\delta(q_0,a)&:=\{q_0,q_1\},\\
\delta(q_0,b)&:=\{q_0\},\\
\delta(q_i,s)&:=\{q_{i+1}\} && \text{for }1\leq i\leq n\text{ and }s\in\Sigma,\\
\delta(q_{n+1},s)&:=\varnothing&& \text{for }s\in\Sigma.
\end{aligned} δ ( q 0 , a ) δ ( q 0 , b ) δ ( q i , s ) δ ( q n + 1 , s ) := { q 0 , q 1 } , := { q 0 } , := { q i + 1 } := ∅ for 1 ≤ i ≤ n and s ∈ Σ , for s ∈ Σ.
Note that the NFA has exactly n + 2 n+2 n + 2 states. The determinisation V ‾ A n \overline{V}\mathcal{A}_n V A n into Set consists of all subsets of Q Q Q containing the element q 1 q_1 q 1 and so it has 2 n + 1 2^{n+1} 2 n + 1 states. The empty set does not need to be included, but it will be included in the determinisation K ‾ A n \overline{K}\mathcal{A}_n K A n into E M ( P f ∗ ) \mathrm{EM}(\mathcal{P}_{f^*}) EM ( P f ∗ ) , even after minimisation, because P f ∗ \mathcal{P}_{f^*} P f ∗ -algebras contain a 0-element.
The size of the effectful state cover is not always linear in the size of the NFA. The elements in the state cover correspond to the join-irreducible elements of the algebra which in turn correspond to states of the canonical RFSA. Denis et al. give an example of an NFA of which the canonical RFSA is exponentially large [19 ] , this example would also need exponentially many elements in the effectful state cover.
Details for the test suite of A 2 \mathcal{A}_2 A 2
The structure map δ C \delta_C δ C was given by:
ε , a ↦ ε ∨ a a b , a ↦ ε ∨ a ∨ a b b a , a ↦ ε ∨ a ∨ a b a b b , a ↦ ε ∨ a ε , b ↦ ε a b , b ↦ ε ∨ a b b a , b ↦ ε ∨ a b a b b , b ↦ ε \begin{aligned}
\varepsilon,a &\mapsto\varepsilon\lor a & ab,a &\mapsto\varepsilon\lor a \lor abb & a,a &\mapsto\varepsilon\lor a \lor ab & abb,a &\mapsto\varepsilon\lor a \\
\varepsilon,b &\mapsto\varepsilon& ab,b &\mapsto\varepsilon\lor abb & a,b &\mapsto\varepsilon\lor ab & abb,b &\mapsto\varepsilon
\end{aligned} ε , a ε , b ↦ ε ∨ a ↦ ε ab , a ab , b ↦ ε ∨ a ∨ abb ↦ ε ∨ abb a , a a , b ↦ ε ∨ a ∨ ab ↦ ε ∨ ab abb , a abb , b ↦ ε ∨ a ↦ ε
The map δ C \delta_C δ C is not uniquely determined. Elements highlighted in grey can optionally be left out, in each case the map satisfies the requirements of Definition 5.1. Since the set C C C does not depend on these choices, the resulting test suite does not depend on these choices.
For A 2 \mathcal{A}_2 A 2 the resulting test suite is:
im ( t ) = { ε , a , a a , a a a , a a a a , a a a a a , a b , a b a , a b a a , a b a a a , a b a a a a , a b b , a b b a , a b b a a , a b b a a a , a b b a a a a , a b b b , a b b b a , a b b b a a , a b b b a a a , b , b a , b a a , b a a a } \operatorname{im}(t)=\{\varepsilon,a,aa,aaa,aaaa,aaaaa,ab,aba,abaa,abaaa,abaaaa,abb,abba,
abb aa,abbaaa,abbaaaa,abbb,abbba,abbbaa,abbbaaa,b,ba,baa,baaa\} im ( t ) = { ε , a , aa , aaa , aaaa , aaaaa , ab , aba , abaa , abaaa , abaaaa , abb , abba , abbaa , abbaaa , abbaaaa , abbb , abbba , abbbaa , abbbaaa , b , ba , baa , baaa }
Weighted Automata
We first make some general remarks on the theory introduced in Section 6.2. We follow these by a more precise definition of the example B n \mathcal{B}_n B n .
Example WFA
The WFA B n \mathcal{B}_n B n recognises the weighted language L ~ n \widetilde{L}_n L n given by
L ~ n ( v ) : = { 2 k if v = u a x for some u ∈ Σ ∗ and x ∈ Σ n , and ∣ u ∣ a = k , 0 otherwise. \widetilde{L}_n(v):=
\begin{cases}
2^k & \text{if } v=uax \text{ for some } u\in\Sigma^* \text{ and } x\in\Sigma^n,\text{ and } |u|_a=k,\\
0 & \text{otherwise.}
\end{cases} L n ( v ) := { 2 k 0 if v = u a x for some u ∈ Σ ∗ and x ∈ Σ n , and ∣ u ∣ a = k , otherwise.
The state space of B n \mathcal{B}_n B n is Q : = { q i ∣ 0 ≤ i ≤ n + 1 } Q := \{q_i \mid0 \le i \le n+1\} Q := { q i ∣ 0 ≤ i ≤ n + 1 } with the initial configuration i ( ∗ ) : = q 0 i(\ast) := q_0 i ( ∗ ) := q 0 . The final vector is given by o ( q n + 1 ) = 1 o(q_{n+1}) = 1 o ( q n + 1 ) = 1 and o ( q i ) = 0 o(q_i) = 0 o ( q i ) = 0 for i ≠ n + 1 i \ne n+1 i = n + 1 . Finally, the transition function δ : Q × Σ → Lin Z ( Q ) \delta: Q \times\Sigma\to\operatorname{Lin}_{\mathbb{Z}}(Q) δ : Q × Σ → Lin Z ( Q ) is given by
δ ( q 0 , a ) : = 2 ⋅ q 0 + q 1 , δ ( q 0 , b ) : = q 0 , δ ( q i , s ) : = q i + 1 for 1 ≤ i ≤ n and s ∈ Σ , δ ( q n , s ) : = 0 for s ∈ Σ . \begin{aligned}
\delta(q_0,a) &:= 2 \cdot q_0 + q_1,\\
\delta(q_0,b) &:= q_0,\\
\delta(q_i,s) &:= q_{i+1} && \text{for } 1 \le i \le n \text{ and } s \in\Sigma,\\
\delta(q_n,s) &:= 0 && \text{for } s \in\Sigma.
\end{aligned} δ ( q 0 , a ) δ ( q 0 , b ) δ ( q i , s ) δ ( q n , s ) := 2 ⋅ q 0 + q 1 , := q 0 , := q i + 1 := 0 for 1 ≤ i ≤ n and s ∈ Σ , for s ∈ Σ.
The map δ C \delta_C δ C is given by:
ε , a ↦ 1 ⋅ a ε , b ↦ 1 ⋅ ε a , a ↦ 1 ⋅ a a a , b ↦ 2 ⋅ ε − 2 ⋅ a + 1 ⋅ a a a a , a ↦ 1 ⋅ a a a a a , b ↦ 4 ⋅ ε − 4 ⋅ a + 1 ⋅ a a a a a a , a ↦ 2 ⋅ a a a a a a , b ↦ 16 ⋅ ε − 8 ⋅ a + 2 ⋅ a a a \begin{aligned}
\varepsilon,a &\mapsto1 \cdot a & \varepsilon,b &\mapsto1 \cdot\varepsilon\\
a,a &\mapsto1 \cdot aa & a,b &\mapsto2 \cdot\varepsilon- 2 \cdot a + 1 \cdot aa\\
aa,a &\mapsto1 \cdot aaa & aa,b &\mapsto4 \cdot\varepsilon- 4 \cdot a + 1 \cdot aaa\\
aaa,a &\mapsto2 \cdot aaa & aaa,b &\mapsto16 \cdot\varepsilon- 8 \cdot a + 2 \cdot aaa
\end{aligned} ε , a a , a aa , a aaa , a ↦ 1 ⋅ a ↦ 1 ⋅ aa ↦ 1 ⋅ aaa ↦ 2 ⋅ aaa ε , b a , b aa , b aaa , b ↦ 1 ⋅ ε ↦ 2 ⋅ ε − 2 ⋅ a + 1 ⋅ aa ↦ 4 ⋅ ε − 4 ⋅ a + 1 ⋅ aaa ↦ 16 ⋅ ε − 8 ⋅ a + 2 ⋅ aaa
For B 2 \mathcal{B}_2 B 2 , the resulting test suite is:
im ( t ) = { ε , a , a a , a a a , a a a a , a a a a a , a a a a a a , a a a a a a a , b , b a , b a a , b a a a , a b , a b a , a b a a , a b a a a , a a b , a a b a , a a b a a , a a b a a a , a a a b , a a a b a , a a a b a a , a a a b a a a } \operatorname{im}(t) = \{\varepsilon, a, aa, aaa, aaaa, aaaaa, aaaaaa, aaaaaaa, b, ba, baa, baaa, ab, aba, abaa, abaaa, aab, aaba, aabaa, aabaaa, aaab, aaaba, aaabaa, aaabaaa\} im ( t ) = { ε , a , aa , aaa , aaaa , aaaaa , aaaaaa , aaaaaaa , b , ba , baa , baaa , ab , aba , abaa , abaaa , aab , aaba , aabaa , aabaaa , aaab , aaaba , aaabaa , aaabaaa }