Available online at www.sciencedirect.com

W ScienceDirect

ELSEVIER Electronic Notes in Theoretical Computer Science 249 (2009) 407-427

www.elsevier.com/locate/entcs

Elgot Theories: A New Perspective of Iteration Theories (Extended Abstract)*

Jiri Adameka'2 Stefan Miliusa'2 Jiri Velebilb'1

a Institut für Theoretische Informatik, Technische Universität Braunschweig, Germany b Faculty of Electrical Engineering, Czech Technical University of Prague, Czech Republic

Abstract

The concept of iteration theory of Bloom and Esik summarizes all equational properties that iteration has in usual applications, e.g., in Domain Theory where to every system of recursive equations the least solution is assigned. However, this assignment in Domain Theory is also functorial. Yet, functoriality is not included in the definition of iteration theory. Pity: functorial iteration theories have a particularly simple axiomatization, and most of examples of iteration theories are functorial.

The reason for excluding functoriality was the view that this property cannot be called equational. This is true from the perspective of the category Sgn of signatures as the base category: whereas iteration theories are monadic (thus, equationally presentable) over Sgn, functorial iteration theories are not. In the present paper we propose to change the perspective and work, in lieu of Sgn, in the category of sets in context (the presheaf category of finite sets and functions). We prove that Elgot theories, which is our name for functorial iteration theories, are monadic over sets in context. Shortly: from the new perspective functoriality is equational.

Keywords: iteration theory, Elgot theory, iterative algebra, rational monad

1 Introduction

In Domain Theory one works in a continuous theory and one uses iteration expressed

by the fact that for every equation-morphism e: n -> n + k there exists the

least solution et: n -> k. This dagger operation e \-> et enjoys a number

of equational properties, e.g., the fact that et is a solution of e is the equation et = [et, idk]-e. The aim of the concept of iteration theory of Stephen Bloom and Zoltan Esik was to collect all equational properties of the dagger operation in Domain Theory (and in a substantial number of other applications where iteration

* The full version of this paper can be found at http://www.stefan-milius.eu.

1 Supported by the grant MSM 6840770014 of the Ministry of Edutcation of the Czech Republic.

2 Supported by the German Research Foundation (DFG) under the project "Rekursion in der koalgebrais-chen Semantik".

1571-0661/$ - see front matter © 2009 Elsevier B.V. All rights reserved. doi:10.1016/j.entcs.2009.07.100

is used, see the fundamental monograph [12]). The function e i-> et in Domain

Theory is also functorial, that is, for every given k we obtain a functor (—)t from

the category of all equation morphisms e: n-> n + k to the slice category of k.

This important property of functoriality is studied in various contexts, e.g., Alex Simpson and Gordon Plotkin call it parametrized uniformity in [22], and they say in their introduction that this is "a convenient tool for establishing that the equations of an iteration operator are satisfied". Larry Moss observed in [21] that functorial iteration theories allow for a particularly simple axiomatization. Functoriality is, however, not a part of the definition of iteration theory; this property is called "functorial dagger implication" in the monograph [12]. The name and the non-inclusion into the definition both indicate that Bloom and Esik do not consider functoriality an equational property. The aim of the present paper is to demonstrate that from a new perspective functoriality is equational. Thus Elgot theories which is our name for functorial iteration theories, form an important class of equationally specified algebraic theories. They are, as proved by Martin Hyland and by Masahito Hasegawa [18], precisely those theories that are traced cocartesian categories where the trace operation is uniform for all base morphisms.

Recall that for every signature £ the free continuous theory on £ is the theory Ts± of £^-trees: one adds to £ a new nullary symbol forming a new signature and the morphisms from 1 to n in are all £^-trees (finite and infinite) on n variables. As proved by Bloom and Esik, the free iterative theory on £ is the subtheory R^x of all rational £^-trees, that is, trees with finitely many subtrees up to isomorphism. This defines a monad Rat on the category Sgn of signatures:

Rat(£) = the signature of rational £^-trees.

We have proved recently that the Eilenberg-Moore algebras for this monad Rat are precisely the iteration theories, see [6]. It then follows from a general theory of equational presentations due to Max Kelly and John Power [19], recalled briefly in the Appendix below, that iteration theories are equationally presentable over Sgn. And the corresponding equations for dagger are precisely those that hold in Domain Theory since they are precisely those that hold in the theories or . In contrast, Elgot theories are not monadic over the category of signatures.

However, free iteration theories exist not only on all signatures, but also on all sets in context, as we proved in [4]. The latter means objects of the functor category SetF where F is the category of natural numbers and all functions between them. Thus, a set in context X assigns (like a signature) to every n £ N a set X(n) which we can consider as the set of all "formulas of type X in n variables". And (unlike

a signature) it assigns to every function p: n-> m "changing variable names" a

function Xp: X(n)-> X(m) of the corresponding "renaming of free variables"

in formulas. See for example the semantics of A-calculus presented by M. Fiore et al. [15] where A-formulas are treated as a set in context. It follows from our results in [4] that for every set in context, X £ SetF, a rational theory Rx can be constructed analogously to the rational-tree theory for a signature (see also [3] for concrete descriptions of those theories Rx). Moreover, in [7] we proved that

rational theories of the form Rx+1 are Elgot theories. Here we prove that Rx+1 is a free Elgot theory on X and that it is a quotient theory of the theory for some £. This gives a monad Rat on the category SetF. Our main result is that the Eilenberg-Moore algebras for this monad are precisely the Elgot theories. It then follows from the results of Kelly and Power [19] that Elgot theories are equationally presentable over SetF. And the corresponding equations for the dagger operation are precisely those that hold in Domain Theory because, once again, we only need to consider the free theories and they are quotients of the theories Rsx. The equational

presentation of Elgot theories is particularly simple: the solution function e i-> et

is requested to be functorial, and satisfy the Parameter Identity and the Bekic Identity, see Definition 2.8.

The first step in the proof of our result is the fact that Elgot's iterative theories [13] (i.e., theories with unique solutions of all ideal equation morphisms) are Elgot theories, see [12], Theorem 4.4.5. Here we work in a more general category theoretic setting; in lieu of theories we consider finitary monads on a locally finitely presentable and hyper-extensive category, see Assumption 3.1. In [2] it was proved that every iterative monad on such a category has unique strict solutions of all equation morphisms, and then we proved in [7] that the corresponding dagger operation satisfies all the axioms of Elgot theories.

2 Elgot Theories and Elgot Monads

Assumption 2.1 Throughout this section K denotes a locally finitely presentable category, see [16] or [10]. More detailed:

(i) K has colimits, and

(ii) K has a small full subcategory F representing all finitely presentable objects such that every object of K is a filtered colimit of objects of F.

An object n is called finitely presentable if K(n, —) preserves filtered colimits. More generally: functors preserving filtered colimits are called finitary.

Fact 2.2 A finitary functor H: K-> K is, up to natural isomorphism, fully

determined by its restriction H/f in KF. In fact, H is the left Kan extension of H/f along the inclusion F-> K. Thus, we have an equivalence of categories

KF = Fin(K)

where Fin(K) is the category of finitary endofunctors and natural transformations.

Remark 2.3 (Monads and Theories)

(i) Recall that a monad S = (S,n,f) consists of an endofunctor S: K-> K

and natural transformations n: Id-> S and f: S■S-> S such that ¡i-^S =

ids = f-Sn and ¡i-Sfi = ¡-¡S. The monad is called finitary if S is a finitary functor.

(ii) The Kleisli category Ks of S has the same objects as K and its morphisms

are the morphisms f: X-> SY of K. They compose as follows: given g: Y

—^ Z the composite gf in the Kleisli category is the K-morphism

(iii) There is the canonical functor J: K-> K> which assigns to f: X-> Y

the morphism Jf = nY f: X-> SY in K>; we will write f: X-> Y for

Jf: X —^ Y and call f a base morphism.

(iv) The theory of S is denoted by

it is the category whose objects are the objects of F and morphisms are the Kleisli morphisms.

(v) Th(S) has finite colimits formed on the level of the base category K. In particular, finite coproducts in K and in Th(S) are the same.

Example 2.4 If K = Set we can choose F to be the category of natural numbers and functions between them.

Every finitary monad S on Set is equationally presentable: there exists a signature £ and a set E of equations such that S is the monad of all free algebras in the variety Alg(£,E) presented by E. Then Th(S) is the category of natural numbers with hom-sets Th(S)(1,n) formed by terms in n variables of the variety Alg(£,E), and Th(S)(fc,n) = (Th(S)(1,n))k of fc-tuples formed by such terms.

Definition 2.5 Let S be a finitary monad.

(i) An equation morphism is a morphism e: n —^ n + k in the theory of S. We refer to k as the object of parameters. (That is, an equation morphism with k as object of parameters is given by a finitely presentable object n and a morphism e: n-> S(n + k).)

(ii) A solution of e is a morphism e^: n —^ k such that the triangle below commutes in Th(S):

Example 2.6 For S as in Example 2.4 the morphism e: n-> S(n + k) can be

viewed as n recursive equations

X^r SY SSZ-^r Z.

Th(S);

Xi « ti(x1,...,xn,yi,...,vk) i = 1,...,n

where ti is a (£,^)-term in n + k variables. A solution is then a substitution of terms x\(y1,...,yk) for variables xi making each of the formal equations an identity

x\ ti (x1 ,...,xXn,y1,...,yk) .

Remark 2.7 In the following definition we assume that every equation morphism e is given a solution et "canonically". This means that various "natural" equational properties are requested. It was observed by Larry Moss [21] that, for K = Set, this definition is equivalent to the definition of functorial iteration theory by Stephen Bloom and Zoltan Esik [12]—we state this in our setting of finitary monads of K:

Definition 2.8 An Elgot monad is a finitary monad S together with an operation e: n—^- n + k

—7-;— (for all n,k e F)

et: n^^ k

satisfying the following axioms: Solution: et = [et,k]-e.

Functoriality: Given a "homomorphism of equations", i.e., a base morphism v with

n-◦—> n + k

-s-m + k

then ft = et-v.

Parameter Identity: Given u: k —^ k', then u-et = (u • e)t where

u • e = n—>n + k-^+^rn + k'. (2)

Bekic Identity: Given e: n —^ n + m + k and f: m-> n + m + k form

eR = [et,m + k]-f: m—^ m + k, and eL = (n +[eR,k])-e: n—^ n + k then [e, f ]t = [eL,e]?]: n + m —^ k.

Remark 2.9 An Elgot theory is the theory Th(S) of an Elgot monad S. Equiv-alently, Th(S) is a traced cocartesian category with the trace uniform for base morphisms; see [18].

Example 2.10 We present some examples of Elgot theories (or monads) in Set.

(i) Partial-function theory. We consider the monad S with S = Id+1 (whose algebras are pointed sets). Its theory is Th(S) = Pfn the category of natural numbers and partial functions. To every partial function e: n —^ n + k we assign its iteration et: n —^ k defined in an element x of n iff e(x),e(e(x)),...,ei(x) are defined and ei(x) lies in k; then et(x) = ei(x).

(ii) Multifunction theory. Here we take the finite-power-set monad P/ (whose algebras are join semilattices with a least element). Its theory is

Th(Pf) = Mfn

the category of natural numbers and multifunctions. For every multifunction a: n —^ n denote by a* its iteration a* = idn U a U (a-a) U- ■ ■ Then the dagger of e: n —^ n + k is defined as follows: let a: n —^ n and b: n —^ k be the multifunctions with e = a U b, then et = b-a*.

(iii) The free-semigroup theory X i-> X + is not an Elgot theory. But we can

extend it by adding to X + an absorbing element L (that is, the binary operation of concatenation is extended by w-L = L = L-w for all w € X+). The resulting monad SX = X + + {L} is iterative, see [8], thus yields an Elgot monad, as we show in Section 3.

(iv) Infinite-tree theory. Let E be a signature and let TE(n) denote the E-algebra of all E-trees on n variables, that is, (rooted and ordered) trees with leaves labelled in n + E0 and nodes of k > 0 children labeled in Ek. This gives rise to a finitary monad T^. This was first observed by Eric Badouel [11]. Let us add one new nullary operation L. We obtain a signature = E + {L} for which is an Elgot monad.

(v) Rational-tree theory. A tree is called rational (or regular) if it has up to isomorphism only finitely many subtrees, see [17]. We denote by Re the submonad of Te formed by all rational E-trees. As proved in [12], the theory of is the free iteration theory on the signature E. We will see below that this is also the free Elgot theory on E.

Definition 2.11 Let (S, j) and (T, J) be Elgot monads. An Elgot monad mor-

phism a from (S, j) to (T, J) is a monad morphism a: S-> T that is solution-

preserving, in the sense that for every equation morphism e: n-> S(n + k) we

ak-e] = (an+k-e)*. The category of Elgot monads and their morphisms is denoted by

EM(K).

We denote its forgetful functor into KF by

U: EM(K)-► KF.

It assigns to every Elgot monad (S, j) the restriction functor S/F in KF. Remark 2.12

(i) The aim of our paper is to prove that Elgot theories are monadic over sets in context, that is, if K = Set then U is a monadic functor.

(ii) We will prove a more general result: EM(K) is monadic over KF for every locally finitely presentable category satisfying an additional assumption called hyper-extensivity.

3 Iterative Theories

In this section we prove the main technical result of our paper: free Elgot theories coincide with free iterative theories of Calvin Elgot [13]. This continues the category theoretic extension and generalization of the work of Elgot as presented in [4,5,3,2,7].

Assumption 3.1 Throughout this section we assume that K is a locally finitely presentable category which is hyper-extensive, that is, every object is a coproduct of connected objects A (where A is called connected if the hom-functor K(A, —) preserves coproducts). We also assume that a finitary monad S = (S,nS) is given. monad on

Example 3.2

(i) The categories of sets, posets, graphs and unary algebras are hyper-extensive and locally finitely presentable.

(ii) If K has both properties, so do all presheaf categories on K. Thus, SetF (equivalently, Fin(Set) is an example.

Definition 3.3 A finitary monad S is called ideal if there exists a subfunctor a: S' )—> S such that S = S' + Id with injections a and nS, and if fiS has a restriction (V')S: S'S — —> S with a-(^!)S = fiS■aS. An ideal monad is called iterative if every

equation morphism e: n-> S(n + k) which factorizes through an+k (i. e., we have

e = an+k■e' for some e' : n-> S'(n + k)) has a unique solution eJ.

Example 3.4 The monads SX = X + + {L}, Te and Re from Example 2.10 are iterative.

Remark 3.5 (i) A strict endofunctor is an endofunctor H with a chosen morphism

L: 0-> H1. Notice that every Elgot monad is strict w.r.t. the solution of e: 0

—^ 0 + 1. Also He± is strict, and for every endofunctor H the functor H + 1 is strict.

(ii) A strict natural transformation between strict functors is a natural transformation preserving L (in the obvious sense).

Theorem 3.6 (see [7]) Every strict iterative monad is an Elgot monad. Notation 3.7 We denote by

IM±(K)

the full subcategory of all strict iterative monads in EM(K). By abuse of notation, we write U : IM^(K)-> KF for the forgetful functor as in Definition 2.11.

Remark 3.8 Observe that a slightly different category and forgetful functor was used in [4]: the category

of iterative monads and ideal monad morphisms, that is monad morphisms a: S

-> T such that the natural transformation a: S' + Id-> T' + Id has the form

a = a' + Id for some natural transformation a': S'-1T'.

We have the forgetful functor

U': IM(K)-► KF

assigning to every iterative monad S = (S' + Id,^S) the restriction of the sub-functor S' to F: U'(S) = S'jF.

Theorem 3.9 (see [4]) The forgetful functor U' has a left adjoint assigning to every finitary endofunctor H of K the free iterative monad Rh on H (called the rational monad of H).

Example 3.10 For a given signature £ the associated polynomial endofunctor of Set is given by HeX = ieN X x £i. Its algebras are the classical £-algebras in Set. The functor H^ is finitary, and its rational monad is the monad Re of Example 2.10(v).

Remark 3.11 Monadic algebras for the rational monad Rh were characterized in [5] as precisely those H-algebras equipped with an operation of taking solutions of "flat" equation morphisms which satisfies two "natural" axioms. Let us recall this concept that we called Elgot algebras.

Given an algebra a: HA-> A for H, flat equation morphisms in A are the

morphisms e: n-> Hn + A, n E F, of K. For example, if H = He then whereas

general equation morphisms e: n —^ n + k are systems of equations Xi & ti with right-hand sides ti being general terms, see Example 2.6, the flat equation morphisms

e: n ~^Ylni x £i + A

have right-hand sides either as elements of A, or as flat terms a(x0,...,xi-\) for some a E £i and some variables xo,...,xi_i in n. However, each general system can be "flattened" by introducing new variables.

Definition 3.12 By an Elgot algebra for H is meant an algebra a: HA-> A

together with a function

e: n-> Hn + A

e1: n-> A

such that the following axioms hold:

Solution:

(for all n e F)

i^l (3)

Hn + A-->HA + A

Functoriality: Given a "homomorphism of of flat equations", i.e., a morphism v : n -> m with

n—^ Hn + A

->•Hm + A

then f 1-v = e^. Compositionality: Given e: n-> Hn + k

f: k-► Hk + A

(n,k e F)

form the equation morphisms f ^ • e = (Hn + f t)-e and

^ e = n + k [e'inr] ) Hn + k Hn+f ) Hn + Hk + A can +A ) H(n + k) + A, (5) where can = [H inl,H inr] is the canonical morphism. Then we have

(ff»e)t

Notation 3.13 We denote by

Elg(H)

the category of Elgot algebras and their homomorphisms, that is, those morphisms p: A -> B that preserve solutions: for every flat equation morphism

e: n -> Hn + A the corresponding equation morphism p • e = (Hn + p)-e: n

-> Hn + B fulfils

Note that every solution-preserving morphism p from (A, a, j) to (B, b, J) is a homomorphism of H-algebras, i.e., pa = bHp. We have the forgetful functor

U: Elg(H)

(A, a, f)i-► A.

Theorem 3.14 (See [5].) The category of Elgot algebras for H is isomorphic to the category of Eilenberg-Moore algebras for the rational monad Rh, shortly: U: Elg(H)-> K is monadic with the associated monad Rh•

Theorem 3.15 For every strict finitary endofunctor H the rational monad Rh is the free Elgot monad on H. That is, for every Elgot monad S and every strict

natural transformation X: H-> S there exists a unique Elgot monad morphism

m: Rh-> S extending X.

Sketch of proof. (1) The first step in our proof is the verification that for every object A of A the algebra ¡isa'Xsa : H(SA) -> SA is an Elgot algebra. Its operation ei-> et is defined for e : n-> Hn + SA as follows: apply the solution

operation of the Elgot monad S to the following equation morphism:

n^^Hn + Sn + S^^^S(n + A).

The verification that we indeed have an Elgot algebra is non-trivial, and we must omit the details here.

Since nA: A-> Rh A is the free Elgot algebra on A, we obtain the unique

Elgot algebra morphism

mA: Rh A-> SA with m^nA = nA.

(2) The next step is to prove that these morphisms mA form a natural transformation m: Rh -> S which is a monad morphism and, in fact, a morphism

of Elgot monads. The proof is quite involved making use of the axioms of Elgot monads for Rh and the way the dagger operation of Rh is defined in several steps, see [7] and [2]. Due to space constraints we have to omit the details.

(3) Finally, one needs to verify that m is the unique extension of X. □

4 The Monad Rat and its Algebras

Assumption 4.1 We still assume that K is a hyper-extensive, locally finitely presentable category. Recall that F is its small, full subcategory representing all finitely presentable objects.

Proposition 4.2 The forgetful functor U : EM(K) -> (see Defini-

tion 2.11) has a left adjoint

$: -> EM(K)

assigning to every X in the rational monad Rx+i of X + 1.

Proof. Recall that is equivalent to the category Fin(K) of finitary endo-functors. Thus, we can work with the forgetful functor in the form U: EM(K)

-> Fin(K), given by U(S) = S. This is a composite U = U■W of the forgetful

functor W into the category Fin^(K) of all strict finitary endofunctors and strict

natural transformations and the functor U: Fin^(K)-> Fin(K) forgetting ±.

From Theorem 3.15 and the fact that U has the left-adjoint X i-> X + 1 we

conclude that U has the left adjoint as stated. □

Corollary 4.3 The forgetful functor U : IM^-> of the category of strict

iterative monads has a left adjoint.

In fact, the free Elgot monad Rx+1 on the set in context X is a strict iterative monad.

Example 4.4 Here we consider K = Set.

(i) The value of $ at , see Example 3.10, is as follows: recall the notation = £ + { + } from the Introduction and observe that = + 1. Thus, $(HE±) = RE±, the rational E^-tree monad.

(ii) The value of $ at an arbitrary set in context X (considered as an endofunctor): express X as a quotient of for some £. For example, the signature £n = X(n), for all n E N, yields, by Yoneda Lemma, an epimorphism (that is, a

natural transformation with surjective components) e: -» X. We extend

it to an epimorphism e = e + 1: -» X + 1. Since $, being a left adjoint,

preserves epimorphisms, we see that $(X) = Rx+1 is a quotient of RE± via

$(e): Re±-> Rx+1. In fact, in [3] the monad Rx+1 was described concretely:

if e is given by a set E of equations (between flat E-terms), then Rx+1 is the quotient of RE± modulo a potentially infinite application of the equations in E.

Definition 4.5 We denote by Rat the monad on KF given by the adjunction $ H U above. Thus, on objects X we have Rat(X) = Rx+1/F, where Rx+1 is the underlying functor of the rational monad of X +1.

Theorem 4.6 The forgetful functor U of the category of Elgot monads is monadic, with Rat as the corresponding monad.

Proof. We know from Proposition 4.2 that U has a left adjoint and the corresponding monad is Rat. Thus, we only need to prove that U creates coequalizers of U-split pairs, then monadicity follows from Beck's Theorem, see [20]. In more detail, suppose we are given a pair of parallel Elgot monad morphisms a, ft: (T, J) -> (S, I) and natural transformations

____C for C in Fin(K)

such that

^■a = ^-ft, ^-a = idc, ft-r = ids, and a-^ = a-r. (7)

We must prove that there exists a unique Elgot monad C on C such that ^: S

-> C is an Elgot monad morphism, and moreover, ^ is a coequalizer of a and ft

in EM(K).

It is a trivial application of Beck's Theorem that for the category FM(K)

of finitary monads on K the forgetful functor V: FM(K) -> KF given by

V(S) = S/F is monadic. Consequently, V creates the coequalizer above, thus there

exists a unique structure C = (C,nC ) of a finitary monad such that ty is a monad morphism and a coequalizer of a and 3 in FM(X).

Next, we prove that there exists at most one structure e i-> e* of an Elgot

monad on C for which ty is solution-preserving. In fact, the equation tyk■f t =

(tyn+k■f )* of Definition 2.11, where f : n-> S(n + k), implies that e* must be

defined, for every e : n-> C(n + k), by

e* = tyk ■(un+k ■e)t. With this definition ty preserves solutions: due to (7) we have

(tyn+k ■f) * = tyk-(un+k■tyn+k ■f ) = tyk •( an+k ■Tn+k ■f)* = tyk ■ak■ (Tn+kf) *

since a is solution preserving. The last morphism is tyk ■f ^ since (7) and the fact that 3 is solution-preserving yield

tyk^k ■(Tn+k ■f )* = tyk 3k ■ {Tn+k ■f * = tyk■ (3n+k ■Tn+k ■f f = tyk ■f f

We will verify below that (—)* satisfies the axioms of Elgot monads. Then it is easy to prove that ty is the coequalizer of a and 3 in EM(K). (a) Proof of Solution. In the diagram

all inner parts commute: this is clear for the right-hand square since ty: §-> C is

a monad morphism, for the middle square due to Solution w.r.t. §, and the left-hand triangle follows from (7). The lower square is easy to verify.

(b) Proof of Functoriality. Every homomorphism of equations v w.r.t. C yields one w.r.t. § by the naturality of a:

C (n + k) —

C(v+k)

n'-;—> C (n' + k) —

-i»S(n + k)

S(v+k)

■+S (n' + k)

The desired triangle follows from Functoriality w.r.t. S:

> C (n + k) and u : k —^ k', we

->• S (n + k') (recall

(c) Proof of Parameter Identity. Given e: n ■

first relate u • e: n-> C(n + k') and (a^-u) • (an+ke): n

the definition of • from (2)). In the following diagram we use (2) expressed in the base category K for the equation morphisms of interest; the commutativity of the diagram

> S (n + k)S(nS+a u\s(Sn + Sk')^^ SS(n + k') ^ ) S (n + k')

<j\ S can

C(n + k)cnTTu,C(Cn + Ck') ccan CC(n + k') C ; C(n + k')

'C(VS +u)

implies

(u • e)* = •((au) • (ae)) .

To see that the Parameter Identity holds for (—)* we now verify that the following diagram commutes:

(u.e)*

The upper part commutes by (8), the left-hand square by the Parameter Identity for S, for the inner and left-hand triangles use (7), and all other parts commute since ^ is a monad morphism.

(d) Proof of Bekic Identity. Given e: n -> C(n + m + k) and f: m ->

C(n + m + k) we form the morphisms ei and eR for e as in Definition 2.8 applied to C. And we also form, for a-e and a-f, the corresponding morphisms w.r.t. S and denote them by el and er, respectively. For er we get the diagram (written in K once more)

mffC (n + m + kS(n + m + k) S[(a-e)i'nS] > SS(m + k) ■

>S(m + k)

>C (n + m + k)-

C[e*,VC ]

^CC(m + k) C(m + k)

which clearly commutes (recall (7)). This implies, since ty is solution-preserving,

eR = tyk-£R. (10)

Analogously, for el we have

C(n + m + k) S(n + m + k) ^+[£r'vS]) > S(Sn + Sk) —S-3S(n + k)

C (n + m + k) -

C(nC + [eR ,nC ])

->C (Cn + Ck)-

Is •S can

IiC •Ccan

The commutativity of the middle square follows from

ci i i i\ S(nS+[eRnS]) ,cic i ai\ S (n + m + k)-> S (Sn + Sk)

->C (n + k) (11)

P(S+S)

C (n + m + k) —C(nS+\-eRnS) , c (Sn + Sk)

C(nC+[eR n^)

C(P+P) C (Cn + Ck)

The square is the naturality of ty, the triangle is easy: delete C and consider the components separately using ty-^S = nC (since ty is a monad morphism) and (10). From (11) we derive (analogously to (10))

eL = ^k'E*L-

The upper triangles follow from a-[e,f] = [a-e,a-f] using Bekic Identity for S, and the lower ones follow from (10) and (12). □

Remark 4.7 Notice that in the proof of Functoriality the naturality of a: C-> S

is essential, whereas it is not used in the proof of the other axioms. This accounts for the fact that Functoriality is not an axiom for iteration theories, where one works over the category Sgn of signatures, see [6]. But for Elgot theories Functoriality is an equational axiom (or rather, an infinite set of axioms) since we are working over the category Fin(K) of finitary endofunctors of K (or, equivalently, sets in context K'F). We shall further discuss this in the Appendix below.

Corollary 4.8 Elgot monads are precisely the monadic algebras for the monad Rat on KF.

In fact, since U is monadic, we have an isomorphism between the categories of Elgot monads and of algebras for Rat:

EM(K) = (,KF )Rat.

Corollary 4.9 The axioms of Elgot monads on Set precisely summarize all equa-tional properties that the assignment

e) = least solution of e

has in Domain Theory. More detailed:

(i) If an equation over SetF holds for least solutions in all continuous theories, then that equation follows from the axioms of Elgot monads, and

(ii) Every axiom of Elgot monads holds in all continuous theories.

In fact, (ii) has been proved by Stephen Bloom and Zoltan Esik in [12]. To see (i), apply the results of Max Kelly and John Power in the Appendix to the monad Rat. We know that the algebras for Rat form an equational class for some signature r on SetF. Every equation which holds in continuous theories holds in the E^-tree theories of Example 2.10(vi). Consequently, it holds in the theories Re± of rational E^-trees, see Example 2.10(vii), since the definition of et is the same

as in Te± . For every free algebra for Rat the same equation must hold again since by Example 4.4(ii) these free algebras are quotients of . Consequently, the equation will hold in all algebras for Rat.

5 Conclusions

Stephen Bloom and Zoltan Esik proved that their concept of iteration theory in [12] sums up all equational properties that the formation of the least solutions et of a recursive equations e possesses in Domain Theory. This, however, assumes that the concept of "equational property" is related to the base category Sgn of signatures.

In our paper we take SetF, the category of sets in context, as our base category. It then turns out that the summation of equational properties of the above function

ei-> et in Domain Theory is given by Elgot theories—our abbreviation for the

concept of iteration theory satisfying the functorial dagger implication from [12]. Elgot theories have a simpler definition than iteration theories, and they precisely correspond to cocartesian traced categories uniform w.r.t. base morphisms, see [18].

References

[1] J. Adamek. Free algebras and automata realizations in the language categories. Comment. Math. Uni.

caroling 15 (1974), 589-602.

[2] J. Adamek, R. Borger, S. Milius and J. Velebil. Iterative algebras: How iterative are they?, Theory Appl.. Categ. 19 (2008), 61-92.

[3] J. Adamek and S. Milius. Terminal coalgebras and free iterative theories, Inform. Comput. 16 (2006), 1139-1172.

[4] J. Adamek, S. Milius and J. Velebil, Iterative algebras at work, Math. Structures Comput. Sci. 16 (2006), 1085-1131.

[5] J. Adamek, S. Milius and J. Velebil, Elgot algebras, Logic. Meth. Comput. Sci. 2 (2006), 1-31.

[6] J. Adamek, S. Milius and J. Velebil, What are iteration theories?, Proc. MFCS 2007, Lect. Notes Comput. Si 4708 (L. KuCera and A. KuCera, Eds.), Springer 2007, 240-252.

[7] J. Adamek, S. Milius and J. Velebil, Equational Properties of Iterative Monads, submitted.

[8] J. Adamek, S. Milius and J. Velebil, Iterative reflections of monads, to appear in Math. Structures Comput. Sci.

[9] J. Adamek, S. Milius and J. Velebil. Semantics of higher-order recursion schemes, submitted.

[10] J. Adamek, and J. Rosicky, Locally Presentable and Accessible Categories, Cambridge University Press, 1994.

[11] E. Badouel, Terms and infinite trees as monads over a signature, Proc. TAPSOFT 1989, Lect. Notes Comput. Sci. 351, Springer 1989, 89-103.

[12] S. L. Bloom and Z. Esik. Iteration Theories: the equational logic of iterative processes, Springer-Verlag, 1993.

[13] C. C. Elgot, Monadic computation and iterative algebraic theories, In Logic Colloquium 1973, Studies in Logic, J. C. Shepherdson, editor, 80 (1975), 174-250.

[14] C. C. Elgot, S. L. Bloom and R. Tindell, On the algebraic structure of rooted trees, J. Comput. System Sci. 16 (1978), 362-399.

[15] M. Fiore, G. Plotkin and D. Tiuri, Abstract syntax and variable binding, Proc. 14th Annual Symposium on Logic Computer Science 1999, 193-202.

[16] P. Gabriel, and F. Ulmer, Lokal prasentierbare Kategorien, Lect. Notes Math. 221, Springer-Verlag, Berlin, 1971.

[17] S. Ginali, Regular trees and the free iterative theory, J. Comput. Syst. Sci. 18 (1979), 228—242.

[18] M. Hasegawa, The uniformity principle on traced monoidal categories, Proc. CTCS 2002, Electron. Notes in Theoret. Comput. Sci. (2003).

[19] G. M. Kelly, and A. J. Power. Adjunctions whose counits are coequalizers, and presentations of finitary enriched monads, J. Pure Appl. Algebra 89 (1993), 163—179.

[20] S. Mac Lane, Categories for the working mathematician, 2nd edition, Springer Verlag, 1998.

[21] L. S. Moss, Recursion and corecursion have the same equational logic, Theoret. Comput. Sci. 294 (2003), 233-267.

[22] A. Simpson, and G. Plotkin, Complete axioms for categorical fixed-point operators, Proc. 15th Symposium on Logic in Computer Science LICS 2000, 30-44.

Appendix: The Kelly-Power Equational Presentations

In this appendix we just recall some concepts and results from [19].

Assumption A.1 Throughout the appendix A denotes a locally finitely presentable category and F(A) its full subcategory representing all finitely presentable objects. The copower of M copies of an object K e A is denoted by M • K.

Definition A.2 A signature £ is a collection of objects of A indexed by F(A); in symbols: £ = (£(p))peF(A). Example A.3

(i) In case A = Set we denote F(Set) by F. This is the category of natural numbers and functions. Definition A.2 is the usual concept of a (finitary, one-sorted) signature. Observe that a £-algebra can be viewed as a set A together with, for every p e N, as assignment

p^ A £(p) —^ A

which to every p-tuple (a0,...,ap-1) assigns the map a i-> aA(a0,...,ap-1).

Or, more compactly, an algebra is a set A together with a morphism

a: Yl Ap x £(p)-> A.

(ii) In the category

A = SetF

of sets in context the finitely presentable objects are, as proved in [9], precisely the super-finitary ones. That is, those sets in context X for which there exists a natural number n such that (a) X(n) and X(0) are finite, and (b) all elements

of X(k), k e N \ {0}, have the form Xf(t) for some f: n-> k and t e X(n).

Then F(SetF) denotes a set of representatives of all super-finitary sets in context.

A signature in SetF is a collection £ = (Ex(Set^) of sets in context.

Definition A.4 By a T-algebra is meant an object A of A together with a mor-phism

a: A(p,A) • T(p)-► A.

peF (A)

This is just an algebra for the endofunctor He : A-> A defined by

HeX = JJ A(p,X) • T(p).

peF (A)

Homomorphisms are the usual homomorphisms of algebras for He.

Remark A.5 The forgetful functor T-Alg-> A has a left adjoint which assigns

to every object X e A the free H^-algebra Fe(X) on X. It is easy to see that He is a finitary functor, in particular, it preserves colimits of w-chains. Consequently, the standard construction of the free algebra, see [1], applies: Fe(X) is the colimit of the chain

X^UX + HeX id+gE inl )X + He(X + He)-► • • •

Observe that we have a canonical natural transformation k : He-i- FE given by

the right-hand components of the colimit injections X + HeX-> Fe(X).

Definition A.6 By an equation for a signature T is meant a parallel pair of mor-phisms

u,u': p-> Fe(t) for p,r e F(A).

A T-algebra A satisfies the equation provided that for every homomorphism h: FE(r)-> A we have hu = hu'.

Notation A.7 Given a set E of equations, we denote by (T,E)-Alg the full subcategory of T-Alg formed by those T-algebras that satisfy every equation in E. And we denote the forgetful functor by

U(e,e) : (T,E)-Alg-> A.

Proposition A.8 (See [19].) The functor U(e,e) is finitary monadic. That is, there exists a finitary monad M on A such that for the forgetful functor Um : AM

-> A of its Eilenberg-Moore category we have an equivalence functor AM

-> (T,E)-Alg together with a natural isomorphism Um = > U(e,

The main result for our purposes is the converse:

Theorem A.9 (See [19].) Every finitary monad M on A has an equational presentation (E,E), that is, a signature E, a set E of equations and an equivalence functor AM-> (E,E)-Alg with Um = U(E>E)•$.

Example A.10 The category of all finitary monads in Set (or, equivalently, the category of Lawvere theories and theory morphisms) is monadic over Set^, the category of sets in context—this is an easy application of Beck's theorem. That is, there exists a signature E and a set E of equations describing finitary monads as E-algebras satisfying the equations from E. Recall that Set^ is equivalent to the category Fin(Set) of finitary set functors. A finitary monad is given by (a) a

functor A E Fin(Set), (b) a natural transformation n: Id-> A and (c) a natural

transformation j: AA-> A satisfying certain axioms. The natural transformation

j can, since A is finitary, be substituted by the collections of assignments

f: m-> A

f': mm-> A

where m is an arbitrary finitely presentable object of Fin(Set), f an arbitrary natural transformation and f = j-(f * f). This leads us to the following signature Emon for a presentation of finitary monads: Emon(m) = mm for all m = 0 (0 the initial object), and Emon(0) = Idset. Here a E-algebra consists of a finitary functor A, a map

0-► A

representing a natural transformation n: Id-> A, and transformation maps

m (m = 0 finitely presentable)

mm-> A

representing f provided that some equational properties hold. The set Emon of equations we need then guarantees that the above transformation maps represent a natural transformation f : AA-> A and, together with n, satisfy the monad axioms.

In other words, (£mon,Emon)-Alg is the category of Lawvere theories (equivalently, finitary monads on Set).

Example A.11 Let us illustrate the equations needed to represent functoriality of iteration theories. We work here with the category A = (£mon,Emon)-Alg of Lawvere theories of the preceding example as the base category. For every pair n, m of natural numbers we denote by Tg:n—¡.m the free Lawvere theory on one generator g representing a morphism from n to m. Notice that every theory morphism u : Tg

-> X is uniquely determined by picking a morphism u(g) e X(n,m). Clearly,

Tg:n—is a finitely presentable object of A.

Let £ be the signature whose values are £(p) = 0 (the initial algebraic theory) except for p = Te: n—^n+k where

E(Te: „—tn+k) = Tei. for all e : n->n + k.

Its polynomial functor assigns to every theory X the theory

H£X = JJ A (Te: n->n+k ,X) • Tet. n->k

,, keN

Y[ X(n,n + k) • Tet:

t: n—Vk"

n, keN

Its algebras are precisely the preiteration theories of Bloom and Esik [12], i.e., Lawvere theories X together with maps

e e X(n, n + k) et e X(n,k)

satisfying no axioms.

For every base morphism (function)

v: n-> m in Set

we now formulate an equation in the above signature T expressing functoriality

w.r.t this morphism v: for all morphisms e : n-> n + k and f : m-> m + k

this equation ensures that

n-e—> n + k

u+id implies

m—f—> m + k

Our equation uv ,u'v : p-> FE(r) works with p free on one generator g : n-> k,

p — Tg:-^ m

and with r given by the quotient

r = Te , f

of the free theory on two generators e : n-> n + k and f : m-> m + k modulo

the smallest congruence « with

f •v & (v + id) •e

Before specifying uv ,u'v we observe that the congruence classes [e] e r(n,n + k) and [f] e r(m,m + k)

yield in

HE(r)= H r(i,i + j) • Tht,

two coproduct injections

¡ne : Tht:n-¥h ^ H£(r) and ¡nj : Ttf:m-^ '

respectively. Hence, in the theory fls(r) we have the two parallel morphisms

ine(ht) v inf (ht)

n->k and n->m->k

(recall that v : n-> m is a base morphism in every theory). Using the canonical

morphism Kr : HE(r)-> FE(r) of A.5 we obtain two elements

Kr(¡He(h)),Kr(¡Hf (h)v) G FS(r)(n, k)

Our equation

Uv ,u'v : p = Tg-► Fs(r)

is given by the above two elements. It is easy to see that a preiteration theory satisfies this equation iff the functoriality holds for the given base morphism v. The collection of all these equations indexed by all the base morphisms v yields the axiomatization of functoriality.