how iterative re ections of monads are constructedhow iterative re ections of monads are constructed...

50
How Iterative Reflections of Monads are Constructed Jiˇ ı Ad´ amek a , Stefan Milius b , Jiˇ ı Velebil c,1 a Institut f¨ ur Theoretische Informatik, Technische Universit¨ at Braunschweig, Germany b Lehrstuhl f¨ ur Theoretische Informatik, Friedrich-Alexander Universit¨ at Erlangen-N¨ urnberg, Germany c Faculty of Electrical Engineering, Czech Technical University in Prague, Czech Republic Abstract Every ideal monad M on the category of sets is known to have a reflection b M in the category of all iterative monads of Elgot. Here we describe the iterative reflection b M as the monad of free iterative Eilenberg-Moore algebras for M. This yields numerous concrete examples: if M is the free-semigroup monad, then b M is obtained by adding a single absorbing element; if M is the monad of finite trees then b M is the monad of rational trees, etc. Keywords: monad, iterative theory, recursive equations, equational laws In mathematics you don’t understand things. You just get used to them. John von Neumann (1903–1957) 1. Introduction The semantics of recursive definitions is a topic at the heart of theoretical computer science. Iterative theories of Calvin Elgot are a well-established for- malism in which recursive equation systems can be solved. So far, iterative theories were considered over arbitrary signatures [1, 2] or arbitrary endofunc- tors [3] but without studying the effect of equational laws on given operations. For example, Elgot et al. described in [2] the free iterative theory on a signature Σ as the theory Σ of all rational Σ-trees (that is, Σ-trees with only finitely many subtrees up to isomorphism). The free iterative theory can be thought of as the closure of the theory formed by all Σ-terms under unique solutions of recursive equations. In our present paper we attend to the influence that equations have on iteration. This topic is relevant, e. g., for process algebra where processes are defined recursively and operations on processes typically satisfy equational laws such as associativity, commutativity or idempotency. Let us consider the simple case of one binary operation: by the above result the free iterative theory is the theory of rational binary trees. What happens if the operation is required to be commutative? The answer is simple: the free iterative theory consists of all Email addresses: [email protected] (Jiˇ ı Ad´ amek), [email protected] (Stefan Milius), [email protected] (Jiˇ ı Velebil) 1 Supported by the grant MSM 6840770014 of the Ministry of Education of the Czech Republic. Preprint submitted to Information and Computation February 26, 2013

Upload: others

Post on 17-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

How Iterative Reflections of Monads are Constructed

Jirı Adameka, Stefan Miliusb, Jirı Velebilc,1

aInstitut fur Theoretische Informatik, Technische Universitat Braunschweig, GermanybLehrstuhl fur Theoretische Informatik, Friedrich-Alexander Universitat Erlangen-Nurnberg,

GermanycFaculty of Electrical Engineering, Czech Technical University in Prague, Czech Republic

Abstract

Every ideal monad M on the category of sets is known to have a reflection Min the category of all iterative monads of Elgot. Here we describe the iterativereflection M as the monad of free iterative Eilenberg-Moore algebras for M. Thisyields numerous concrete examples: if M is the free-semigroup monad, then Mis obtained by adding a single absorbing element; if M is the monad of finitetrees then M is the monad of rational trees, etc.

Keywords: monad, iterative theory, recursive equations, equational laws

In mathematics you don’t understand things.You just get used to them.

John von Neumann (1903–1957)

1. Introduction

The semantics of recursive definitions is a topic at the heart of theoreticalcomputer science. Iterative theories of Calvin Elgot are a well-established for-malism in which recursive equation systems can be solved. So far, iterativetheories were considered over arbitrary signatures [1, 2] or arbitrary endofunc-tors [3] but without studying the effect of equational laws on given operations.For example, Elgot et al. described in [2] the free iterative theory on a signatureΣ as the theory Σ of all rational Σ-trees (that is, Σ-trees with only finitely manysubtrees up to isomorphism). The free iterative theory can be thought of as theclosure of the theory formed by all Σ-terms under unique solutions of recursiveequations. In our present paper we attend to the influence that equations haveon iteration. This topic is relevant, e. g., for process algebra where processes aredefined recursively and operations on processes typically satisfy equational lawssuch as associativity, commutativity or idempotency. Let us consider the simplecase of one binary operation: by the above result the free iterative theory is thetheory of rational binary trees. What happens if the operation is required tobe commutative? The answer is simple: the free iterative theory consists of all

Email addresses: [email protected] (Jirı Adamek), [email protected](Stefan Milius), [email protected] (Jirı Velebil)

1Supported by the grant MSM 6840770014 of the Ministry of Education of the CzechRepublic.

Preprint submitted to Information and Computation February 26, 2013

rational non-ordered binary trees. This has been known before since commuta-tivity can be expressed by working with algebras for an endofunctor H, and inthat case the free iterative theory was described in [4] as follows: one appliesthe given equations to rational Σ-trees possibly infinitely often. Next question:what happens if the given binary operation is required to be associative? Thatis, the theory we start with is the theory of finite lists. It follows from ourresults in the present paper that the free iterative theory is the extension ofthe finite-list theory by just a single absorbing element. (Informally, for everyinfinite binary tree one gets, by applying the associative law infinitely often, thecomplete binary tree viz. the unique solution of x ≈ x · x.) The same answer istrue for a commutative and associative binary operation, in other words, for thefinite-bag theory. Last question: what about an idempotent binary operation?We cannot provide an answer to this question because the corresponding the-ory is not ideal, see below, and one can only form iterative reflections for idealtheories—in fact, the question makes no sense for general theories.

We are going to work with finitary monads M rather than equationaltheories—recall that the underlying functor M of the monad assigns to everyset X the free algebra MX on X for the given equational theory, and that theinclusion of generators forms a natural transformation η : Id −→ M . Elgot [1]called M ideal if M is a coproduct of Id and a subfunctor M ′ such that η is theright-hand coproduct injection, and the monad multiplication µ : MM −→ Mhas a restriction to µ′ : M ′M −→ M ′; in the language of theories that meansthat the presentation of M by operations modulo equations is such that theproperty of a term not being equivalent to a variable is preserved by substitu-tion. Commutativity and associativity of a binary operation are examples ofequational specifications yielding ideal monads, idempotency is not.

We already know that every ideal monad has an iterative reflection; thisstates in category-theoretic terms that unique solutions of guarded recursiveequations can be added freely to the given monad. This was proved in [5] undermuch less restrictive side conditions than those required below. However, aconcrete description of the iterative reflection was missing: we proved that fora given ideal monad M every object X generates a free iterative algebra MX,and thus, we obtain a new monad M. Here we prove that M is iterative andthat it is the desired iterative reflection of M.

Although the statement “the iterative reflection is the monad of free iterativealgebras” may sound almost tautological, we have not found an easy proof. Infact, the proof presented in our paper is not only technically involved, it alsorequires at one point that every strong epimorphism is split—this forces us torestrict our attention essentially to monads in the category of sets. In contrast,the existence of iterative reflections was proved for ideal monads in all extensivelocally finitely presentable categories (see [5]).

Related Work

This paper is an extension of the paper [6] presented at the conferenceFoSSaCS 2009. Most of the proofs there were omitted or just sketched, andwe also present here additional examples of iterative reflections. One examplein [6], 2.8(1), was incorrect and we present a correction (see Example 2.11(3)–(4)below).

2

Acknowledgement

We are grateful to Bruno Courcelle for a discussion of iterative reflectionsand for providing us with Example 2.10(2) below.

2. Ideal and Iterative Monads

In this section we recall the concepts introduced by Calvin Elgot [1] in thelanguage of monads in lieu of algebraic theories used originally. Throughoutthis section M = (M,η, µ) denotes a finitary monad on a category A (that is,M preserves filtered colimits). Recall that given another monad M = (M,η, µ),a monad morphism is a natural transformation h : M −→M such that h ·η = ηand h · µ = µ · (h ∗ h).

Assumption 2.1. Throughout the paper we assume that the base categoryA is locally finitely presentable, extensive, and has split strong epimorphisms.More detailed, we assume that

(1) A has colimits,

(2) for every strong epimorphism e : X −→ Y there exists m : Y −→ X withe · m = id (where “strong” means the diagonal fill-in property w. r.t. allmonomorphisms),

(3) A has a set Afp of finitely presentable objects A (i. e., such that the hom-functor is finitary) whose closure under filtered colimits is all of A, and

(4) finite coproducts are universal and disjoint, see [7].

For example, the categories of sets and many-sorted sets satisfy the aboveassumptions, with Afp formed by all finite sets.

Notation 2.2. The category of algebras for the monad M is denoted by AM.Recall that its objects are algebras a : MA −→ A for the functor M such that

a · ηA = id and a ·Ma = a · µA. (2.1)

The morphisms of AM are the usual M -algebra homomorphisms, i. e., h is ahomomorphism from an algebra a : MA −→ A to b : MB −→ B if h ·a = b ·Mh.

Definition 2.3. (C. Elgot [1]) An ideal monad consists of a finitary monadM = (M,η, µ), a finitary subfunctor m : M ′ ↪−→ M such that M = M ′ + Idwith injections m and η, and a natural transformation µ′ : M ′M −→ M ′ suchthat the square below commutes:

M ′Mµ′//

mM

��

M ′

m

��

MMµ// M

(2.2)

Remark 2.4.

1. Since A is extensive, the equation M = M ′ + Id determines M ′ uniquelyup to natural isomorphism.

3

2. Recall that coproduct injections in extensive categories are monic.

Example 2.5.

1. The monads MX = X × N (of one unary operation), MX = X+ (ofsemigroups), MX = binary trees over X (of one binary operation) areideal.

2. For every finitary endofunctor H the monad M of free H-algebras is ideal,see [3].

3. In contrast, the monads MX = X∗ (of monoids) and MX = PX (ofcomplete join-semilattices) are not ideal.

Definition 2.6.

(1) By a (finitary) equation morphism we mean a morphism

e : X −→M(X +A) ,

where X is a finitely presentable object (of “variables”) and A an object (of“parameters”).

(2) We call e guarded provided that it factorizes through the summand M ′(X+A) +A of M(X +A) = M ′(X +A) +X +A:

Xe //

e0&&

M(X +A)

M ′(X +A) +A

[mX+A,ηX+A·inr]

OO

(2.3)

Remark 2.7. Recall that if A = Set then for every finitary monad M thereexists an equational presentation such that M is the associated free-algebramonad. That is, for every set Z we can consider MZ as the set of all terms ofthe equational presentation with the free variables in Z.

(1) If we put X = {x1, . . . , xn} in Definition 2.6, then the equation morphisme can be regarded as the system of recursive equations

x1 ≈ t1(x1, . . . , xn, a1, . . . , ak)

...

xn ≈ tn(x1, . . . , xn, a1, . . . , ak)

whose right-hand sides ti = e(xi) are M-terms in the variables from X andparameters a1, . . . , ak ∈ A.

(2) The concept of a guarded equation morphism forbids equations such asx1 ≈ x1. Evelyn Nelson [8] introduced iterative algebras for a signature asthose algebras in which guarded systems of equations have unique solutions,see also the related concept by Jerzy Tiuryn [9]. We now formulate thisconcept categorically:

4

Definition 2.8. We say that the algebra a : MA −→ A is iterative providedthat every guarded equation morphism e : X −→ M(X + A) has a uniquesolution, i. e. a unique morphism e† : X −→ A for which the square belowcommutes:

Xe† //

e

��

A

M(X +A)M [e†,A]

// MA

a

OO

(2.4)

Remark 2.9. The following was proved in [5]:

(1) Iterative algebras form a full subcategory of AM. The reason why we con-sider the usual homomorphisms as the “right” morphisms of iterative alge-bras is that homomorphisms automatically preserve solutions.

(2) Every object X generates a free iterative M-algebra which we denote by

MX with the structure and the universal arrow denoted by

ρX : MMX −→ MX and ηX : X −→ MX

respectively. In other words, the forgetful functor of the category of iterativeM-algebras has a left adjoint X 7−→ (MX, ρX).

(3) We obtain a new monad M = (M, η, µ) and a monad morphism λ : M −→ Mwith the components

λX ≡ MXMηX //MMX

ρX //MX (2.5)

(4) We also proved that every ideal monad M has an iterative reflection—and

in the present paper we prove that this is λ : M −→ M.

In [5] we worked with ideal (rather than guarded) equation morphisms. How-ever, all the results remain valid under our present assumption. In particular,our proof of the existence of an iterative reflection (Theorem 2.13 and Re-mark 2.14 of [5]) uses split epimorphisms and does not use extensivity. Theproof is based on the fact (proved in the Appendix) that iterative algebras areclosed under limits—by inspecting the proof one sees immediately that thisis true for iterativity based, as in Definition 2.8 above, on guarded equationmorphisms.

Examples 2.10. Algebras with unary operations.

(1) The monadMX = X × Σ∗

of free unary Σ-algebras yields the monad

MX = X × Σ∗ + Σ∗(Σ∗)ω

obtained by adding to MX all infinite words in Σω that are eventuallyperiodic (and the unary operations are given by concatenation), see [8].

5

(2) In contrast, let K be a nontrivial commutative monoid and consider themonad

MX = X ×Kof free actions of K. Then M is obtained by adding a single element whichis a joint fixed point of the unary operations:

MX = X ×K + 1

Here is a proof, suggested to us by Bruno Courcelle. In the free iterativealgebra MX the equation x ≈ ax, where a ∈ K, has a unique solution.That is, a unique ta ∈ MX with ta = ata. Since K is commutative, btasolves x ≈ ax for every b ∈ K:

bta = b(ata) = (ab)ta = a(bta).

However, ta was the unique solution, thus, we conclude

bta = ta for all a, b ∈ K.

If e denotes the neutral element of K, we thus see that te is a common fixedpoint of all the unary operations. It is easy to verify that the subalgebraMX ∪ {te} of MX is iterative, therefore, it is all of MX.

(3) In the case of just one unary operation

MX = X × N

we get from (1) also the addition of a unique fixed point:

MX = X × N + 1.

This remains true for all varieties. For example, consider one idempotentunary operation (where the free algebra on X is X +X with the operation[inr, inr] on it), that is:

MX = X +X,

thenMX = X +X + 1.

Example 2.11. Algebras with binary operations.

(1) One binary operation without equation yields2

MX = finite binary trees on X.

This is an ideal monad since it is free on the endofunctor HX = X × X.And from [3] we know that

MX = rational binary trees on X.

Recall that a tree is rational iff it has only finitely many subtrees up toisomorphism, see [10].

2Trees are supposed to be rooted, directed, ordered trees with a given labeling of the nodesthroughout the paper. We consider trees always up to (label-preserving) isomorphism.

6

(2) Commutativity leads to a completely analogous example, except thatwhereas in (1) the trees were supposed to be ordered, here we (exception-ally) work with non-ordered trees. The monad M of one commutative binaryoperation, given by finite non-ordered binary trees, is ideal, since this alsois a free monad on an endofunctor: consider HX given by all unorderedpairs in X. And M is given by rational non-ordered binary trees, see [4].

(3) In contrast, associativity “trivializes” the passage from M to M. Considerone binary associative operation, leading to the monad

MX = X+

of finite nonemtpy words. This is an ideal monad with M ′X denoting theset of all words of length at least 2. The free iterative algebra is given byadding a single element t that is absorbing, i. e., w · t = t = t · w for allw ∈ X+:

MX = X+ + 1.

Here is the proof (already presented in [5]): The equation x ≈ xx has a

unique solution in the iterative algebra MX, i. e., that algebra has a uniqueidempotent, t. To prove that for every a ∈ MX we have ta = t, considerthe equation x ≈ xa. It has a unique solution, say, a = aa. However, aa isalso a solution:

(aa)a = a(aa) = aa,

consequently, a = aa is an idempotent. This proves a = t, hence, t = ta.Analogously for at. It is easy to see that the subalgebra X+ + {t} of MX

is iterative, hence, this is all of MX.

(4) The monadMX = X∗

of free monoids does not fit into our framework: it is not ideal. This isbecause the monad multiplication µ : (X∗)∗ −→ X∗ (concatenation ofwords) does not restrict to M ′(X∗) −→ M ′X as required. Indeed, M ′Xcontains all words that are not of length 1, but µ maps (x, ε) ∈M ′(X∗) tox which is not in M ′X for x ∈ X. In [6] we claimed by mistake that X∗ isan ideal monad.

(5) Consider two commutative and associative operations + and · satisfying thedistributive law

x · (y + z) = (x · y) + (x · z).

The corresponding monad is

MX = finite sums of monomials xn11 , xn1

1 xn22 , xn1

1 xn22 xn3

3 , . . .

where xi ∈ X and ni = 1, 2, 3, . . ..

Once again, the free iterative algebras are given by adding a single elementabsorbing w.r.t. both operations:

MX = MX + 1

7

To prove this, use the argument of (3) to prove that + has an absorbingelement t and · has an absorbing element s. Then s · t = t because t isunique solution of x ≈ x+ x and s · t solves this equation:

s · t = s · (t+ t) = (s · t) + (s · t).

And this proves s = t because s is the unique solution of x ≈ s · x. Con-sequently, t is absorbing for both operations. Once again, MX + {t} is an

iterative subalgebra of MX, thus, it is all of MX.

Example 2.12. Here are some variations on the above examples we find worthmentioning.

(1) The monad of bags (= finite multisets) is not ideal because of the emtpybag. But the monad

MX = nonemtpy bags in X

yieldsMX = MX + 1.

This is completely analogous to Example 2.11(3), since M is the monad offree commutative semigroups.

(2) The monad of all finite trees

MX = finite trees on X

yieldsMX = rational trees on X

This is completely analogous to Example 2.11(1), since M is the free monadon HX = X∗.

(3) Generalizing Example 2.11(2), consider an equational class of Σ-algebras inwhich every equation has the form σ(x1, . . . , xn) = τ(y1, . . . , yk) for σ, τ ∈ Σand xi, yi variables (not necessarily distinct). The free-algebra monad isobvious:

MX = finite Σ-trees on X modulo ∼Xwhere t ∼X t′ means that we can obtain the tree t′ by finitely many appli-cations of the given equations starting with t. In [4] it was proved that

MX = rational Σ-trees on X modulo ≈X

where ≈X allows finitely or infinitely many applications of the given equa-tions.

Definition 2.13. [1] An ideal monad M is called iterative if every guardedequation morphism e : X −→M(X +A) has a unique solution, which means amorphism e† : X −→MA such that the square below commutes:

Xe† //

e

��

MA

M(X +A)M [e†,ηA]

// MMA

µA

OO

(2.6)

8

Definition 2.14. Suppose we have two ideal monads M = (M,η, µ,M ′,m, µ′)

and M = (M,η, µ,M′,m, µ′). By an ideal monad morphism we understand a

monad morphism h : (M,η, µ) −→ (M,η, µ) such that there exists a domain-

codomain restriction h′ : M ′ −→M′of h with m·h′ = h·m (which is necessarily

unique, recall that m is a monomorphism).

Remark 2.15. In the category of all finitary monads on A we now consider

(a) the non-full subcategory of all ideal monads and ideal monad morphisms,denoted by

FMid(A),

(b) its full subcategory of all iterative monads, denoted by

IFM(A).

3. A Construction of Free Iterative Algebras

Assumption 3.1. Throughout the rest of the paper M denotes an ideal monadon a category A (satisfying the assumptions of 2.1).

Remark 3.2. In [3] we described for every endofunctor H of a locally finitelypresentable category, the free iterative H-algebra on an object Y as a colimit

MY = colim EqY

of the diagram EqY of all flat equation morphisms

e : X −→ HX + Y (X finitely presentable).

The connecting morphisms of that diagram EqY are simply the coalgebra ho-momorphisms for the endofunctor H(−) + Y . The fact that EqY is a filtereddiagram whose colimit is the free iterative H-algebra on Y turned out to be thebasic step for describing the rational monad of H. The proof of this fact wastechnically rather involved.

In the present section we prove an analogous result for algebras for an idealmonad M: we form the diagram of all guarded equation morphisms

e : X −→M(X + Y ) (X finitely presentable).

In lieu of coalgebra homomorphisms for M(− + Y ) we need more general “so-lution homomorphisms” here. To make sure that EqY is a filtered diagramwe, unfortunately, need the restrictive side condition of the splitting of strongepimorphisms.

Notation 3.3. Given an equation morphism e : X −→ M(X + A) every mor-phism h : A −→ B yields a new equation morphism (by changing parameters)

h • e ≡ Xe //M(X +A)

M(X+h)//M(X +B).

In particular, use the universal arrow

ηY : Y −→ MY

9

of Remark 2.9 to turn every “abstract” equation morphism e : X −→M(X+Y )into a “concrete” equation morphism

ηY • e : X −→M(X + MY )

in the free iterative algebra MY . The latter has, whenever e is guarded, a uniquesolution in MY which, by abuse of notation, we denote by e† : X −→ MY .Thus, for every guarded equation morphism e : X −→ M(X + Y ) we define e†

by the commutative square

Xe† //

e

��

MY

M(X + Y )M [e†,ηY ]

// MMY

ρY

OO

(3.1)

Definition 3.4. Let e : X −→M(X+Y ) and f : Z −→M(Z+Y ) be guardedequation morphisms. By a solution homomorphism is meant a morphism h :X −→ Z in A for which the triangle below commutes:

Xh //

e† !!

Z

f†}}

MY

Notation 3.5. For every object Y we denote by

EQY

the category of all guarded equation morphisms in Y and all solution homomor-phisms.

We also denote by EqY : EQY −→ A the forgetful functor assigning toe : X −→M(X + Y ) the object X.

Example 3.6. Whenever h : X −→ Z is a coalgebra homomorphism, i. e.,whenever the square

Xe //

h

��

M(X + Y )

M(h+Y )

��

Zf// M(Z + Y )

commutes, then h is a solution homomorphism. Indeed, f† ·h = e† follows fromthe uniqueness of solutions since f† ·h solves e. To see this consider the diagrambelow:

Xh //

e

��

Zf†

//

f

��

MY

��

f†·h

M(X + Y )M(h+Y )

// M(Z + Y )M [f†,ηY ]

// MMY

ρY

OO

OO

M [f†·h,ηY ]

10

The right-hand square commutes by (3.1), the left-hand one by assumption,and the upper and lower parts obviously do. So the outside of the diagramcommutes, showing that f† · h is a solution of e as desired.

Remark 3.7. In the coalgebraic construction of the free iterative monad on anendofunctor H in [3] we used the category EQY of all flat equation morphisms.This category is trivially filtered because it is closed under finite colimits in thecategory of all coalgebras, and so the corresponding forgetful functor EqY is afiltered diagram whose colimit yields the object assignment of the desired freeiterative monad.

Our present setting is more subtle: here we cannot work with coalgebra ho-momorphisms (for M(−+Y )) because they are insufficient to relate all equationswith the same solution in the corresponding diagram. To see this we considerthe example of a signature with one binary operation ∗. The associated freemonad on that signature is the finite binary tree monad M. Now let, just inthis example, EQ′Y denote the category of guarded equations and coalgebra ho-momorphisms. Consider the two recursive equations (trees are written as termshere)

x ≈ x ∗ y and x ≈ (x ∗ y) ∗ y

which give rise to two different equation morphisms

e, f : {x } −→M({x }+ { y }).

These two equations specify the same rational binary tree:

∗ y∗

∗ y∗

y

However, the above two equations will lead to two distinct elements in thecolimit of the diagram given by the forgetful functor on EQ′Y —this is due to thefact that any morphism in EQ′Y preserves the height of the binary trees on theright-hand side of recursive equations.

Lemma 3.8. The category EQY is filtered.

Proof. Firstly, given two objects (X, e) and (Z, f) of EQY form their coproductin CoalgM(−+ Y ) to obtain a cospan

(X, e)inl //(X + Z, g) (Z, f)

inroo

of coalgebra homomorphisms whence morphisms of EQY . Secondly, suppose wehave a parallel pair h, k : (X, e) −→ (Z, f) of solution homomorphisms. Taketheir coequalizer c : Z −→ C in A. Since every regular epi is strong we can,by Assumption 2.1(2), choose some splitting s : C −→ Z, c · s = id. Since the

equations f† ·h = e† = f† ·k hold, there exists a unique morpism x : C −→ MY

11

with x · c = f† and thus x = f† · s. The object C is finitely presentable since Xand Z are, and we obtain the equation morphism

g ≡ Cs //Z

f//M(Z + Y )

M(c+Y )//M(C + Y ) .

It is guarded since f is. Finally, from the commutativity of the following diagramwe conclude that g† = x:

X

g

//

x //

s

��

MY

Zf†

66

f

��

M(Z + Y )

M(c+Y )

��

M [f†,ηY ]

((

M(C + Y )M [x,ηY ]

// MMY

ρY

OO

Thus, c : (Z, f) −→ (C, g) is a solution homomorphism with c · h = c · k. �

Theorem 3.9. The free iterative algebra MY is a filtered colimit of the diagramEqY : EQY −→ A of all guarded equation morphisms in Y :

MY = colim EqY .

Remark 3.10. The proof will be performed by a series of auxiliary results. Forthese results we denote by MY a colimit of the filtered diagram EqY in A withcolimit morphisms

e] : X −→ MY

for all e : X −→M(X + Y ) in EQY . We will prove that

(1) there is a morphism ρ : MMY −→ MY turning MY into a free iterative

M-algebra on Y , shortly, MY = MY , and

(2) the cocone e] : X −→ MY is formed by the solution morphisms e† : X −→MY (cf. (3.1)).

Notation 3.11. Let e : X −→ M(X + Y ) be a guarded equation morphismand let p : P −→ MX be a morphism with P finitely presentable. We denoteby Jp, eK the following guarded equation morphism

Jp, eK = (P +X[p,η]

// MX

Me

��

MM(X + Y )

µX+Y

��

M(X + Y )M inr // M(P +X + Y )).

(3.2)

12

In particular, we haveJp, eK · inr = M inr · e. (3.3)

Remark 3.12. It is not difficult to see that Jp, eK is indeed guarded. Sincee is guarded we have by assumption e0 : X −→ M ′(X + Y ) + Y such thate = [mX+Y , ηX+Y · inr] ·e0. Now we establish the commutativity of the diagrambelow (notice that from now on we shall frequently drop the subscripts of naturaltransformations in diagrams):

X[p,η]

// MX

[m,η]−1

��

µ·Me// M(X + Y )

M inr // M(P +X + Y )��

Jp,eK·inr

M ′X +X

[inl·µ′ ·M′ e,e0

]//

[m,η]

OO

M ′(X + Y ) + Y

[m,η·inr]

OO

M′ in

r+Y

// M ′(P +X + Y ) + Y

[m,η·inr]

OO

Indeed, the right-hand square commutes by naturality of m and η. For the left-hand square consider the components of M ′X +X separately. The right-handcomponent commutes due to e = [mX+Y , ηX+Y · inr] · e0. For the left-hand oneuse the naturality of m and Diagram (2.2).

Remark 3.13. We see that inr : X −→ P +X is a coalgebra homomorphism:

Xη//

inr

��

MXµ·Me

// M(X + Y )��

e

M(inr+Y )

��

P +XJp,eK

// M(P +X + Y )

(3.4)

Then inr is, by Example 3.6, a solution homomorphism; thus, the equation

e† = Jp, eK† · inr (3.5)

holds. Consequently we have e] = Jp, eK] · inr .

Proposition 3.14. MY is an algebra for the monad M whose algebra structureρY : MMY −→ MY is the unique morphism such that the square

Pinl //

p0

��

P +X

Jp0,eK]

��

MX

Me]��

MMYρY

// MY

(3.6)

commutes for all e : X −→M(X + Y ) in EQY and all p0 in Afp/MX.

13

Proof. (1) Definition of ρY . Recall that since A is locally finitely presentable,

the object MMY is a colimit of the canonical diagram

Afp/MMY −→ A

of all morphisms p : P −→ MMY with P finitely presentable. Thus, we candefine a morphism ρY : MMY −→ MY by specifying its composites ρY ·p withevery p ∈ Afp/MMY . Since M is finitary and P is finitely presentable, forevery p there exists e : X −→M(X + Y ) in EQY and a factorization

Pp//

p0""

MMY

MX

Me]

OO

(3.7)

(1a) Let us first prove that in (3.6) the composite

Pinl //P +X

Jp0,eK]//MY (3.8)

is independent of the choice of factorization (3.7). Indeed, suppose we choseanother factorization q0 : P −→ MZ for some f : Z −→ M(Z + Y ) in EQY ,

i. e., suppose p = Mf ] · q0. Then we prove Jp0, eK]

= Jq0, fK]. Since the diagramMEqY is filtered, we can assume without loss of generality that a solutionhomomorphism h exists from e to f in EQY such that the diagram

Pp0

""

q0

��

p

//

MXMh //

Me] $$

MZ

Mf]

��

MMY

(3.9)

commutes. We are going to show that P + h : P + X −→ P + Z is a solutionhomomorphism from Jp0, eK to Jq0, fK, i. e., we prove

Jp0, eK†

= Jq0, fK† · (P + h). (3.10)

To this end we first consider the diagram

P + ZJq0,fK†

//

[q0,η]

��

Jq0,fK

//

MY

MZ

µ·Mf

��Mf†

##

(∗)

M(Z + Y )

M inr

��

M [f†,η]

))

M(P + Z + Y )M [Jq0,fK†,η]

// MMY

ρ

OO

(3.11)

14

The outside commutes (see (3.1)), and the left-hand part does by (3.2). Thelowest triangle commutes by (3.5). We do not claim that the middle trianglecommutes. However, it does when extended by ρY . Indeed, notice that allmorphisms in the extended triangle are algebra homomorphisms. Since MZ isthe free M-algebra on Z, it suffices to check that the two morphisms in questionagree when precomposed with ηZ : Z −→MZ, that is we verify:

ρY ·Mf† · ηZ = ρY ·M [f†, ηY ] · µZ+Y ·Mf · ηZ .

Indeed, the left-hand side is f†, and the right-hand side is ρY ·M [f†, ηY ] ·f (dueto the naturality of η and the unit law ρY · ηMY

= id and one unit law for the

monad M). So we obtain an equation which says that f† solves f , which holds.From all this we conclude that the upper part labelled (∗) commutes, too. Wethus proved

Jq0, fK† = ρY ·Mf† · [q0, ηZ ] : P + Z −→ MY . (3.12)

We are prepared to prove Equation (3.10) by showing that its right-hand sideis a solution of Jp0, eK. That is, we now prove that the outside of the diagrambelow commutes:

P +X

(a)

(b)

P+h//

[p0,η]

��

Jp0,eK

//

P + ZJq0,fK†

//

[q0,η]

��

MY

MX

(c)

(d)

Mh//

µ·Me

��

Me†

%%

MZ (h)

Mf†

��

M(X + Y ) M [e†,η]

&&

M(h+Y )**

M inr

��

M(Z + Y )

(e)

M [f†,η]**

M inr

��

M(P +X + Y )

(f)

M(P+h+Y )// M(P + Z + Y )

(g)

M [Jq0,fK†,η]

// MMY

ρ

OO

Indeed, part (a) is the definition of Jp0, eK, (b) commutes due to Diagram (3.9),(c) and (e) commute since h is a morphism of EQY , for (d) use the extensionby ρY precisely as in the argument concerning Diagram (3.11) above. Thecommutativity of (f) is obvious, for (g) use Equation (3.5). Finally, part (h) isEquation (3.12).

(1b) The squares (3.6) define a unique morphism ρY : MMY −→ MY . Indeed,

MMY is a canonical colimit of the diagram of all

p : P −→MMY, P finitely presentable,

and, by (1a), for each p the morphism Jp0, eK] · inl : P −→ MY is independent of

the choice of factorization (3.7). So all we have to verify is that these morphisms

form a cocone of the canonical diagram of MMY . In other words, we need to

15

prove that given a morphism h of that canonical diagram:

Qh //

q ""

P

p||

MMY

(P,Q ∈ Afp)

then the triangle

Qh //

Jq0,fK]·inl

P

Jp0,eK]·inl~~

MY

(3.13)

also commutes; here p = Me] · p0 and q = Mf ] · q0 are arbitrary factorizationsas in Diagram (3.7). But by (1a) we can assume that f = e and q0 = p0 · h.Then we observe that h+X : Q+X −→ P +X is a coalgebra homomorphismfrom Jq0, eK to Jp0, eK:

Q+X

h+X

��

[q0,ηX ]// MX

µ·Me// M(X + Y )

M inr // M(Q+X + Y )

M(h+X+Y )

��

��

Jq0,eK

P +X[p0,ηX ]

// MXµ·Me

// M(X + Y )M inr

// M(P +X + Y )OO

Jp0,eK

Thus h + X is a solution homomorphism, see Example 3.6. This estab-lishes (3.13):

Jp0, eK] · inl · h = Jp0, eK

] · (h+X) · inl = Jq0, eK] · inl = Jq0, fK] · inl.

(2) (MY, ρY ) is an algebra for the monad M. We now verify the two laws of anEilenberg-Moore algebra:

(2a) ρY satisfies the unit law ρY · ηMY= id. For every e of EQY we have by

naturality of η a commutative square

X

e]��

ηX // MX

Me]��

MYηMY

// MMY

which means that for p = ηMY· e] we can choose in (3.7) the factorization

p0 = ηX . We will now prove that the diagram below commutes:

X

e]��

inl // X +X∇ //

JηX ,eK]��

X

e]

oo

��

id

MYηMY

// MMYρY

// MY

(3.14)

16

Indeed, the left-hand part commutes by definition of ρY . The right-hand trianglecommutes since the codiagonal∇ is a coalgebra homomorphism (thus, a solutionhomomorphism):

X +X

∇��

[ηX ,ηX ]//

[e,e]

77MX

µ·Me// M(X + Y )

M inl // M(X +X + Y )

M(∇+Y )

��

Xe

// M(X + Y )

Since the colimit injections e] form a jointly epimorphic family, we obtain fromthe commutativity of the outside of Diagram (3.14) the desired result.

(2b) ρY satisfies the associativity law

MMMY

MρY��

µMY // MMY

ρY��

MMYρY

// MY

(3.15)

To prove this, use the fact that MMMY is a colimit of the canonical diagramAfp/MMMY −→ A. Thus, it suffices to show that Diagram (3.15) commutes

when precomposed by any morphism p : P −→ MMMY , where P is finitelypresentable:

ρY · µMY· p = ρY ·MρY · p . (3.16)

Firstly, observe that MY = colim EqY implies MMMY = colimMMEqY be-cause EqY is a filtered diagram, and MM is a finitary functor. Thus, we havea factorization

Pp//

p0$$

MMMY

MMX

MMe]

OO

(3.17)

for some e : X −→ M(X + Y ) in EQY . Analogously, since MX is a filteredcolimit of Afp/MX and M is finitary, we have a factorization

Pp0 //

p1##

MMX

MQ

Mq0

OO

(3.18)

for some q0 : Q −→MX with Q finitely presentable.Using Notation 3.11, we form the following three equation morphisms (where

inl : Q −→ Q+X is the coproduct injection):

q = Jq0, eK : Q+X −→M(Q+X + Y ),

q = JµX · p0, eK : P +X −→M(P +X + Y ), and

q = JM inl · p1, qK : P +Q+X −→M(P +Q+X + Y ).

17

The left-hand side of Equation (3.16) is the passage from P to MY in thediagram

Pinl //

p0

��

p

//

P +X

q]

��

MMXµX //

MMe]��

MX

Me]��

MMMYµMY

// MMYρY

// MY

(3.19)

This diagram commutes: the leftmost part is Diagram (3.17), the lower squarecommutes by naturality of µ, and the right-hand part does by the definition ofρY (see (3.6)). Observe further that (3.6) for e = q and p0 = M inl · p1 yields,by definition of q:

q] · inl = ρY ·Mq] · (M inl · p1). (3.20)

The right-hand side of Equation (3.16) is the corresponding passage in thediagram

Pinl //

p1

��

p

//

P +Q+X

q]

��

MQM inl //

Mq0

��

M(Q+X)

Mq]

��

MMX

MMe]��

MMMYMρY

// MMYρY

// MY

(3.21)

This diagram also commutes: For the leftmost part paste together Dia-grams (3.17) and (3.18), and the right-hand part is (3.20). For the middlesquare remove M and consider Diagram (3.6) for q = Jq0, eK.

To complete the proof of Equation (3.16) it is thus sufficient to com-pare (3.19) and (3.21) and verify that the equation

q] · inl = q] · inl (3.22)

holds. We do this by showing that [inl, inr] : P +X −→ P +Q+X is a coalgebrahomomorphism, whence a solution homomorphism from q to q. That is, wehave to verify that the square

P +Xq

//

[inl,inr]

��

M(P +X + Y )

M([inl,inr]+Y )

��

P +Q+Xq// M(P +Q+X + Y )

(3.23)

18

commutes, and we do this for the coproduct components separately. The left-hand components commute due to the following commutative diagram:

Pp 0

// MMX

µ

//MMe

##

MX

Me

// MM

(X+Y

)

µ

// M(X

+Y

)M

inr

//M

inr

��

M(P

+X

+Y

)M

([inl,inr]+Y

)

��

��

q·inl

MMM

(X+Y

)µM

88

Mµ// MM

(X+Y

99

MM

inr

��

P

p 1// MQ

Minl//

Mq 0

OO

(∗)

M(Q

+X

)

Mq// MM

(Q+X

+Y

)

µ// M

(Q+X

+Y

)

Minr// M

(P+Q

+X

+Y

)

OO

q·inl

The upper and lower parts commute due to the definitions of q and q, respec-tively. The leftmost square is Diagram (3.18). For the part labelled with (∗)remove M and observe that the resulting diagram commutes due to q = Jq0, eK,see Diagram (3.2). All other parts commute due to naturality and the monadlaws for M.

For the right-hand component of Diagram (3.23), observe that inr : Q +X −→ P +Q+X is a coalgebra homomorphism from q to q (cf. Diagram (3.4)).Similarly, inr : X −→ Q+X is a coalgebra homomorphism from e to q. Compose

19

the two resulting squares to obtain

Xe //

inr

��

inr

//

M(X + Y )

M(inr+Y )

��

Q+X

inr

��

q// M(Q+X + Y )

M(inr+Y )

��

P +Q+Xq// M(P +Q+X + Y )

and note that, due to (3.3), the upper and right-hand edges compose to theupper and right-hand edges of (3.23) precomposed with inr. So this provesthat (3.23) commutes from which (3.22) immediately follows. This completes

the proof of Equation (3.16), and so (MY, ρY ) is an algebra for M. �

Notation 3.15. The morphisms e† : X −→ MY form a cocone of the diagramEqY , thus, there exists a unique morphism

i : MY −→ MY

for which the triangles

X

e]��

e†

""

MYi// MY

(e ∈ EQY ) (3.24)

commute. We are going to prove that i is an isomorphism.

Notation 3.16. Let Y be a finitely presentable object. For the “trivial”guarded equation morphism

Yinr //Y + Y

η//M(Y + Y ) (3.25)

we denote byηY = (ηY+Y · inr)] : Y −→ MY (3.26)

the corresponding colimit injection.

Recall from Remark 2.9 that ρY and ηY are the structure and universalmorphism, respectively, of the free iterative M-algebra MY .

Lemma 3.17. For every finitely presentable object Y , the morphism

i : (MY, ρY ) −→ (MY, ρY )

is a homomorphism of M-algebras with ηY = i · ηY .

Proof. Consider the guarded equation morphism ηY+Y · inr from (3.25). We arenow going to prove that

ηY = (ηY+Y · inr)† : Y −→ MY . (3.27)

20

Indeed, the following diagram commutes:

Y

inr

��

η// MY

Y + Y[η,η]

//

η

��

MY

η##

M(Y + Y )M [η,η]

// MMY

ρ

OO

Thus, we obtain the equation

i · ηY = i · (ηY+Y · inr)] = (ηY+Y · inr)† = ηY (3.28)

by the definition of ηY and i, see Notations 3.15 and 3.16.To verify that i is a homomorphism we use the fact that MMY is a colimit

of the canonical diagram Afp/MMY . Thus in order to verify

i · ρY = ρY ·Mi : MMY −→ MY

we only need to prove that the equation holds when precomposed with a mor-phism p : P −→ MMY with P finitely presentable. Consider for an arbitraryfactorization (3.7) the diagram

Pinl //

p��

p0

��

P +X

Jp0,eK]��

Jp0,eK†

oo

MXMe] //

Me†

//

MMYρY //

Mi��

MY

i��

MMYρY// MY

The upper left-hand part commutes (see Diagram (3.7)). The upper middlesquare commutes due to the definition of ρY (see Diagram (3.6)), and the right-hand part and the lower left-hand one commute due to (3.24). Now the outsideof the diagram commutes, too; indeed, repeat the argument for part (∗) ofDiagram (3.11) with f = e and q0 = p0. Thus, we conclude that the desiredmiddle lower square commutes. �

Lemma 3.18. Let Y be a finitely presentable object and let e : X −→M(X+Y )be a guarded equation morphism. Then the square

Xe] //

e

��

MY

M(X + Y )M [e],ηY ]

// MMY

ρY

OO

(3.29)

commutes. Moreover, e] is the unique morphism from X to MY with thatproperty.

21

Proof. (1) Form the coproduct of the equation morphisms e and ηY+Y · inr(cf. (3.25)) in EQY . We first show that this coproduct is the equation morphism

f = (X + Y[e,η·inr]

//M(X + Y )M [inl,inr]

//M(X + Y + Y )).

Clearly, we have f · inl = M(inl + Y ) · e and, for the right-hand component usenaturality of η to obtain the commutative diagram below:

Yinr //

inr

��

Y + Yη

//

inr

��

M(Y + Y )

M(inr+Y )

��

X + Y[inl,inr]

//

η

��

X + Y + Y

η((

M(X + Y )M [inl,inr]

// M(X + Y + Y )

Now let us prove that the triangle

X

e] !!

inl // X +X + Y

Je,fK]yy

MY

(3.30)

commutes. This follows from the equality e† = Je, fK† · inl, which we prove byverifying that

[e†, e†, ηY ] = Je, fK† : X +X + Y −→ MY . (3.31)

By Equation (3.5), we have f† = Je, fK† · inr : X + Y −→ MY . Moreover,

we know that f† = [e†, ηY ] : X + Y −→ MY since inl and inr are solutionhomomorphisms from e and ηY+Y · inr to their coproduct f , respectively (seeEquation (3.27)). Consequently,

[e†, ηY ] = f† = Je, fK† · inr . (3.32)

To establish (3.31) we will prove that [e†, e†, ηY ] is a solution of the guardedequation morphism Je, fK, i. e. we will verify that the square below commutes:

X +X + Y[e†,e†,η]

//

Je,fK

��

MY

M(X +X + Y + Y )M [e†,e†,η,η]

// MMY

ρ

OO

For the right-hand component X + Y this follows from (3.32) and the fact thatinr : X + Y −→ X + X + Y is a coalgebra homomorphism from f to Je, fK(cf. Diagram (3.4)). For the left-hand component X we consider the diagram

22

Xe† //

e

��

Je,fK·inl

//

MY

M(X + Y )

µ·M [e,η·inr]��

M [e†,η]

$$

M(X + Y )

M(inr+inr)

��

M [e†,η]

))

M(X +X + Y + Y )M [e†,e†,η,η]

// MMY

ρ

OO

(3.33)

The left-hand part commutes by definition of f and Diagram (3.2), using thenaturality of µ. All other parts clearly commute, except, perhaps, the middletriangle. We do not claim that the middle triangle commutes, but it does whenextended by ρY . Indeed, this follows from the commutative diagram

M(X + Y )M [e†,η]

//

M [e,η·inr]

��

MMYρ

// MY

MM(X + Y )MM [e†,η]

//

µ

��

MMMY

OO

µM

##

M(X + Y )M [e†,η]

// MMY

ρ

OO

For the lower part use naturality of µ, the right-hand part is associativity of thealgebra (MY, ρY ), and for the upper part remove M and consider the two co-product components separately: the left-hand one expresses that e† is a solutionof e, and for the right-hand one use the naturality of η and the unit law for ρY .This proves that the outside of Diagram (3.33) commutes, and we obtain (3.30)as desired.(2) The square (3.29) commutes. Indeed, the outside of the diagram

Xinl //

e

�� e]

��

X +X + Y

Je,fK]

��

M(X + Y )

Mf]=M [e],ηY ]��

MMYρY

// MY

23

commutes by the definition of ρY (cf. Diagram 3.6), the upper right-hand tri-angle commutes by (3.30), and from f† = [e†, ηY ] in (3.32) we get

f ] = [e], ηY ]

using (3.27), (3.26) and the fact that inl and inr are solution homomorphismsfrom e and ηY+Y · inr to their coproduct f , respectively. Thus, the lower left-hand triangle commutes and yields (3.29).

(3) Unicity of e]: Suppose that h : X −→ MY is another morphism withh = ρY ·M [h, ηY ] · e. Since X is finitely presentable we can choose an f : Z −→M(Z + Y ) in EQY and a morphism h′ : X −→ Z such that the triangle

X

h′��

h // MY

Zf]

==

commutes. We show that h′ is a solution homomorphism, i. e., that the equation

e† = f† · h′ (3.34)

holds. It then follows that e] = f ] · h′ = h proving the desired uniqueness.In order to establish (3.34) observe the commutativity of the diagram

Xh //

e

��

MYi // MY

M(X + Y )M [h,ηY ]

// MMYMi

//

ρY

OO

MMY

ρY

OO

OO

M [i·h,ηY ]

Indeed, the lower and right-hand parts follow from Lemma 3.17, and the left-hand part commutes by assumption. This implies the commutativity of theoutside of the diagram, which shows that i · h is the unique solution of e. Thus,we get

e† = i · h = i · f ] · h′ = f† · h′ ,

where the last equation follows from Diagram (3.24). �

Proposition 3.19. For every finitely presentable object Y the algebra (MY, ρY )is iterative.

Proof. Suppose we are given a guarded equation morphism

Xe //

e0''

M(X + MY )

M ′(X + MY ) + MY

[m,η·inr]

OO

Since M ′ is finitary, the object M ′(X+MY )+MY is a colimit of M ′(X+EqY )+EqY . Thus, as X is finitely presentable, we can choose some equation morphism

24

f : V −→ M(V + Y ) in EQY and a factorization w′ : X −→ M ′(V + Y ) + Vsuch that the triangle

Xe0 //

w′''

M ′(X + MY ) + MY

M ′(V + Y ) + V

M ′(X+f])+f]

OO

(3.35)

commutes. For w = [mX+V , ηX+V ] · w′ we get a commutative diagram

Xe //

e0

''

w′

&&

w//

M(X + MY )

M ′(X + MY ) + MY

[m,η·inr]

55

M ′(X + V ) + V

M(X+f])+f]

OO

[m,η·inr] ))

M(X + V )

M(X+f])

OO

(3.36)

Define the equation morphism

e = (X + V[w,η·inr]

//M(X + V )

M(ηX+f)

��

M(MX +M(V + Y ))

Mcan

��MM(X + V + Y )

µ//M(X + V + Y )),

(3.37)

where can : MX + M(V + Y ) −→ M(X + V + Y ) is the canonical morphism[M inr,M inl]. To see that e is guarded use Diagram (3.35), the naturality of mand η and that f is guarded. We will show that the unique solution of e is themorphism

e† = (Xinl //X + V

e] //MY ). (3.38)

(1) e† is a solution. Before proving this, observe that inr : V −→ X + V is acoalgebra homomorphism from f to e:

Vf

//

inr

��

inr

$$

M(V+Y )

M(inr+Y )

��

inr

ssM inr

wwX+V

η+f//

η

��

MX+M(V+Y )

η

��

can // M(X+V+Y )

ηM

��X+V

[w,η·inr]// M(X+V )

M(η+f)// M(MX+M(V+Y ))

Mcan // MM(X+V+Y )µ// M(X+V+Y )

OO

e

(3.39)

25

Thus, inr is a solution homomorphism, see Example 3.6, and we obtain

f ] = e] · inr . (3.40)

It is our task to prove that the outside of the following diagram

Xe† //

inl

,,

w

((

e

��

(3.36)

MY

M(X+V )

M(X+f])

��

M(ηX+f)

��

X+V

e]

88

e

��

(3.38)

(3.37)(3.29)M(MX+M(V+Y ))

Mcan

��MM(X+V+Y )

µ//

MM[e],ηY ] ((

(∗)

M(X+V+Y )

M[e],η]

��

(N)

MMMY

µ

&&Mρ&&

M(X+MY )M[e†,MY ]

// MMY

ρ

OO

(3.41)

commutes. The part labelled by (N) commutes by naturality of µ. Notice thatthe two parallel morphisms on the lower right-hand corner are merged by ρY ,see (3.15). Except for (∗) all other parts commute as indicated, so let us provethat the part (∗) commutes. To this end remove M and consider the coproductcomponents separately.

For the right-hand component we get the diagram

Vf]

//

f

��

MY

M(V + Y )

M inr

��

M [f],ηY ]

''

M(X + V + Y )M [e],ηY ]

// MMY

ρY

OO

(3.42)

Its upper part commutes by Lemma 3.18, and its lower triangle does by (3.40).For the left-hand component of part (∗) consider the commutative diagram

Xe† //

e†&&

ηX

��

MY

MX

M inl

�� Me†**

MY

ηMY

##

M(X + V + Y )M [e],ηY ]

// MMY

ρY

OO

(3.43)

26

For its lower part recall (3.38), and the other inner parts are obvious.

(2) Uniqueness of solutions. Given any solution s : X −→ MY of e we provethat the square

X + V[s,f]]

//

e

��

MY

M(X + V + Y )M [s,f],ηY ]

// MMY

ρY

OO

(3.44)

commutes. By Lemma 3.18, it follows that e] = [s, f ]], hence

e† = e] · inl = [s, f ]] · inl = s

as desired. Consider the coproduct components of Diagram (3.44) separately.For the right-hand component see Diagrams (3.29) and (3.39):

Vinr //

f

��

X + V[s,f]]

//

e

��

MY

��

f]

M(V + Y )M(inr+Y )

// M(X + V + Y )M [s,f],ηY ]

// MMY

ρY

OO

OO

M [f],ηY ]

For the left-hand component we obtain the diagram

Xs //

e

((

w

��

e·inl

//

MY

M(X+V )M(X+f])

//

M(ηX+f)

��

M(X+MY )M[s,MY ]

// MMY

ρY

::

M(MX+M(V+Y ))

Mcan

��MM(X+V+Y )

MM[s,f],ηY ]

//

µ

��

MMMY

MρY

OO

µM

$$

M(X+V+Y )M[s,f],ηY ]

// MMY

ρY

OO

The upper left-hand triangle commutes due to Diagram (3.36), and the right-hand part does since ρY is an M-algebra structure. The lowest part commutesby the naturality of µ, and for the left-hand one see (3.37). For the middle squareremove M and consider the components separately. The right-hand componentcommutes due to Diagram (3.42) with [s, f ]] in lieu of e], and the left-handcomponent yields s on both paths similarly as in Diagram (3.43). �

27

Proof of Theorem 3.9. It is sufficient to prove that morphism i : MY −→ MYof Notation 3.15 is an isomorphism.

(a) Let Y be finitely presentable. Since MY is an iterative algebra by Propos-

tion 3.19, there exists an algebra homomorphism j : MY −→ MY such thatηY = j · ηY . From the freeness of MY and Lemma 3.17 it follows immediatelythat i · j = id. To see that j · i = id consider the diagram

X

e]��

e†

""

e]

))MY

i// MY

j// MY

whose left-hand triangle is Diagram (3.24). Thus, it suffices to prove that theright-hand triangle commutes. To this end use the following commutative dia-gram

Xe† //

e

��

MYj

// MY

M(X + Y )M [e†,ηY ]

// MMYMj

//

ρY

OO

MMY

ρY

OO

OO

M [j·e†,ηY ]

Indeed, the left-hand square commutes since e† is a solution of e, and the right-hand one does since j is an algebra homomorphism. By Lemma 3.18 we getj · e† = e].

(b) For arbitrary objects Y we extend the result by using filtered colimits.

For that we first observe that the functor M is finitary because it is the compo-site of the free-iterative-algebra functor (a left adjoint) and the forgetful functorof the category of iterative algebras; the latter is finitary by Theorem 2.13 in [5].Express Y = colim

t∈TYt as a filtered colimit of finitely presentable objects. It is

easy to see that colim EqY is a filtered colimit of colimt∈T

EqYt . Thus,

MY ' colimt∈T

MYt (since M is finitary)

' colimt∈T

colim EqYt (by part (a))

' colim colimt∈T

EqYt (colimits commute with colimits)

' colim EqY .

4. Rational Equation Morphisms

In this section we prove that iterative algebras have a stronger property ofsolving equations than stated in their definition. As an example consider themonad M of finite binary trees, for which an algebra is a set A with a binaryoperation. The algebra A is iterative iff every guarded system of equations

xi ≈ ti(x1, . . . , xn, a1, . . . , ak) i = 1, . . . , n,

28

where each ti is a finite binary tree on {xi | i = 1, . . . n }+ { aj | j = 1, . . . , k }has a unique solution. However, in lieu of finite trees we can as well take rationalinfinite trees on the right-hand sides. That is, in lieu of equation morphisms ofthe form e : X −→M(X+A) we are allowed to consider all e : X −→ M(X+A),

where M is the monad of free iterative M-algebras (as constructed in Section 3).We generalize this in the following way:

Definition 4.1. By a rational equation morphism is meant a morphism X −→M(X +A) with X finitely presentable.

Example 4.2. Consider the monad M of finite binary trees. As mentionedin Example 2.11, here M is the monad of rational binary trees. Consider therational equation morphism e with variables X = {x, y} and parameters A = Ngiven as follows:

x ≈

∗ y∗

∗ x∗

∗ y∗

x

y ≈

1 ∗∗

x 2

We will use this as a running example in this section.

The concept of a solution in an iterative M-algebra is based on the following

Notation 4.3. For an iterative M-algebra (A, a) we denote by a : MA −→ Athe unique homomorphism extending the identity:

MMA

Ma

��

ρA // MA

a

��

AηAoo

MAa

// A

(4.1)

Using the universal property of free iterative algebras it is easy to prove that(A, a) is an algebra for the monad M.

Definition 4.4. By a solution of a rational equation morphism e : X −→M(X + A) in an iterative M-algebra (A, a) is meant a morphism e‡ such thatthe square below commutes:

X

e

��

e‡ // A

M(X +A)M [e‡,A]

// MA

a

OO

29

Example 4.5. The rational equation morphism e of Example 4.2 has a uniquesolution. This can be seen directly by considering the individual levels of thetrees e‡(x) and e‡(y). Or indirectly as follows: the right-hand side of x is arational tree that we can obtain by solving the finitary flat equations

p ≈∗

q y

q ≈∗

p x

Thus, instead of the given rational system e we can work with the finitary system

x ≈∗

q y

y ≈

1 ∗∗

x 2

p ≈∗

q y

q ≈∗

p x

This is the main idea of the proof of Theorem 4.13.

Remark 4.6. In order to state the theorem about unique solutions of rationalequation morphisms e, we need to introduce the concept of e being guarded.This would be easy if we knew that the monad M is ideal. Although this isactually true, and we prove this below (see Theorem 5.9), we are in no position

for proving this now. In lieu of the desired equality M = M ′ + Id, we will nowsimply introduce a (seemingly arbitrary) subfunctor

m : M ′ −→ M

of M and relate our concept of guarded equation morphism to M ′—for dis-tinction from the “real thing” we call this notion “weakly guarded” equationmorphism. At the end of our paper we will indeed verify M = M ′+Id and thus“guarded” is the same concept as “weakly guarded”.

Notation 4.7.

(1) We denote by ρ : MM −→ M the natural transformation whose components

are the algebra maps ρY : MMY −→ MY of the free iterative M-algebrasMY , see Remark 2.9.

(2) Recall from Remark 2.9 that the monad M of free iterative M-algebras has

the unit η given by universal morphisms ηY : Y −→ MY . The multi-plication µ given by extending id

MYto the unique M-homomorphism ρY

(cf. Notation 4.3):

MMMYρMY //

MµY��

MMY

µY��

MYηMYoo

MMYρY

// MY

(4.2)

30

Remark 4.8. Recall from [11] that in every locally finitely presentable cate-gory every morphism can be factorized as a strong epimorphism followed by amonomorphism.

Definition 4.9. We define the subfunctor M ′ of M to be the image of thenatural transformation ρ ·mM : M ′M −→ M . More precisely, for every objectY we have a strong epimorphism γY and a monomorphism mY such that thediagram

M ′MYmMY //

γY %% %%

MMYρY // MY

M ′Y

;; mY

;;

(4.3)

commutes. Obviously, γ : M ′M −→ M ′ and m : M ′ −→ M are naturaltransformations with m · γ = ρ ·mM .

Definition 4.10. A rational equation morphism e : X −→ M(X +A) is called

weakly guarded if it factorizes through [mX+A, ηX+A · inr] : M ′(X +A) +A −→M(X +A) as shown below:

Xe //

e′%%

M(X +A)

M ′(X +A) +A

[m,η·inr]

OO

(4.4)

Remark 4.11. Recall from Notation 3.3 our convention that for every mor-phism e : X −→ M(X + Y ) in EQY we denote by e† : X −→ MY the unique

solution in the free iterative M-algebra (MY, ρY ). Recall also the notation h • e.

Lemma 4.12. Let (A, a) be an iterative M-algebra, and let h : Y −→ A be amorphism. Then for every guarded equation morphism e : X −→M(X + Y ) ofEQY the triangle below commutes:

Xe† //

(h • e)†!!

MY

a·Mh��

A

Proof. Observe first that a · Mh is the unique homomorphism with

a · Mh · ηY = h . (4.5)

This implies that a · Mh · e† is a solution of h • e since the following diagram

31

commutes:

Xe† //

e

��

h • e

//

MYa·Mh // A

M(X + Y )M [e†,ηY ]

//

M(X+h)

��

MMY

ρY

OO

M(a·Mh)

%%

M(X +A)M [a·Mh·e†,A]

// MA

a

OO

Indeed, the upper left-hand square expresses that e† solves e, the right-handpart commutes since a · Mh is a homomorphism, and the lower part is due toEquation (4.5). The desired result now follows from the uniqueness of solutions.�

Theorem 4.13. Let (A, a) be an iterative M-algebra. Every weakly guarded

rational equation morphism e : X −→ M(X +A) has a unique solution.

Proof. Suppose we are given a weakly guarded rational equation morphism e asin (4.4). Since γX+A : M ′M(X + A) −→ M ′(X + A) is a strong epimorphism,

we have, by Assumption 2.1, a morphism s : M ′(X+A) −→M ′M(X+A) with

γX+A · s = id. (4.6)

We define

e0 = (Xe′ //M ′(X +A) +A

s+A//M ′M(X +A) +A). (4.7)

For example, consider the equation morphism e of Example 4.2. Since γX+N isthe obvious concatenation of trees, we can choose s to be the inclusion map:every nontrivial rational tree t on X+N is also a nontrivial finite tree on M(X+N) by considering the two maximum subtrees t1 and t2 of t (the concatenationof which is t). Thus, in this example, e0 takes the same values as e, but now

considered as elements of M ′M(X + N).In general, for e0 we obtain the commutative diagram

Xe //

e′ %%

e0

//

M(X +A)

M ′(X +A) +A

s+A ))

[m,η·inr]

55

M ′M(X +A) +A

[ρ·mM,η·inr]

OO

(4.8)

The upper triangle commutes by (4.4), the left-hand part does by (4.7), and theright-hand part does due to Equations (4.3) and (4.6):

(ρ ·mM)X+A · s = (m · γ)X+A · s = mX+A .

32

Now apply Theorem 3.9 and use the fact thatM ′ is finitary to see thatM ′M(X+A) + A = colim(M ′EqX+A + A). Thus, by the finite presentability of X, thereexists an object g : W −→M(W +X +A) in EQX+A and a factorization w′ ofe0 through the colimit injection M ′g] +A:

X

w′&&

e0 // M ′M(X +A) +A

M ′W +A

M ′g]+A

OO

We define the morphism w by

w = (Xw′ //M ′W +A

mW+A//MW +A). (4.9)

In the case of the equation morphism e of Example 4.5 we form g by using,besides the variables p and q there, the variables r and s representing x and yand the variables u, v representing the parameters 1 and 2 of e:

W = {p, q, r, s, u, v}

where

g(p) =

q r

, g(q) =

p s

,g(r) = y, g(s) = x,g(u) = 1, g(v) = 2.

Then

g](p) =

∗ y∗

∗ x∗

y∗

x

, g](q) =

∗ x∗

∗ y∗

x∗

y

,

g](r) = y, g](s) = x, g](u) = 1, g](v) = 2.

Consequently, we can choose w′ by

w′(x) =

q r

, w′(y) =

u ∗∗

s v

.

And w will have the same values.

33

Use the naturality of m : M ′ −→ M and Diagram (4.8) to obtain thecommutative diagram

X

e0

%%

w′

$$w

//

e // M(X +A)

M ′M(X +A) +AmM+A

// MM(X +A) +A

[ρ,η·inr]

OO

M ′W +A

M ′g]+A

OO

m+A))

MW +A

Mg]+A

OO

(4.10)

Next we define an equation morphism

〈e〉 : W +X −→M(W +X +A)

in EQA by its coproduct components

W

g

��

X

w

��

M(W +X +A)

M [inl·ηW ,w,inr]��

M(MW +A)

M [M inl,η·inr]��

MW +A

[M inl,η·inr]

~~

MM(W +X +A)

µ))

M(W +X +A)

(4.11)

In our running example of e the equation morphism 〈e〉 is given by W + X ={p, q, r, s, u, v, x, y} and

p ≈∗

q r

, q ≈∗

p s

, r ≈

u ∗∗

s v

, s ≈∗

q r

,

u ≈ 1, v ≈ 2, x ≈∗

q r

, y ≈

u ∗∗

s v

.

34

We check that 〈e〉 is a guarded equation morphism. This can be done forthe components separately. For the right-hand component of 〈e〉 consider thediagram

Xw //

w′ $$

MW +A[M inl,η·inr]

// M(W +X +A)

M ′W +A

mW+A

OO

M ′inl+A// M ′(W +X +A) +A

[m,η·inr]

OO

Its left-hand triangle is (4.9), and the right-hand coproduct component of theright-hand part commutes trivially, while its left-hand coproduct componentcommutes by the naturality of m.

Checking the guardedness of 〈e〉 for the left-hand component results in arather big diagram whose commutativity is nevertheless easy to establish usingguardedness of g, naturality of m and η as well as the laws of the given idealmonad M. We leave the verification to the reader.

Since 〈e〉 is guarded, there exists a unique solution 〈e〉† : W +X −→ A, andwe define

e‡ = (Xinr //W +X

〈e〉†//A). (4.12)

We will prove that this provides the desired unique solution of e.

(1) e‡ is a solution of e. To see this consider the diagram

Xe‡ //

inr

((

w

��

e

//

(4.10)

A

MW+A

Mg]+A

��

[M inl,η·inr]

((

W+X

〈e〉†88

〈e〉

��

(4.12)

(4.11)

(2.4)

M(W+X+A)M[〈e〉†,A]

// MA

a

OO

(4.1)

(∗)

MM(X+A)+A

[MM[e‡,A],ηMA·ηA]

//

[ρ,η·inr]

��

MMA

Ma

OO

ρ

��

M(X+A)M[e‡,A]

// MA

a

oo

(4.13)

The lowest square commutes by the unit law ρA · ηMA= id and the naturality

of ρ and η. All the other inner parts except (∗) commute as indicated. We willnow prove that (∗) commutes. We consider the two components of MW + Aseparately.

(1a) The left-hand component of (∗) of Diagram (4.13). Remove M to obtainthe square

Winl //

g]

��

W +X +A

[〈e〉†,A]

��

M(X +A)M [e‡,A]

// MAa

// A

(4.14)

35

Notice that, by Remark 3.10(2), g] : W −→ M(X + A) is the solution of g inthe free iterative algebra. Thus, by Lemma 4.12 applied to g and h = [e‡, A] :

X+A −→ A we know that a ·M [e‡, A] ·g] is the unique solution of the equationmorphism [e‡, A] • g. Hence, to prove that (4.14) commutes, we establish that

also 〈e〉† ·inl is a solution of [e‡, A] • g. That is, we have to show that the diagram

Winl //

g

��

[e‡,A] • g

//

W +X

〈e〉

��

〈e〉†// A

M(W +X +A)

M(W+[e‡,A])

��

M(W +A)M(inl+A)

// M(W +X +A)M [〈e〉†,A]

// MA

a

OO

OO

M [〈e〉†·inl,A]

(4.15)

commutes. Indeed, the right-hand square expresses that 〈e〉† is a solution of〈e〉, and the lower and left most parts are obvious. We do not claim that the

middle part commutes. However, it does when extended by a ·M [〈e〉†, A]. Tosee this recall the left-hand component of 〈e〉 of Diagram (4.11), and observethat the two morphisms we have to prove equal both start with g. We shall nowprove that they are equal even if we remove g, more precisely, we prove (4.15)by verifying that the following diagram commutes:

M(W +X +A)M(W+[e‡,A])

//

M [inl·ηW ,w,inr]��

M(W +A)M(inl+A)

// M(W +X +A)

M [〈e〉†,A]

��

M(MW +A)

M [M inl,η·inr]��

MM(W +X +A)

µ

��

MM [〈e〉†,A]// MMA

µ

��

Ma // MA

a

��

M(W +X +A)M [〈e〉†,A]

// MAa

// A

Indeed, the lower left-hand square commutes due to the naturality of µ, and thelower right-hand one is the associativity of the algebra (A, a). For the uppersquare remove M and consider the three coproduct components separately. Weobtain, from left to right, the following three diagrams:

W

ηW

��

inl //

〈e〉†·inl

))

W +X +A

[〈e〉†,A]

��

MW

M inl��

M(〈e〉†·inl)

))

A

ηA

��

M(W +X +A)M [〈e〉†,A]

// MAa

// A

36

X

w

��

e‡ // A

MW +A

[M inl,η·inr]��

M(W +X +A)M [〈e〉†,A])

// MAa

// A

A

η

��

MA

M inr��

M(W +X +A)M [〈e〉†,A]

// MAa

// A

The first and the third diagrams clearly commute; use naturality of η and theunit law of the algebra (A, a). The second diagram is the same as the upperpart of Diagram (4.13). This proves (4.15) and thus establishes (4.14).

(1b) The right-hand component of (∗) of Diagram (4.13). We just observethe commutativity of the diagram

A

η

��

inr // W +X +Aη//

[〈e〉†,A]

((

M(W +X +A)M [〈e〉†,A]

// MA

A

η

77

MA

a

33

ηM

// MMA

Ma

OO

(4.16)

using the naturality of η and the right-hand triangle of Diagram (4.1). Thiscompletes the proof of Diagram (4.13).

(2) Uniqueness of solutions. Given a solution s : X −→ A of the equationmorphism e, we will show that for the morphism

u = (Wg]//M(X +A)

M [s,A]//MA

a //A) (4.17)

we obtain a solution

t = (W +X[u,s]

//A) (4.18)

of 〈e〉 in the iterative algebra (A, a). Thus, we get from Equation (4.12) that

e‡ = 〈e〉† · inr = t · inr = s .

37

It is our task to prove that the square

W +Xt //

〈e〉��

A

M(W +X +A)M [t,A]

// MA

a

OO

(4.19)

commutes; it suffices to consider the coproduct components separately.(2a) The right-hand component of Diagram (4.19). Here we consider the dia-gram

Xs //

inr

((

w

��

e

//

(4.10)

A

MW+A

Mg]+A

��

[M inl,η·inr]

((

W+X

t

88

〈e〉

��

(4.18)

(4.11)

(4.19)

M(W+X+A)M[t,A]

// MA

a

OO

(4.1)

(∗)

MM(X+A)+A[MM[s,A],η

MA·ηA]

//

[ρ,η·inr]

��

MMA

Ma

OO

ρ

��

M(X+A)M[s,A]

// MA

a

oo

(4.20)

The lowest square is the same as in Diagram (4.13). All the other inner partsexcept two, the desired one (4.19) and (∗), commute as indicated. For part (∗)we consider the coproduct components separately. The left-hand componentyields (since t·inl = u), after M is removed, the morphism u = a·M [s,A]·g] (see(4.17)) on both paths. The right-hand component commutes: indeed, considerthe analogue of Diagram (4.16) with 〈e〉 replaced by t. Now the outside ofDiagram (4.20) commutes since s is a solution of e. Thus, it follows that theright-hand component of the remaining inner part (4.19) commutes, too.(2b) The left-hand component of (4.19). We have to establish that the followingdiagram commutes:

Wg]

//

g

��

〈e〉·inl

//

(3.29)

M(X+A)M[s,A]

//

(ρ natural)

MAa //

(4.1)

A

M(W+X+A)

M[inl·ηW ,w,inr]

��

M[g],η]

//

(∗)

MM(X+A)MM[s,A]

//

ρ

OO

MMAMa

//

ρ

OO

MA

a

<<

(2.1)M(MW+A)

M[M inl,η·inr]

��

(4.11)

MM(W+X+A)

µ

��

MM[t,A]

// MMA

µ

##

Ma

OO

(µ natural)

M(W+X+A)M[t,A]

// MA

a

OO

38

All inner parts except (∗) commute as indicated. For that part remove M andconsider the three coproduct components separately. We get from left to rightthe following three diagrams:

Wg]//

ηW

��

u=t·inl**

M(X +A)M [s,A]

// MAa // A

A

(4.17)

ηA##

MWM(t·inl)

// MA

a

OO

Xinl //

w

��s

++

X +Aη//

[s,A]

&&

M(X +A)M [s,A]

// MAa // A

MW +A

[M inl,η·inr]��

A

η

99

M(W +X +A)M [t,A]

// MA

a

OO

Ainr //

η

��

X +Aη//

[s,A]

&&

M(X +A)M [s,A]

// MAa // A

A

η

99

η

tt

η

**MA MA

a

OO

The first and the third diagrams clearly commute; use the definitions (4.17)and (4.18) of u and t, the naturality of η and η, the unit law of the algebra (A, a),and Diagram (4.1). Now consider the second diagram. The three trianglesalso clearly commute (use naturality of η and (4.1)). For the lower part seeDiagram (4.20).

We have established that t is a solution of 〈e〉, thus 〈e〉† = t, which completesthe proof. �

5. The Iterative Reflection

We are ready to prove that for every ideal monad M the monad M of freeiterative algebras (see Remark 2.9) is the free iterative reflection. More detailed:

(1) M = M ′ + Id with coproduct injections m (Remark 4.6) and η,

(2) the multiplication µ has a restriction µ′ : M ′M −→ M ′,

(3) every guarded equation morphism e : X −→ M(X + A) has a unique solu-tion,

39

(4) the natural transformation

κ = (MMη//MM

ρ//M ) (5.1)

is an ideal monad morphism, and

(5) κ has the universal property that for every ideal monad morphism from Mto an iterative monad there exists a unique extension along κ to an idealmonad morphism.

We have to leave (1) to the end and prove the other properties first. We will usethe same terminology as in Section 4: in (3) we speak about weakly guardedequation morphisms meaning those with a factorization as in (4.4). In (4)and (5) we use the following notion of weakly ideal monads.

Definition 5.1.

(1) A weakly ideal monad consists of a finitary monad M = (M,η, µ), a finitarysubfunctor m : M ′ ↪−→ M , and a natural transformation µ′ such that thesquare below commutes:

M ′M

mM

��

µ′// M ′

m

��

MMµ// M

(5.2)

(2) Suppose we have two weakly ideal monads M = (M,η, µ,M ′,m, µ′) and

M = (M,η, µ,M′,m, µ′). By a weakly ideal monad morphism we under-

stand a monad morphism h : (M,η, µ) −→ (M,η, µ) such that there exists

a domain-codomain restriction h′ : M ′ −→M′

of h with m · h′ = h ·m.

(3) A weakly ideal monad is called weakly iterative if every weakly guardedequation morphism has a unique solution.

Remark 5.2. Every ideal monad (see Definition 2.3) is, of course, weakly ideal.But the converse does not hold; for example, every monad (S, ηS , µS) is weaklyideal with S′ = S, id : S′ −→ S and µ′ = µS .

Lemma 5.3. The monad M of free iterative algebras for M is weakly ideal w.r.t.m of Remark 4.6.

Proof. We only need to supply the restriction µ′ : M ′M −→ M ′ of the monadmultiplication µ : MM −→ M . Then M = (M, η, µ, M ′, m, µ′) is a weakly idealmonad.

Observe first that the diagram

M ′MMmMM //

M ′µ��

MMM

Mµ��

ρM// MM

µ��

��

mM ·γM

M ′MmM

// MMρ

// MOO

m·γ

40

commutes. Indeed, the left-hand square commutes by naturality of m, the restfollows from Diagrams (4.2) and (4.3).

Thus, by diagnonal fill-in there exists a unique natural transformation µ′ :M ′ −→ M such that the diagram

M ′MMγM// //

M ′µ��

M ′M

mM��

µ′

��

M ′M

�

MM

µ��

M ′ //m

// M

(5.3)

commutes. The lower triangle shows that µ′ is the required restriction of µ(cf. (5.2)). �

Lemma 5.4. The monad M of the free iterative algebras for M is weakly iter-ative.

Proof. We will show that every weakly guarded equation morphism e : X −→M(X+Y ) has a unique solution, i. e., there exists a unique morphism e† : X −→MY such that the following square commutes:

X

e��

e† // MY

M(X + Y )M [e†,η]

// MMY

µ

OO

Indeed, apply Theorem 4.13 to A = MY and the equation morphism ηY • e(see Notation 3.3). To see the result observe that solutions of e are in a 1–1–correspondence to solutions of ηY • e:

Xs //

e

��

ηY • e

//

MY

M(X + Y )

X+ηY

��

M [s,ηY ]

%%

M(X + MY )M [s,MY ]

// MMY

µY

OO

Indeed, notice that µY = ρY (see Notation 4.3). Thus, a solution s of ηY • emakes the outside this diagram commutative. Equivalently, since the lowertriangle trivially commutes, the upper part commutes, which is to say that s isa solution of e. �

41

Remark 5.5. Notice that the equation

ρ = µ · κM : MM −→ M (5.4)

holds. Indeed, we have

µ · κM = µ · ρM ·MηM (definition of κ)

= ρ ·Mµ ·MηM (definition of µ)

= ρ ·M(µ · ηM)

= ρ (unit law of the monad M)

Lemma 5.6. The natural transformation κ : M −→ M is a weakly ideal monadmorphism.

Proof. (1) The preservation of the unit follows from the unit law of the algebras

(MY, ρY ), for every object Y , and from the naturality of η : Id −→M :

MMη// MM

ρ// M

��

κ

Id

η

OO

η// M

ηM

OO

(2) For the preservation of multiplication consider the diagram

MM

µ

��

MMη// MMM

Mρ//

$$µM $$

MMMηM

// MMMρM

// MM

µ��

��

κ∗κ

MMη

// MMρ

// MOO

κ

Its right-hand square commutes due to Equations (5.1) and (5.4), and its left-

hand part by the naturality of µ. The two parallel morphisms Mρ and µM aremerged by ρ : MM −→ M since ρ is componentwise an algebra structure. Sincethe remaining upper and lower parts obviously commute, so does the outside ofthe diagram.

(3) To see that κ has the restriction as required consider the natural trans-formation

κ′ = (M ′M ′η//M ′M

γ//M ′ ).

Thus, the diagram

M ′M ′η//

m

��

M ′Mγ//

mM��

M ′

m��

��

κ′

MMη// MM

ρ// MOO

κ

(5.5)

42

commutes: its left-hand square does by the naturality of m, and its right-handone by Diagram (4.3). �

Lemma 5.7. Let S = (S, ηS , µS , S′, s, (µS)′) be an iterative monad. For everyweakly ideal monad morphism λ : M −→ S there exists a unique weakly idealmonad morphism λ : M −→ S with λ = λ · κ.

Remark 5.8. Notice that S is assumed to be an ideal monad, thus [s, ηS ] :S′ + Id −→ S is an isomorphism. We will use this fact in the proof below.

Proof of Lemma 5.7. (1) For every object Y , we prove that SY is an iterativeM-algebra. Indeed, since λ : M −→ S is a monad morphism we obtain anM-algebra

MSYλSY //SSY

µS//SY .

It is our task to show that those algebras are iterative. Given a weakly guardedequation morphism

Xe //

e0''

M(X + SY )

M ′(X + SY ) + SY

[m,η·inr]

OO

(5.6)

we can form an equation morphism e with respect to the iterative monad S asfollows:

e = (Xe // M(X + SY )

λ∗(ηSX+SY )

��

S(SX + SY )

Scan

��

SS(X + Y )µS// S(X + Y ) ).

(5.7)

To see that e is guarded consider the commutative diagram in Figure 1. Indeed,its upper left-hand triangle commutes due to Diagram (5.6). The two lowersquares, the right most part and the lower rigth-hand triangle all commuteobviously. The upper left-hand square commutes since λ is a weakly ideal monadmorphism and by the naturality of ηS . The upper middle square commutes bythe naturality of s. To see that the remaining part (∗) commutes we consider thecomponents separately: the left-hand one commutes since S is an ideal monad,see the upper part of Diagram (2.2), the middle and right-hand components bythe monad law µS · ηSS = id and the naturality of s.

There is a 1–1–correspondence between solutions of e in the algebra SY andsolutions of e with respect to S. To see this consider the diagram in Figure 2.All its inner parts except part (∗) are easily seen to commute. (For part (+)remove S and consider the coproduct components separately: the left-hand onecommutes by the naturality of ηS and the right-hand one is obvious.)

Now e† is a solution of e if and only if part (∗) commutes. Equivalently, theoutside of the diagram commutes, which is the case if and only if e† is a solutionof e with respect to the monad S.

43

Xe

//

e0

##

M(X

+SY

)λ∗(ηS

+id

)// S

(SX

+SY

)Scan

// SS

(X+Y

)µS

// S(X

+Y

)oo

[s,ηS·in

r]

M′ (X

+SY

)+SY

[m,η·in

r]

OO

λ′ ∗(ηS +

id)+

id//

M′ (X

+SY

)+[s,ηS

]−1

��

S′ (SX

+SY

)+SY

[s,ηS·in

r]

OO

S′ can+

id

// S′ S

(X+Y

)+SY

[sS,ηSS·S

inr]

OO

(∗)

S′ (X

+Y

)+SY

[s,S

inr]

OO

M′ (X

+SY

)+S′ Y

+Y

λ′ ∗(ηS +

id)+

id

// S′ (SX

+SY

)+S′ Y

+Y

S′ ca

n+id//

id+

[s,ηS

]

OO

S′ S

(X+Y

)+S′ Y

+Y

[(µS )′ ,S′ in

r]+id

//

[(µS

)′,S′ inr]

+ηS

88

id+

[s,ηS

]

OO

S′ (X

+Y

)+Y

id+ηS

OO

Figure 1: Proving that e is guarded

44

Xe†

//

e

��

e

//

(∗)

SY

SSY

µS

99

M(X

+SY

)

λ∗(ηS

+SY

)

��

λ

((

M[e†,SY

]//

(5.7

)

MSY

λS

77

S(X

+SY

)

S(ηS

+SY

)vv

S(e†+SY

) // (+)

S(SY

+SY

)

S∇

??

S[ηSS,SηS

]

��

(λnatu

ral)

S(SX

+SY

)

Scan

��

S[Se†,SηS

]

--SS

(X+Y

)

µS

��

SS

[e†,ηS

]

//

(µnatu

ral)

SSSY

µSS

$$

SµS

OO

S(X

+Y

)S

[e†,ηS

]

// SSYµS

OO

Figure 2: 1–1–correspondence between solutions of e and e

45

(2) The freeness of MY as an iterative algebra implies, by (1), the existence of

a unique morphism λY : MY −→ SY such that the diagram

MMYρY //

MλY��

MY

λY��

YηYoo

ηSY}}

MSYλSY

// SSYµSY

// SY

(5.8)

commutes. We first observe that λ is a natural transformation. Given a mor-phism h : Y −→ Z, then Sh is a homomorphism of M-algebras from SY toSZ:

MSYλSY //

MSh��

SSYµSY //

SSh��

SY

Sh��

MSZλSZ

// SSZµSZ

// SZ

(5.9)

Indeed, the left-hand square commutes due to the naturality of λ, and the right-hand one does due to the naturality of µS . Thus, we have two parallel algebrahomomorphisms

Sh · λY , λZ · Mh : MY −→ SZ,

which agree when precomposed with ηY :

MYλY //

Mh

��

SY

Sh

��

Yh��

ηY

ee

ηSY

99

ZηZ

yy

ηSZ

%%

MZλZ

// SZ

Since SZ is an iterative algebra by (1) above it follows from the universal prop-

erty of MY that the outside of the square above commutes, proving the natu-rality of λ.

(3) Let us prove now that λ is a monad morphism. The unit law λ · η = ηS holdsby definition (see Diagram (5.8)). Thus, it remains to show that λ preserves themonad multiplication, i. e., we prove that the diagram

MMYλMY //

µY��

SMYSλY // SSY

µSY��

MYλY

// SY

(5.10)

commutes. Indeed, use (5.9) with h = λY to see that SλY is an algebra homo-

morphism. By the universal property of ηMY

: MY −→ MMY is suffices to

46

show that Diagram (5.10) commutes when precomposed with it:

MMYλMY //

µY

��

SMYSλY // SSY

µSY

��

MYλY //

ηMY

ccηSMY

;;

SY

ηSSY

<<

MYλY

// SY

To see that all the inner parts of this diagram commutes use (5.8) the unit laws

of the monads M and S, the preservation of units by λ, and the naturality ofηS .

(4) Next we show that λ is a weakly ideal monad morphism. Indeed, define first

λ = (M ′Mλ′∗λ //S′S

µ′S//S′ ) (5.11)

and consider the commutative diagram

M ′MmM //

M ′λ��

λ

//

(m natural)

(5.11)

(4.3)

MMρ//

��

M

λ

��

��

m·γ

M ′SmS //

λ′S��

MS

λS

��

(5.8)

(λ ideal)

S′SsS

//

µ′S

��

SSµS

""S′

s//

(5.2)

S

Since s : S′ ↪−→ S is a monomorphism, we obtain by diagonalization a unique

natural transformation λ′

: M ′ −→ S′ such that the diagram

M ′Mγ// //

λ

��

M ′

m��

λ′

��

M

λ

��

S′ //s// S

(5.12)

commutes. Its right-hand triangle shows that λ restricts to λ′

establishing thatλ is a weakly ideal.

47

(5) The equation λ · κ = λ follows from the commutativity of the diagram

MMη

//

λ

��

(i)

MMρ

//

λM

||

""

M

λ

��

��

κ

SM

##

(ii)

(iv)

MS

λS

{{

(iii)

S

==

SηS// SS

µS// SOO

id

The uppermost part is the definition of κ (see (5.1)), parts (i) and (ii) com-mute by the naturality of λ, part (iii) commutes by the definition of λ (seeDiagram (5.8)), and for part (iv) remove S and use (5.8). Finally, use the unitlaw of the monad S for the lowest part.

(6) Uniqueness of λ. Suppose that ν : M −→ S is a weakly ideal monadmorphism with ν · κ = λ. Now in order to prove ν = λ we show that for everyobject Y the morphism νY : MY −→ SY is a homomorphism of M-algebras suchthat νY · ηY = ηSY . Indeed, the last equation holds since the monad morphismν preserves units, and νY is an algebra homomomorphism since the diagram

MMYκMY //

MνY

��

MMYµY //

(ν∗ν)Y

��

MY

νY

��

��

ρY

MSYλSY

// SSYµSY

// SY

commutes; for the uppermost part recall Equation (5.4), for the right-handsquare use that ν preserves multiplication of monads, and for the left-hand oneuse naturality and the equation ν · κ = λ. �

Theorem 5.9. The iterative reflection of an ideal monad is the monad M offree iterative M-algebras.

Proof. In view of the preceeding results this amounts to proving that M is ideal,that is, M = M ′ + Id with injections m and η.

It is known that every weakly ideal monad S has an ideal coreflection c :S∗ −→ S (see [12], Proposition 5.11). Moreover, whenever S is weakly iterative,then S∗ is iterative; the proof of this fact is completely analogous to Lemma 5.13in [12]. More detailed: let S be weakly ideal with the corresponding subfunctors : S′ ↪−→ S. Then for the functor S∗ = S′ + Id there is a structure of a monadS∗ with unit inr : Id −→ S′ + Id and multiplication µ∗ : S∗S∗ −→ S∗ such thatthe morphism c = [s, η] : S′+ Id −→ S is a weakly ideal monad morphism fromS∗ to S. Moreover, every weakly ideal monad morphism from an ideal monadinto S uniquely factorizes through c. We now apply this to S = M: we obtainan iterative monad M∗ = (M ′+Id, inr, µ∗) and a weakly ideal monad morphism

48

c = [m, η] : M∗ −→ M. We prove that c is an isomorphism—this implies the

desired statement M = M ′ + Id.Since M is an ideal monad, the weakly ideal monad morphism κ : M −→ M

factorizes as κ = c · κ∗ for a weakly ideal monad morphism κ∗ : M −→ M∗using the universal property of the coreflection M∗. By the universal propertyof Lemma 5.7 we obtain a weakly ideal monad morphism d : M −→ M∗ suchthat the diagram

Mκ //

κ∗

##

κ

��

M

d��

M ′ + Id

c��

M

commutes. We immediately conclude that c · d = id. Now, d · c is an idealmonad endomorphism on the ideal coreflection M ′+Id of M . Thus, the equalityc · d · c = c proves that d · c = id. �

Corollary 5.10. The full embedding of the category IFM(A) of iterative monadsto the category FMid(A) of ideal monads forms an adjoint situation

IFM(A) //⊥ FMid(A) .oo

6. Conclusions

The purpose of the present paper was the step from establishing that everyideal monad M has an iterative reflection to a description of this reflection. Wehave achieved this goal for set-like base categories. For Set it has been alreadyproved by Evelyn Nelson [8] that every set X generates a free iterative algebra

MX for the monad M. (Nelson used the language of universal algebra.) Conse-

quently, we obtain a monad M of free iterative algebras for M. Unfortunately,it does not seem obvious that the monad M is iterative. We presented a proofthat this is the case, and moreover, M is the iterative reflection of M. We thusderive a number of examples of iterative monads:

(1) For the finite non-empty list monad MX = X+ we obtain the iterative

reflection MX = X+ ∪ {t} where t is an absorbing element.

(2) Analogously, for the finite bag monad M we have MX = MX + {t} wheret is an absorbing element.

(3) For the finite tree monad M, the reflection is the monad M of rational trees.

(4) An analogous example works for non-ordered finite trees: here M is themonad of rational unordered trees. This follows from results in [4].

(5) The iterative reflection of the unary algebra monad MX = X × Σ∗ is the

monad MX = X × Σ∗ + Σ∗(Σ∗)ω.

49

The existence of iterative reflections for all ideal monads was established in[5] for a rather wide range of base categories: all locally finitely presentablecategories in which every object is a coproduct of connected objects. We do notknow whether in this generality it is true that the iterative reflection of everyideal monad is the monad of its free iterative Eilenberg-Moore algebras.

References

[1] C. C. Elgot, Monadic computation and iterative algebraic theories, in:H. E. Rose, J. C. Sheperdson (Eds.), Logic Colloquium ’73, volume 80of Studies in Logic and the Foundations of Mathematics, North-HollandPublishers, Amsterdam, 1975, pp. 175–230.

[2] C. C. Elgot, S. L. Bloom, R. Tindell, On the algebraic structure of rootedtrees, J. Comput. System Sci. 16 (1978) 361–399.

[3] J. Adamek, S. Milius, J. Velebil, Iterative algebras at work, Math. Struc-tures Comput. Sci. 16 (2006) 1085–1131.

[4] J. Adamek, S. Milius, Terminal coalgebras and free iterative theories, In-form. and Comput. 204 (2006) 1139–1172.

[5] J. Adamek, S. Milius, J. Velebil, Iterative reflections of monads,Math. Structures Comput. Sci. 20 (2010) 419–452.

[6] J. Adamek, S. Milius, J. Velebil, A description of iterative reflections ofmonads, in: L. de Alfaro (Ed.), Proc. Foundations of Software Scienceand Computation Structures (FoSSaCS), volume 5504 of Lecture NotesComput. Sci., Springer, 2009, pp. 152–166.

[7] A. Carboni, S. Lack, R. F. C. Walters, Introduction to extensive anddistributive categories, J. Pure Appl. Algebra 84 (1993) 145–158.

[8] E. Nelson, Iterative algebras, Theoret. Comput. Sci. 25 (1983) 67–94.

[9] J. Tiuryn, Unique fixed points vs. least fixed points, Theoret. Comput.Sci. 12 (1980).

[10] S. Ginali, Regular trees and the free iterative theory, J. Comput. SystemSci. 18 (1979) 228–242.

[11] J. Adamek, J. Rosicky, Locally presentable and accessible categories, Cam-bridge University Press, 1994.

[12] S. Milius, Completely iterative algebras and completely iterative monads,Inform. and Comput. 196 (2005) 1–41.

50