A Study of Categories of Algebras and Coalgebras

Jesse Hughes

May, 2001

Department of Philosophy Carnegie Mellon University

Pittsburgh PA 15213

Thesis Committee Steve Awodey, Co-Chair Dana Scott, Co-Chair

Jeremy Avigad

Lawrence Moss, Indiana University

Submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy

Abstract

This thesis is intended to help develop the theory of coalgebras by, first, taking classic theorems in the theory of universal algebras and dualizing them and, second, developing an internal logic for categories of coalgebras.

We begin with an introduction to the categorical approach to algebras and the dual notion of coalgebras. Following this, we discuss (co)algebras for a (co)monad and develop a theory of regular subcoalgebras which will be used in the internal logic. We also prove that categories of coalgebras are complete, under reasonably weak conditions, and simultaneously prove the well-known dual result for categories of algebras. We close the second chapter with a discussion of bisimulations in which we introduce a weaker notion of bisimulation than is current in the literature, but which is well-behaved and reduces to the standard definition under the assumption of choice.

The third chapter is a detailed look at three theorem’s of G. Birkhoff [Bir35, Bir44], presenting categorical proofs of the theorems which generalize the classical results and which can be easily dualized to apply to categories of coalgebras. The theorems of interest are the variety theorem, the equational completeness theorem and the subdirect product representation theorem. The duals of each of these theorems is discussed in detail, and the dual notion of “coequation” is introduced and several examples given.

In the final chapter, we show that first order logic can be interpreted in categories of coalgebras and introduce two modal operators to first order logic to allow reasoning about “endomorphism-invariant” coequations and bisimulations internally. We also develop a translation of terms and formulas into the internal language of the base category, which preserves and reflects truth. Lastly, we introduce a Kripke-Joyal style semantics for L(E_{𝔾}), as well as a pointwise semantics which reflects the intuition of coequation forcing at a point or subset of a coalgebra.

Acknowledgments

I have been fortunate to have two advisors on this dissertation. I first became interested in the subject thanks to Dana Scott, who helped guide the questions and suggested the Birkhoff’s theorem research in particular. Steve Awodey taught me everything I know about category theory, but I am grateful anyway. Both advisors helped my writing immensely, in addition to guiding my research, and I am thankful for their patience and wisdom.

When Dana first suggested I look into coalgebras, he pointed me to Vicious Circles, by Jon Barwise and Larry Moss. Since that book was the start of my study of coalgebras, it seemed only fair that Larry Moss should have to read this dissertation. He graciously agreed to be my outside reader. I am grateful for the advice he and Jeremy Avigad gave as members of my committee.

My research has benefited through discussions and correspondence with many people, including Peter Aczel, Jiří Adámek, Andrej Bauer, Lars Birkedal, Steve Brookes, Corina Cîrstea, Federico do Marchi, Neil Ghani, Jeremy Gibbons, Peter Gumm, Bart Jacobs, Alexander Kurz, Bill Lawvere, John Reynolds, Tobias Schröder James Worrell and Jaap van Oosten and others I’m sure to have missed here. I also want to thank the organizers of the Coalgebraic Methods for Computer Science workshop for providing a great opportunity to meet and discuss our research.

On a more personal note, I could not have completed this work without the extraordinary patience and generosity of my wife, Ling Cheung. In fact, I am the rare husband who’s also grateful for the extended visits of his mother-in-law, Siu Kai Lam. She helped out considerably when two graduate students were overwhelmed with a newborn, Quincy Prescott Hughes. I also enjoyed the distractions from my work, including Penguins hockey, regular fishing trips with Dirk Schlimm, exciting demolition derbies at New Alexandria and captivating and suspenseful games of Peeka-boo with Quincy.

Contents

Introduction 1 Chapter synopsis 4

Chapter 1. Algebras and coalgebras 7 1.1. Algebras and coalgebras for an endofunctor 7 1.2. Structural features of E^{Γ} and E_{Γ} 16 1.3. Subalgebras 22 1.4. Congruences 27 1.5. Initial algebras and final coalgebras 32

Chapter 2. Constructions arising from a (co)monad 47 2.1. (Co)monads and (co)algebras 47 2.2. Subcoalgebras 61 2.3. Subcoalgebras generated by a subobject 73 2.4. Limits in categories of coalgebras revisited 77 2.5. Bisimulations 89 2.6. Coinduction and bisimulations 105 2.7. n-simulations 109

Chapter 3. Birkhoff’s variety theorem 113 3.1. The classical theorem 114 3.2. A categorical approach 115 3.3. Categories of algebras 125 3.4. Uniformly Birkhoff categories 127 3.5. Deductive closure 135 3.6. The coalgebraic dual of Birkhoff’s variety theorem 140 3.7. Uniformly co-Birkhoff categories 153 3.8. Invariant coequations 162 3.9. Behavioral covarieties and monochromatic coequations 168

Chapter 4. The internal logic of E_{𝔾} 175 4.1. Preliminary results 175 4.2. Transfer principles 186

vi CONTENTS

4.3. A Kripke-Joyal style semantics 198 4.4. Pointwise forcing of coequations 200

Concluding remarks and further research 205

Appendix A. Preliminaries 209 A.1. Notation 209 A.2. Factorization systems 209 A.3. Predicates and Subobjects 212 A.4. Relations 214 A.5. Monads and comonads 216

Appendix. Bibliography 219

Appendix. Index 223

Introduction

The theory of universal algebras has been well-developed in the twentieth century. The theory has also proved especially fruitful, with early results (like Birkhoff’s variety theorem) providing a basis for model theory and other results providing an abstract understanding of familiar principles of induction, recursion and freeness. The theory of coalgebras is considerably younger and less well developed. Coalgebras arise naturally, as Kripke models for modal logic, as automata and objects for object oriented programming languages in computer science, etc. Hence, one would like a unified theory of coalgebras to play a role analogous to that of the theory of algebras. This goal is aided by the duality between algebras and coalgebras. Statements about categories of algebras yield dual statements about categories of coalgebras. One can then investigate whether there are reasonable assumptions about the categories of coalgebras that yield the dual theorems.

Algebras, in their commonest form, can be understood as a set together with some operations on the set. In other words, algebras are structures for a signature. The term algebras are examples of free algebras, where freeness is easily expressed in terms of adjoint functors. Such free algebras (which are initial objects in a related category of algebras) come with the proof principle of induction, which can be understood in terms of minimality. That is, the principle of induction is equivalent to the property that an algebra has no non-trivial subalgebras. The property of definition by recursion is exactly the property that an algebra is an initial object. Thus, these familiar topics of universal algebra are well-suited for a categorical setting. We can use the tools of category theory to investigate freeness, induction and recursion as special cases of adjointness, minimality and initiality, respectively. In particular, these algebraic properties can be represented as standard categorical properties applied to categories of algebras (in which the structure of the category leads to the well-known algebraic properties).

Coalgebras can also be regarded as a set together with certain operations on it, but with a key difference. Where an algebra is intended to model combinatorial operations, a coalgebra models a set with various unary operations whose codomain is a (typically) more complex structure. These operations can be viewed as “destructors” which take an element of the coalgebra to its constituent parts. Compare this view

2 INTRODUCTION

with the notion that an algebras operations give a means (not necessarily unique) of “constructing” an element out of a tuple.

Consider, for instance, a set S of A-labeled binary trees^{1} which is closed under the “childOf” relation. That is, if x ∈ S, then both the left and right subtrees of x (if they exist) are also in S. Then S has a natural coalgebraic structure consisting of three destructor functions. Given any x ∈ S, we may ask for the label of x. We may also ask for the left child or right child of x, assuming that there is an “error state” which can be returned if x has no such child . These three structure maps define a signature Σ for a category of coalgebras in the same way that a set with some combinatorial operations define a signature for a category of algebras (i.e., a similarity type). Any set X, together with three operations,

a:\xymatrix{X \ar[r] & A,}
l:\xymatrix{X \ar[r] & X + 1,}
r:\xymatrix{X \ar[r] & X + 1,}

is a Σ-coalgebra. Equivalently, any set X with a single map

⟨a, l, r⟩:\xymatrix{X \ar[r] & A × (X + 1) × (X + 1)}

is a coalgebra of the same type as our set S of binary trees. Indeed, any such structured set can be regarded as a set of trees itself.

We can use the theory of algebras in order to develop the theory of coalgebras. The duality is apparent in the distinguished initial algebra/final coalgebra. The initial algebra is the initial (i.e., “least”) fixed point of the associated functor, while the final coalgebra is the final (i.e., “greatest”) fixed point. The initial algebra comes equipped with principles of recursion and induction, while the final coalgebra satisfies the principles of corecursion and coinduction, that is, principles which are appropriate to collections of non-well-founded structures. Intuitively, the elements of the initial algebra are those which can be constructed from some set of basic elements in a finite number of steps, while the elements of the final coalgebra are all of those structures of the appropriate signature, including those for which no finite construction is apparent (think of the distinction between well-founded binary trees and non-well-founded binary trees). Of course, the extent to which this intuition is appropriate depends on the functor (i.e., signature) at hand. But the point of this comparison remains: To construct a theory of coalgebras, one may take the theory of algebras and dualize the central theorems. One then interprets the result in order to make sense of it – the traditional statement of the principle of coinduction, for instance, does not make apparent its duality with induction. Similarly, the description of a cofree coalgebra

1In this example, we do not require that a tree have both a left and a right child if it has any children.

INTRODUCTION 3

bears little superficial analogy to the corresponding view that free algebras are term algebras. Instead, some work was required to give a useful description of cofreeness, apart from the categorical task of “turning the arrows around”.

The categorical task can be non-trivial as well. Classical results in universal algebra theory were proved in a fairly narrow (from a categorical perspective) setting. In order to dualize these classical theorems, one must first translate the proof into categorical terms, in order to see which properties of Set and polynomial functors are relevant to the theorem. Then, one may dualize these properties – and hope that the result yields reasonable assumptions for the category of coalgebras! If not, then a bit more work may be required to ensure that the proof goes through.

This method has special difficulties when the algebraic proof intrinsically involves elements of algebras. Unfortunately, the dual of “global elements” yields nothing worthwhile and one must find other means of proving the dual theorem. This problem can be seen in the proof of Birkhoff’s “co-subdirect product” theorem in Section 3.7.1. The proof of this theorem bears no real resemblance to the proof of its algebraic counterparts. Furthermore, the statement of the theorem required assumptions beyond those in the original theorem. These differences reflect the difficulty of dualizing a theorem whose proof involves reasoning about elements of algebras.

This thesis is largely an extended exercise in the program of dualizing algebraic results in order to understand categories of coalgebras. The main result in this direction is the dual of Birkhoff’s variety theorem, which we treat in considerable detail in Chapter 3. In addition, we consider his deductive completeness theorem and dualize this theorem, yielding a modal operator on categories of coalgebras which is the dual of closing sets of equations under deductive consequence, and his subdirect product theorem.

One may hope, as well, that as the theory of coalgebras matures, developments in the theory may lead to corresponding results for algebras. This thesis features two modest steps in that direction. First, the modal operator for bisimulations dualizes to a closure operator on relations over coproducts of algebras – but it’s unclear what applications this closure might have. Second, in Section 3.9.3, we consider classes of algebras defined by equations with no variables (just constants) and show that these are exactly the varieties closed under codomains of homomorphisms. This theorem may be well-known (although a search turned up nothing), but illustrates the way in which a coalgebraic topic (covarieties closed under bisimulation) can, when dualized, yield natural algebraic results.

Birkhoff’s variety and completeness theorems are fundamental to the theory of algebras, establishing equational reasoning as the “right” logic for algebras. Hence, it is natural to suppose that “coequations” will play an important role in understanding categories of coalgebras. The work in proving the “co-Birkhoff” theorems yields a

4 INTRODUCTION

definition of coequation which is easily understood: A coequation over C is a predicate on the cofree coalgebra over C (where “cofreeness” now requires some explanation, of course!). Then, to the extent that coequations are central to reasoning about coalgebras, one can infer that the “right” logic for coalgebras is a predicate (not “equational”) logic.

This inference helps motivate the final chapter, in which we develop a logic which can be interpreted in categories of coalgebras (i.e., an “internal” logic). In addition to the first order core of the logic, we introduce a modal operator arising from the dual of Birkhoff’s completeness theorem. Furthermore, we make use of a translation of statements in the logic of the category E_{𝔾} of coalgebras to the base category E. This translation allows “transition” rules which take as premises statements in L(E) and form conclusions in L(E_{𝔾}) (and vice versa). We also give a Kripke-Joyal style semantics which arises naturally from pointwise satisfaction of equations.

Throughout, we work to develop results which apply to as broad a setting as possible. While most research in categories of coalgebras take the base category Set as the starting point (and perhaps even limit discussion to an inductively specified set of functors), we work to develop results which apply to a wide number of categories and functors. One topic in which the difference is most apparent is the notion of bisimulation. Because we do not assume choice, the traditional notion of bisimulation is too restrictive – two elements which are behaviorally indistinguishable need not be “bisimilar” under that definition. Consequently, we offer a new definition of bisimulation in Section 2.5. We show that the new definition reduces to the traditional definition under the axiom of choice. Regardless of the axiom of choice, the new definition is reasonably well-behaved (although without choice or preservation of pullbacks, it’s not clear the bisimulations compose), which cannot be said for the old definition.

In summary, then, this thesis has three primary goals. First, help develop a theory of coalgebras by dualizing results in algebra theory and, when appropriate, dualizing new coalgebraic results and interpret them as theorems about algebras. Second, develop an internal (modal) logic for categories of coalgebras in which coequations play a central role and in which there is an interplay between derivations in the base category and derivations in the category of coalgebras. Third, do the above in as general a setting as practicable, modifying previous definitions, if necessary, to be suitable for the general setting (always ensuring that they reduce to familiar definitions in the familiar setting).

Chapter synopsis

Chapter 1: In this chapter, we introduce the categorical definitions of algebra and coalgebra. We discuss some basic structural features of the category

CHAPTER SYNOPSIS 5

of algebras, E^{Γ}, and the category of coalgebras, E_{Γ}. We spend some time discussing subalgebras, congruences and exactness properties in E^{Γ} as an exercise in applying categorical reasoning to this generalization of universal algebras. Finally, we discuss the initial algebra and final coalgebra. Each of these come equipped with certain proof principles. The initial algebra satisfies the proof principles of induction and definition by recursion, while the final coalgebra satisfies the dual principles of coinduction and definition by corecursion. We highlight the duality when presenting these principles.

Chapter 2: We discuss the relationship between algebras for a monad and free algebras for an endofunctor and the dual result involving coalgebras for a comonad and cofree coalgebras. Following this, we introduce subcoalgebras and discuss a left and a right adjoint to the subcoalgebraic forgetful functor. We use the right adjoint to prove that, in the presence of cofree coalgebras, the category E_{Γ} is as complete as E. The presence of products in E_{Γ} leads to a discussion of relations over coalgebras. In Section 2.5, we introduce a new definition of bisimulation – one which is appropriate to coalgebras in categories without the axiom of choice. We close with a discussion of the relation between coinduction and bisimulations.

Chapter 3: In this section, we primarily discuss Birkhoff’s variety theorem [Bir35] and its dual. To begin, we discuss a generalization of equation satisfaction that is more suitable for a categorical analysis – namely, orthogonality conditions. This leads to an abstract proof of Birkhoff’s theorem which applies to a wide range of categories, and in particular applies to certain categories of algebras. This approach naturally dualizes to provide the “co-Birkhoff” theorem for covarieties of coalgebras. In addition, we consider Birkhoff’s deductive completeness theorem, ibid, and show how its dual leads to a natural modal operator on coalgebraic predicates. In addition, we discuss the dual of Birkhoff’s subdirect product theorem, extending the work in [GS98].

Chapter 4: We show that, given some reasonably weak assumptions on E and Γ, the category E_{Γ} can interpret first order logic. We provide a translation from the internal language of E_{Γ} to the internal language of E which preserves entailment. This translation explicitly involves augmenting the language E with the modal operator □ from Chapter 2. We close with a brief discussion of Kripke-Joyal semantics and pointwise semantics which are suggested from the coequation-as-predicate viewpoint.

CHAPTER 1 Algebras and coalgebras

In this chapter, we present some preliminary definitions and results for categories of algebras and coalgebras. We begin by developing the theories side by side, using the natural dualities to derive results for coalgebras by dualizing results for algebras. In Section 1.2, we discuss limits and colimits in categories E^{Γ} and E_{Γ}, focusing on those (co-)limits which are created by the respective forgetful functor. We also discuss factorizations in E^{Γ} and E_{Γ} which are inherited from the base category. In Section 1.3, we discuss subalgebras, postponing the dual notion until Chapter 2. Similarly, in Section 1.4, we present the standard (categorical) development of algebraic relations (i.e., pre-congruences), while postponing the introduction of coalgebraic relations and bisimulations until the following chapter, when we have already constructed products. We conclude with a discussion of initial algebras and final coalgebras and the characteristic properties (induction/recursion and coinduction/corecursion, respectively).

1.1. Algebras and coalgebras for an endofunctor

We start with the definitions of Γ-algebras and Γ-coalgebras for endofunctor Γ. Note that this is not the same definition as (co)algebras for a (co)monad, which we discuss in Chapter 1.1. Essentially, a category of (co)algebras for an endofunctor is equivalent to a category of (co)algebras for a (co)monad just in case there are (co)free (co)algebras for each object in the base category.

1.1.1. Definitions. We briefly state the definitions of Γ-algebra, Γ algebrahomomorphism and E^{Γ} and then dualize. The aim is that the reader, who is likely familiar with universal algebras in some form, should find the definition of coalgebra familiar and natural as the dual of an algebra. In Section 1.1.3, we will give some examples of coalgebras to show that coalgebras arise naturally.

Definition 1.1.1. Let E be any category. Given an endofunctor Γ:\xymatrix{E \ar[r] & E}, a Γalgebra consists of a pair ⟨A, α⟩, where A is an object of E and α:\xymatrix{ΓA \ar[r] & A} an arrow in E. We call A the carrier and α the structure map of the algebra

Given two Γ-algebras, ⟨A, α⟩ and ⟨B, β⟩, a Γ-algebra homomorphism,

f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩},

is a map f:\xymatrix{A \ar[r] & B} in E such that the following diagram commutes.

\xymatrix{ΓA \ar[d]_{α} \ar[r]^{Γf} & ΓB \ar[d]^{β} \\ A \ar[r]_{f} & B}

The Γ-algebras and their homomorphisms form a category, denoted E^{Γ}.

The concept of Γ-coalgebras is formally dual to the definition of Γ-algebra above. Specifically, the category E_{Γ} of coalgebras arises formally as the category ((E^{op})^{Γ^{op}})^{op}. Of course, interest in coalgebras comes from the fact the these structure arise independently as well, from computer science semantics, Kripke frames and models, and other sources.

Definition 1.1.2. A Γ-coalgebra is a ⟨A, α⟩, where α:\xymatrix{A \ar[r] & ΓA}. Again, A is the carrier and α the structure map of the coalgebra. A Γ-coalgebra homomorphism is again a commutative square:

\xymatrix{ΓA \ar[r]^{Γf} & ΓB \\ A \ar[u]^{α} \ar[r]_{f} & B \ar[u]_{β}}

The Γ-coalgebras and their homomorphisms again form a category, denoted E_{Γ}.

Note: We often refer to Γ-algebra homomorphisms as Γ-homomorphisms or just homomorphisms. We do the same for coalgebra homomorphisms. The kind of homomorphism we mean should be clear from the context.

For each of these categories, there is an evident forgetful functor, U, taking a (co)algebra ⟨A, α⟩ to A. Properly, we should write

U^{Γ} :\xymatrix{E^{Γ} \ar[r] & E},
U_{Γ} :\xymatrix{E_{Γ} \ar[r] & E},

to indicate that these are different functors, depending on whether we are interested in algebras or coalgebras and also depending on the functor Γ. Of course, we will avoid such complications and the meaning of U should be clear from context.

In Section 1.2, we will give some of the features of the categories E^{Γ} and E_{Γ}. In particular, the forgetful functor creates limits (colimits, resp.) in categories of algebras (coalgebras, resp.). Before exploring these features, we give some examples of categories of algebras and coalgebras.

1.1. ALGEBRAS AND COALGEBRAS FOR AN ENDOFUNCTOR 9

Remark 1.1.3. The notation for a Γ-algebra is the same as that for a Γ-coalgebra. Namely, each is a pair ⟨A, α⟩, where

α:\xymatrix{ΓA \ar[r] & A}

in the algebraic case, and

α:\xymatrix{A \ar[r] & ΓA}

in the coalgebraic case. Most often, whether we mean ⟨A, α⟩ to be an algebra or a coalgebra will be clear from context. However, we sometimes use this ambiguity of notation to our advantage. For example, in Section 1.3, we note that a subobject in E^{Γ} is a monic algebra homomorphism

[figure: ⟨B, β⟩; ⟨A, α⟩] .

Also, a subobject in E_{Γ} is a monic coalgebra homomorphism

[figure: ⟨B, β⟩; ⟨A, α⟩] .

Since the notation for each is the same, we can draw the diagram just once and say A subobject of a Γ-(co)algebra is a monic homomorphism

[figure: ⟨B, β⟩; ⟨A, α⟩] .

1.1.2. Some examples of algebras. In this section, we begin with some examples of algebras for various functors. We will, in each case, make clear what the homomorphisms in E^{Γ} are.

Example 1.1.4. Consider the functor Γ:\xymatrix{Set \ar[r] & Set} given by

ΓA = 1 + A × A.

An algebra for this functor consists of a set A together with a structure map

α:\xymatrix{A × A + 1 \ar[r] & A}.

Such a map α is equivalent to a pair of maps

·_{α}:\xymatrix{A × A \ar[r] & A}, and
a:\xymatrix{1 \ar[r] & A}

In other words, a Γ-algebra is a triple ⟨A, ·_{α}, a⟩, where ·_{α} is a binary operation on A and a is a distinguished element of A. This is also called a Σ-model or Σ-structure for the signature

Σ = {·^{(2)}, e^{(0)}}.

See Example 1.1.5 for details.

Given another Γ-algebra, ⟨B, ·_{β}, b⟩, a Γ-homomorphism \xymatrix{⟨A, ·_{α}, a⟩ \ar[r] & ⟨B, ·_{β}, b⟩} is a map f:\xymatrix{A \ar[r] & B} such that the following diagram commutes:

\xymatrix{A × A + 1 \ar[r]^{f×f+id_{1}} \ar[d]_{⟨·_{α}, a⟩} & B × B + 1 \ar[d]^{⟨·_{β}, b⟩} \\ A \ar[r]_{f} & B}

This entails that

f(s·_{α}t) = f(s)·_{β}f(t), and
f(a) = b.

In other words, a homomorphism is a map that respects the binary operation and constant. The next example generalizes this result to arbitrary universal algebras.

Example 1.1.5. Much of this dissertation is devoted to taking well-known results in universal algebra, translating them to a categorical setting and dualizing. This approach relies on the fact that the categorical notion of algebra for an endofunctor is a proper generalization of the notion of universal algebra. In particular, given any signature Σ, there is a polynomial functor ℙ such that the category Set^{ℙ} is the category of universal Σ-algebras. This result is well-known, but it is useful to work through the details here, in order to gain some familiarity with the categorical notions.

These definitions can be found in [MT92], [Grä68] and elsewhere.

A signature Σ is a set of function symbols together with associated (finite) arities. We write f^{(n)} to indicate that f is a function symbol of arity n. If the arity of a function symbol c is 0, then we call c^{(0)} a constant symbol.

A Σ-algebra is a pair

S = ⟨S, \{f_{S}^{(n)} :\xymatrix{S^{n} \ar[r] & S}|f^{(n)} ∈ Σ\}⟩,

where S is a set (called the carrier of the algebra). Notice that the interpretation of a constant symbol is an element of S.

Given two Σ algebras S and T , we say that a set function ϕ: \xymatrix{S \ar[r] & T} is a Σhomomorphism if, for every function symbol f^{(n)} in Σ, and every s_{1}, …, s_{n} ∈ S,

f_{T}^{(n)}(ϕ(s_{1}), …, ϕ(s_{n})) = ϕ(f_{S}^{(n)}(s_{1}, …, s_{n})).

In particular, this means that for every constant symbol c^{(0)}, ϕ(c_{S}^{(0)}) = c_{T}^{(0)}. Given a signature Σ, consider the polynomial functor ℙ:\xymatrix{Set \ar[r] & Set} given by

ℙS = ∐_{f^{(n)}∈Σ} S^{n}.

1.1. ALGEBRAS AND COALGEBRAS FOR AN ENDOFUNCTOR 11

Of course, if Σ is infinite, then this functor involves an infinite coproduct, so perhaps the term “polynomial functor” is misleading here. It is easy to show that the category of Σ-algebras, Alg(Σ), is isomorphic to the category of ℙ-algebras, Set^{ℙ}. For each Σ-algebra S and each f^{(n)} ∈ Σ, we have the interpretation of f^{(n)} in S,

f_{S}^{(n)} :\xymatrix{S^{n} \ar[r] & S}.

Hence, there is a unique ℙ-algebra structure map σ:\xymatrix{ℙS \ar[r] & S} making the diagram below commute.

[figure: S^{n}; f_{S}^{(n)}; ∐_{f^{(n)}∈Σ} S^{n}; σ; S]

Conversely, any ⟨S, σ⟩ in Set^{ℙ} corresponds to a Σ-algebra with f_{S}^{(n)} given by

[figure: S^{n}; ∐_{f^{(n)}∈Σ} S^{n}; α; S.]

It’s easy to see that Σ-homomorphisms are ℙ-homomorphisms, and vice-versa, so that this correspondence is an isomorphism of categories

Alg(Σ) ≅ Set^{ℙ}.

Besides providing motivation for the approach of this dissertation, this example should convince the reader that algebras for an endofunctor are familiar territory. Sets and operations on sets are familiar enough, and these structures gave rise to the notion of universal algebras. The categorical notion of algebras for an endofunctor is simply a generalization of universal algebras, as we’ve seen here.

Example 1.1.6. Let Z be a set and consider the Set functor

ΓA = Z × A + 1.

An algebra for this functor consists of a pair ⟨A, α⟩ where α:\xymatrix{Z × A + 1 \ar[r] & A}. We decompose α into two maps,

∗_{α}:\xymatrix{Z × A \ar[r] & A}, and
()_{α}:\xymatrix{1 \ar[r] & A}.

A homomorphism from the Γ-algebra ⟨A, α⟩ to ⟨B, β⟩ is a set function

f:\xymatrix{A \ar[r] & B}

such that, for all z ∈ Z and a ∈ A,

f(z ∗_{α} a) = z ∗_{β} f(a),
f(()_{α}) = ()_{β}.

12 1. ALGEBRAS AND COALGEBRAS

We will see in Example 1.5.6 that the initial algebra for this functor is the collection of all finite streams over Z, which we denote Z^{<ω}. We can see now that Z^{<ω} is a Γ-algebra, with the structure map given by

push:\xymatrix{Z × Z^{<ω} \ar[r] & Z^{<ω}}, and
():\xymatrix{1 \ar[r] & Z^{<ω}} ,

where push returns the result of pushing a new letter onto a stream and () returns the empty stream. More specifically,

push(x, σ:\xymatrix{n \ar[r] & Z}) = λk . \begin{cases}x & if k = 0 \\ σ(k − 1) & else \end{cases}

and () is the unique map \xymatrix{0 \ar[r] & Z} .

1.1.3. Some examples of coalgebras. The dual category of coalgebras for an endofunctor may seem less familiar. In this section, we will give a few common examples of Set_{Γ} for a variety of endofunctors on Set. In many these examples, the reader should notice that the structure map α:\xymatrix{A \ar[r] & ΓA} acts as a destructor. It takes an element of the coalgebra and decomposes the element into its constituent parts. This is a common feature of coalgebras and this point of view is dual to the point of view that algebras are objects together with combinatory principles. However, the examples of Kripke models (Example 1.1.10) and topological spaces (Example 1.1.12) show that one can take talk of destructors too seriously.

Example 1.1.7. Consider the set functor

ΓA = Z × A

for a fixed set Z. A coalgebra for this functor consists of a set A and a structure map

α:\xymatrix{A \ar[r] & Z × A}.

Equivalently, a coalgebra is given by a set A and two maps

h_{α}:\xymatrix{A \ar[r] & Z}, and
t_{α}:\xymatrix{A \ar[r] & A}.

Given any such coalgebra, each a ∈ A gives rise to an infinite stream over Z, namely the stream

h_{α}(a), h_{α} ∘ t_{α}(a), h_{α} ∘ t_{α}^{2}(a), …

So, for any Γ-coalgebra ⟨A, α⟩, we can define a mapping ! from A to the collection of streams over Z, Z^{ω}, by defining

!(a) = λn . h_{α} ∘ t_{α}^{n}(a).

1.1. ALGEBRAS AND COALGEBRAS FOR AN ENDOFUNCTOR 13

It is worth noting, however, that this map is not necessarily one-to-one. Distinct elements of A may give rise to the same stream. For instance, consider the coalgebra ⟨A, α⟩ where

A = {a, b, c}

and

α(a) = ⟨17, c⟩,
α(b) = ⟨17, c⟩,
α(c) = ⟨17, c⟩.

Then, one can see from the above definition of !, that

!(a) =!(b) =!(c).

Indeed, each of the elements of A maps to the constant 17 map.

We will see in Example 1.5.19 that the function ! is defined by corecursion on the collection of streams Z^{ω}.

A homomorphism between two Γ-coalgebras, ⟨A, ⟨h_{α}, t_{α}⟩⟩ and ⟨B, ⟨h_{β}, t_{β}⟩⟩ is a map f:\xymatrix{A \ar[r] & B} satisfying

h_{α}(a) = h_{β}(f(a)),
f(t_{α}(a)) = t_{β}(f(a)).

The map ! is an example of such a homomorphism.

Example 1.1.8. Consider again the functor

ΓA = Z × A + 1

from Example 1.1.6. A coalgebra for this functor consists of a set A together with a map

α:\xymatrix{A \ar[r] & Z × A + 1}.

So, each element a of such a coalgebra ⟨A, α⟩ either maps to ∗, the unique element of 1, or to an ordered pair ⟨z, a′⟩, where z ∈ Z and a′ ∈ A. We can again interpret the coalgebras as collections of streams over Z if we allow each stream to be finite or infinite (above, we mapped coalgebras to collections of infinite streams). If α(a) = ∗, then we take a to represent the empty stream. Otherwise, α(a) = ⟨z, a′⟩ for some z and a′. Let σ′ be the stream represented by a′. We say that a represents the stream push(z, a′), where push is the stream with head z and tail a′. In this way, we define a mapping

!:\xymatrix{A \ar[r] & Z^{≤ω}}

satisfying

!(a) = \begin{cases}() & if α(a) = ∗ \\ push(z,!(a′)) & else \end{cases}

This map is again defined corecursively and is described in detail in Example 1.5.21. We mention it here to give the reader an intuition for the Γ-coalgebras. A Γ-coalgebra is a collection of finite and infinite streams over Z.

A homomorphism between two Γ-coalgebras must satisfy the same equations as in Example 1.1.7, if α(a) ∈ Z × A, and, if α(a) = ∗, then β(f(a)) = ∗.

Example 1.1.9. Let ℙ be a polynomial functor on Set, which we’ll write as

ℙ(A) = ∐_{i<ω} Z_{i} × A^{i}.

A ℙ coalgebra consists of a set A, together with a structure map α:\xymatrix{A \ar[r] & ℙ}(A). Given such a coalgebra ⟨A, α⟩, for each a ∈ A, define br(a) to be the unique i such that

α(a) ∈ Z_{i} × A^{i}.

We call the elements of π_{A^{i}} ∘ α(a) the children of a. We denote the jth child,

π_{j} ∘ π_{A^{i}} ∘ α(a),

by child_{j}(a). We call π_{Z_{i}} ∘ α(a) the label of a, denoted label(a). In this way, we think of a Γ-coalgebra as a collection of labeled trees. Each element a ∈ A is the root of a tree, where the immediate subtrees have the children of a as roots. The number of children is given by br(a), and the set of valid labels of a is given by Z_{br(a)}. Take this description of coalgebras as trees as purely motivational for now — there will be more discussion on this in Example 1.5.22.

Examples 1.1.7 and 1.1.8 give a detailed account of two polynomial functors. In the former example, each node of the “tree” is labeled with an element of Z and has exactly one child. In the latter, each node has either 0 or 1 child. If it has 0 children, it is unlabeled (or, if you prefer, labeled with ∗). If it has 1 child, it is labeled with an element of Z, as before.

Example 1.1.10. Given a set of atomic propositions AtProp, we can define an infinitary modal language L(AtProp) to be the least class containing AtProp and closed under the rules

• ⊤ ∈ L(AtProp).

• If ϕ ∈ L(AtProp), then so is ¬ϕ and ♢ϕ.

• If S ⊂ L(AtProp), then ⋀ S ∈ L(AtProp). A Kripke model for the language L(AtProp) is given by a pair 𝔄 = ⟨A, α⟩, where A is a set and

α:\xymatrix{A \ar[r] & P(A) × P(AtProp)}.

1.1. ALGEBRAS AND COALGEBRAS FOR AN ENDOFUNCTOR 15

The idea is that the first component of α(s) is the set of worlds accessible to s and the second component is the set of atomic propositions that hold in s. Accordingly, one defines a satisfaction relation ⊧_{𝔄} by the following:

• a ⊧_{𝔄} ⊤.

• a ⊧_{𝔄} ϕ for ϕ ∈ AtProp iff ϕ ∈ π_{2} ∘ α(a).
• a ⊧_{𝔄} ¬ϕ iff a |̸=_{𝔄} ϕ.
• a ⊧_{𝔄} ♢ϕ iff there is some b ∈ π_{1} ∘ α(a) such that b ⊧_{𝔄} ϕ.
• a ⊧_{𝔄} ⋀ S iff a ⊧_{𝔄} ϕ for each ϕ ∈ S.

So, we see that Kripke models can be viewed as coalgebras for a particular functor in a straightforward manner, and that the resulting satisfaction relation comes directly from the coalgebraic structure map.

This example is covered in detail in [BM96, Chapter 11]. In the case that AtProp is empty, so the functor is just A ↦ P(A), the coalgebras are called Kripke structures or Kripke frames. These are discussed in detail in [Jac00, Che80, HC68].

Example 1.1.11. Fix a set of “inputs”, I and let Γ:\xymatrix{Set \ar[r] & Set} be defined by

ΓS = (P_{fin}S)^{I},

where P_{fin} is the covariant finite powerset functor. A Γ-coalgebra ⟨S, σ⟩ can be regarded as a non-deterministic automaton over I, where the structure map gives the transition function. Explicitly, for each state s ∈ S and each input i ∈ I, we write

\xymatrix{s \ar[r]^{i} & s′}

just in case s′ ∈ σ(s)(i).

Example 1.1.12. We take this example from [Gum01b].

Let A be a set. A filter on PA is a collection U ⊆ PA if U is closed under finite intersections and supersets. In other words, U is a filter on PA just in case

• If S, T ∈ U, then S ∩ T ∈ U, and

• If S ∈ U and S ⊆ T, then T ∈ U.

We define a functor F:\xymatrix{Set \ar[r] & Set} taking each set A to the collection of filters on A. If f:\xymatrix{A \ar[r] & B} is a map in Set, then for each S ∈ PA, Ff(S) is the filter generated by Pf(S). See [Gum01b] for details on the functor F.

Each topological space ⟨A, O_{A}⟩ gives rise to an F-coalgebra, as follows. We define the structure map α:\xymatrix{A \ar[r] & FA} on elements a ∈ A by

α(a) = {S ⊆ A | ∃U ∈ O_{A} . a ∈ U ⊆ S}.

16 1. ALGEBRAS AND COALGEBRAS

In other words, α(a) is the neighborhood filter^{1} of a. It is easy to see that, if ⟨A, α⟩ and ⟨B, β⟩ are F-coalgebras arising from topological spaces ⟨A, O_{A}⟩ and ⟨B, O_{B}⟩, respectively, then a map f:\xymatrix{A \ar[r] & B} is a coalgebra homomorphism just in case f is an open, continuous map. Thus, we have an inclusion

\xymatrix{Top^{open} \ar[r] & Set_{F}} ,

where Top^{open} is the category of topological spaces and open, continuous maps.

Example 1.1.13. Consider the functor ΓA = Z × A on the category Top, where Z is a fixed T_{1} space (so points are topologically distinguishable). A Γ-coalgebra consists of a pair ⟨A, α⟩ where A is a topological space and α:\xymatrix{A \ar[r] & ΓA} is continuous. We will consider some carrier spaces for Γ-coalgebras and describe the Γ-structure map that can be imposed on the space.

Let I be the unit interval [0, 1]. Then a Γ-coalgebra with carrier I is just a path in the space Z × I.

Let 2 denote the Sierpinski space and let σ:\xymatrix{2 \ar[r] & ℝ × 2} be continuous. Let π_{1} ∘ σ(0) = z_{0} and π_{2} ∘ σ(0) = z_{1}. For every open U containing z_{0}, π_{1}^{−1}(U × 2) is open and so z_{1} ∈ U. Hence, z_{0} = z_{1}. So, a Γ-coalgebra with carrier 2 is specified by an element of Z and a map \xymatrix{2 \ar[r] & 2}.

1.2. Structural features of E^{Γ} and E_{Γ}

The categories E^{Γ} and E_{Γ} inherit much of the structure from the underlying category E. In particular, E^{Γ} has whatever limits E has, and E_{Γ} has whatever colimits E has. If the functor Γ preserves colimits, then these are available in E^{Γ}, and the dual result holds for E_{Γ}. All of this is well-known and can be found in, for instance, [Bor94, Volume 2, Chapter 4], where these results are presented for algebras for a monad. The same proofs imply the following results for algebras for an endofunctor^{2}. We present the main theorems here, without proof.

1.2.1. Creating (co)limits in categories of (co)algebras. The following definitions can be found in most standard category theory texts, including [Lan71].

Definition 1.2.1. Let G:\xymatrix{C \ar[r] & C′} be a functor. We say that G preserves D-limits if, for every diagram J:\xymatrix{D \ar[r] & C}, whenever

τ:\xymatrix{A \ar@{=>}[r] & J}

is a limiting cone, then

Gτ:\xymatrix{GA \ar@{=>}[r] & G ∘ J}

1A neighborhood of a is any set S ⊆ A containing an open set which contains a. We do not require that S itself is open.

2The key step is showing the existence of a structure map for the (co)limit. This step is essentially the same for both algebras for an endofunctor and algebras for a monad.

1.2. STRUCTURAL FEATURES OF E^{Γ} AND E_{Γ} 17

is a limiting cone for G ∘ J.

We say that G reflects D-limits if, for every J:\xymatrix{D \ar[r] & C}, whenever

Gτ:\xymatrix{GA \ar@{=>}[r] & G ∘ J}

is a limiting cone for G ∘ J, then

τ:\xymatrix{A \ar@{=>}[r] & J}

is a limiting cone for J.

Similarly, we define the statements G preserves/reflects D-colimits.

If a functor preserves/reflects all (co)limits (regardless of the diagram category), we say the functor preserves/reflects (co)limits.

Definition 1.2.2. We say that G:\xymatrix{C \ar[r] & C′} creates D-limits if, whenever

J:\xymatrix{D \ar[r] & C}

and

τ′:\xymatrix{A′ \ar@{=>}[r] & G ∘ J}

is a limiting cone in C′, then there is a unique limiting cone

τ:\xymatrix{A \ar@{=>}[r] & J}

in C such that GA = A′ and Gτ = τ′.

Similarly, we define the statements G creates D-colimits and G creates (co)limits.

So, if a functor G:\xymatrix{C \ar[r] & C′} creates D-limits, then C has “as many” D-limits as C′ does. It is easy to see that if G creates D-limits, then G reflects D-limits. Also, if G creates D-limits and C′ has all D-limits (is D-complete), then G also preserves D-limits and C is D-complete.

Definition 1.2.3. Additionally, we say that G preserves regular epis if, whenever p is a regular epi, then G(p) is a regular epi.

Similarly, we define G reflects regular epis.

More generally, we define G preserves/reflects maps of type Θ, where Θ is some class of arrows (say, regular monos, isomorphisms, etc.)

It is worth noting that preservation of regular epis is weaker than preservation of coequalizers. If G preserves coequalizers, then any coequalizer diagram

\xymatrix{B \ar[r]^{f} \ar[r]_{g} & A \ar@{|->}[r]^{q} & Q}

is taken to a coequalizer diagram

\xymatrix{GB \ar[r]^{Gf} \ar[r]_{Gg} & GA \ar@{|->}[r]^{Gq} & GQ} .

If G preserves regular epis, however, we can only conclude that Gq is a coequalizer for some pair of maps. We cannot conclude that Gq is the coequalizer of Gf and Gg.

Theorem 1.2.4. Let E and Γ:\xymatrix{E \ar[r] & E} be given. The algebraic forgetful functor

U:\xymatrix{E^{Γ} \ar[r] & E}

creates limits. Dually, the coalgebraic forgetful functor

U:\xymatrix{E_{Γ} \ar[r] & E}

creates colimits.

We interpret this theorem as saying that E^{Γ} has whatever limits E has, and that, furthermore, these limits are computed in E. We apply this result in Section 1.5, for instance, to conclude that the initial coalgebra (final algebra, resp.) are trivial if E has an initial object (final object, resp.).

Example 1.2.5. Let E have all κ-indexed products and let {⟨A_{i}, α_{i}⟩}_{i∈κ} be an κ-indexed collection of Γ-algebras. Then the product

∏_{i∈κ}⟨A_{i}, α_{i}⟩

is defined in E^{Γ} and is given by

⟨∏_{i∈κ} A_{i}, ⟨α_{i}⟩_{i∈κ}⟩,

where

⟨α_{i}⟩_{i∈κ}:\xymatrix{Γ ∏_{i∈κ} A_{i} \ar[r] & ∏_{i∈κ} A_{i}}

is the unique map such that, for all i ∈ κ,

π_{i} ∘ ⟨α_{i}⟩_{i∈κ} = α_{i}.

This is a generalization of the statement that products of universal algebras are the products of the underlying sets, with operations determined pointwise.

Example 1.2.6. Dually, let E have all κ-indexed coproducts and let {⟨A_{i}, α_{i}⟩}_{i∈κ} be an κ-indexed family of Γ-coalgebras. We have a family of maps

\xymatrix{A_{i} \ar[r]^{α_{i}} & ΓA_{i} \ar[r]^{Γκ_{i}} & Γ ∐_{i∈κ} A_{i}} ,

inducing a structure map

\xymatrix{∐_{i∈κ} A_{i} \ar[r] & Γ ∐_{i∈κ} A_{i}} .

It is easy to confirm that this coalgebra is a coproduct in E_{Γ}.

1.2. STRUCTURAL FEATURES OF E^{Γ} AND E_{Γ} 19

1.2.2. Colimits in E^{Γ}, limits in E_{Γ}. Again, this theorem can be found in [Bor94, Volume 2, Chapter 4], where the result is proved for categories of algebras for a monad.

Theorem 1.2.7. Let D be a category and Γ:\xymatrix{E \ar[r] & E}. If Γ preserves D-colimits then the forgetful functor U:\xymatrix{E^{Γ} \ar[r] & E} creates such colimits. Similarly, the coalgebraic forgetful functor U:\xymatrix{E_{Γ} \ar[r] & E} creates any limits preserved by Γ.

So, for instance, if Γ preserves coequalizers, then E^{Γ} has all coequalizers and these are created by U. Unfortunately, the preservation of coequalizers seems a strong condition. However, we will get considerable mileage out of a weaker condition: preservation of regular epis.

In the coalgebraic setting, one often wants that the forgetful functor preserves pullbacks along regular monos. Other authors have ensured that this condition holds by assuming that Γ preserves weak pullbacks, We take the shorter path to the goal and assume that Γ preserves the appropriate pullbacks, since other weak pullbacks do not play a central role in this thesis. Applying Theorem 1.2.7, we have the following useful corollary.

Corollary 1.2.8. If Γ preserves pullbacks along (regular) monos, then U creates pullbacks along (regular) monos.

1.2.3. Factorizations of (co)algebras. In this section, we show how a category of (co)algebras can inherit a factorization system from its base category (see Appendix for a brief discussion of factorization systems). Explicitly, if E has regular epi-mono factorizations and kernel pairs and if Γ preserves regular epis, then the category of algebras E^{Γ} also has regular epi-mono factorizations, created by U. Furthermore, the forgetful functor preserves and reflects regular epis, monos and exact coequalizer sequences. Since every functor Γ:\xymatrix{Set \ar[r] & Set} preserves regular epis, this implies in particular that Set^{Γ} has regular epi-mono factorizations.

Dually,we learn that if E has epi-regular mono factorizations and cokernel pairs, and Γ preserves regular monos, then E_{Γ} has epi-regular mono factorizations, created by U.

The following lemma and its dual are useful in verifying that certain maps in E are homomorphisms.

Lemma 1.2.9. Suppose that p:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} be a Γ-algebra homomorphism and let f:\xymatrix{B \ar[r] & C} be given, where C = U⟨C, γ⟩. Suppose further that Γp is epi. If f ∘ p is a homomorphism, then so is f.

In particular, if Γ preserves epis (takes regular epis to epis, resp.) and p is an epi (regular epi, resp.) in E, then f is a homomorphism whenever f ∘ p is.

20 1. ALGEBRAS AND COALGEBRAS

Proof. Consider Figure 1. A simple diagram chase confirms that

γ ∘ Γf ∘ Γp = f ∘ β ∘ Γp.

Since Γp is an epi, f is a homomorphism. □

\xymatrix{ΓA \ar[d]_{α} \ar@{->>}[r]^{Γp} & ΓB \ar[d]^{β} \ar[r]^{Γf} & ΓC \ar[d]^{γ} \\ A \ar[r]_{p} & B \ar[r]_{f} & C}

Figure 1. If f ∘ p is a homomorphism, then so is f.

Corollary 1.2.10. Let i:\xymatrix{⟨B, β⟩ \ar[r] & ⟨C, γ⟩} be a coalgebra homomorphism, and let f:\xymatrix{A \ar[r] & B} be a map in E, where A = U⟨A, α⟩. If Γi is monic and i ∘ f a coalgebra homomorphism, then f is a coalgebra homomorphism.

In particular, if Γ preserves monos (takes regular monos to monos, resp.) and i is mono (regular mono, resp.) in E, then f is a homomorphism whenever i ∘ f is.

Proof. By duality. □

If Γ preserves epis, then U:\xymatrix{E^{Γ} \ar[r] & E} reflects strong epis, as can easily be verified. Lemma 1.2.11 gives the analogous claim for regular epis, which we will use to prove that E^{Γ} has regular epi-mono factorizations given certain conditions on E and Γ (see Theorem 1.2.13).

Throughout, we will prefer regular epi-mono factorization systems over strong epi-mono factorization systems, but this is largely a matter of choice. As one can see in explicitly in [Kur00, Kur99], the basic theorems go through just as easily with strong epis in the place of regular epis. We stick with the regular epis because of the connection between coequalizers and sets of equations in Chapter 3. For the sake of duality, we also stress regular monos in the coalgebraic cases.

Lemma 1.2.11. Let E have kernel pairs and Γ:\xymatrix{E \ar[r] & E} take regular epis to epis. Then

U:\xymatrix{E^{Γ} \ar[r] & E}

reflects regular epis.

Proof. Let p:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} be a map in E^{Γ} and suppose that p is a regular epi in E. Let

\xymatrix{⟨K, κ⟩ \ar[r]^{k_{1}} \ar[r]_{k_{2}} & ⟨A, α⟩}

1.2. STRUCTURAL FEATURES OF E^{Γ} AND E_{Γ} 21

be the kernel pair of p and suppose f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨C, γ⟩} coequalizes the kernel pair (see Figure 2). Since U preserves kernel pairs, p is the coequalizer of k_{1} and k_{2} in E. Hence,

[figure: ΓB; Γg; ΓK; Γk_{1}; Γk_{2}; κ; ΓA; Γp; α; ΓC; γ; B; g; K; k_{1}; k_{2}; A; p; f; C]

Figure 2. U reflects regular epis.

there is a unique map g:\xymatrix{B \ar[r] & C} in E such that g ∘ p = f. Apply Lemma 1.2.9. □

The next theorem (about factorizations in E^{Γ}) proves especially useful, as we will see. Thus, it is worthwhile to attach a name to the conditions that we assume on E. That these conditions are part of the definition of regular category suggests the following definition.

Definition 1.2.12. A category C is almost regular if C has kernel pairs and regular epi-mono factorizations (we don’t require that kernel pairs have coequalizers or that regular epis are stable under pullbacks).

Dually, a category with cokernel pairs and epi-regular mono factorizations is almost co-regular.

Theorem 1.2.13. Let E have be almost regular and let Γ:\xymatrix{E \ar[r] & E} preserve regular epis. Then E^{Γ} has regular epi-mono factorizations, preserved and reflected by

U:\xymatrix{E^{Γ} \ar[r] & E}.

Proof. Let f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} and take the regular epi-mono factorization, f = i∘p, in E (as in Figure 3). Because Γp is regular and hence strong, there is a structure map γ, as shown making both i and p homomorphisms. Since the forgetful functor reflects regular epis and monos, we see that i ∘ p is a regular epi-mono factorization in E^{Γ}, obviously preserved by U.

Since regular epi-mono factorizations are unique up to isomorphism, this is sufficient to conclude that U preserves all regular epi-mono factorizations. □

The following definition is found in [Bor94, Volume 2, Chapter 2], where exact sequences in regular categories are described in detail.

[figure: ΓA; Γp; α; ΓC; Γi; γ; ΓB; β; A; p; C; i; B]

Figure 3. Regular epi-mono factorization in E^{Γ}.

Definition 1.2.14. A diagram of the form

\xymatrix{K \ar[r]^{e_{1}} \ar[r]_{e_{2}} & A \ar[r]^{q} & Q}

is an exact sequence if q is the coequalizer of e_{1} and e_{2}, and e_{1}, e_{2} is the kernel pair of q.

We also call a diagram of the form

\xymatrix{E \ar[r]^{i} & A \ar[r]^{c_{1}} \ar[r]_{c_{2}} & D}

an exact sequence if i is the equalizer of c_{1} and c_{2} and c_{1}, c_{2} the cokernel pair of i.

Corollary 1.2.15. Let E be almost regular and let Γ:\xymatrix{E \ar[r] & E} preserve regular epis. Then U:\xymatrix{E^{Γ} \ar[r] & E} preserves and reflects regular epis, monos and exact sequences.

Proof. By Theorem 1.2.13 and uniqueness of regular epi-mono factorizations, U preserves regular epis and monos.

Because U preserves and reflects kernel pairs and regular epis, and regular epis are coequalizers of their kernel pairs, U preserves and reflects exact sequences. □

Remark 1.2.16. It is important to note that all of these theorems dualize for categories of coalgebras in an obvious way. Explicitly, if E is almost co-regular and Γ preserves regular monos, then E_{Γ} inherits epi-regular mono factorizations from E.

1.3. Subalgebras

We have a notion of subobject for any category: namely, a subobject of A is an equivalence class of monics with codomain A (see Appendix). This definition applies to the categories E^{Γ} and E_{Γ} to yield:

A subobject of a Γ-(co)algebra ⟨A, α⟩ is an equivalence class of monic homomorphisms

[figure: ⟨B, β⟩; ⟨A, α⟩] .

1.3. SUBALGEBRAS 23

In categories of algebras, we are most interested in those subobjects of ⟨A, α⟩ which are preserved by U. These can be understood as subobjects of A which are closed under the algebraic operations.

We postpone the discussion of subcoalgebras until Section 2.2. There, we take the position that subcoalgebras are best understood as the dual of quotients of algebras. Consequently, we are interested in regular subobjects of a coalgebra.

Definition 1.3.1. Let ⟨A, α⟩ be a Γ-algebra. A subalgebra of ⟨A, α⟩ is a subobject

i:[figure: ⟨B, β⟩; ⟨A, α⟩]

such that Ui:\xymatrix{B \ar[r] & A} is a subobject of A (Ui is a mono in E).

For each Γ-algebra, there are three related posets. First, there is the poset Sub_{E^{Γ}}(⟨A, α⟩). This consists of equivalence classes of monos

[figure: ⟨B, β⟩; i; ⟨A, α⟩]

in E^{Γ}. We also have the poset Sub_{E}(A) of subobjects of the carrier of ⟨A, α⟩. Lastly, we have the poset SubAlg(⟨A, α⟩) of subalgebras of ⟨A, α⟩. This poset has, as objects, equivalence classes of monos

[figure: ⟨B, β⟩; i; ⟨A, α⟩]

such that Ui is mono in E. Evidently,

SubAlg(⟨A, α⟩) ⊆ Sub_{E^{Γ}}(⟨A, α⟩).

In the categories in which we are most interested, this inclusion is an isomorphism.

Theorem 1.3.2. If E is almost regular and Γ preserves regular epis, then

SubAlg(⟨A, α⟩) ≅ Sub_{E^{Γ}}(⟨A, α⟩).

Proof. If Γ preserves regular epis, then U preserves monos (Corollary 1.2.15).

□

We note that any Set functor Γ preserves regular epis and so

SubAlg(⟨A, α⟩) ≅ Sub_{E^{Γ}}(⟨A, α⟩).

We turn our attention to the relationship between SubAlg(⟨A, α⟩) and Sub_{E}(A) (hereafter, denoted Sub(A)). In order to determine the structure of the category SubAlg(⟨A, α⟩), we look at the structure of Sub(A). We will show that SubAlg(⟨A, α⟩) inherits much of the structure of Sub(A). In order to make this clear, we define a functor

U_{α}:\xymatrix{SubAlg(⟨A, α⟩) \ar[r] & Sub(A)}.

This functor takes a subalgebra ⟨B, β⟩ to its carrier B as a subobject of A.

24 1. ALGEBRAS AND COALGEBRAS

Remark 1.3.3. The functor U_{α} is a component of a natural transformation between contravariant functors

U:\xymatrix{SubAlg \ar@{=>}[r] & Sub},

but we will not make use of this fact.

Theorem 1.3.4. The functor U_{α} is an injection. In particular, for any \xymatrix{B \ar[r]^{i} & A} = U⟨A, α⟩, there is at most one structure map β:\xymatrix{ΓB \ar[r] & B} making i a homomorphism.

Proof. Let ⟨B, β⟩ and ⟨C, γ⟩ be subalgebras of ⟨A, α⟩ and suppose

U_{α}(⟨B, β⟩) = U_{α}(⟨C, γ⟩).

Then B and C are equal as subobjects of A. Without loss of generality, assume B = C and let the inclusion be given by i:\xymatrix{B \ar[r] & A}. By assumption, i is a homomorphism, so

i ∘ β = α ∘ Γi = i ∘ γ,

so β = γ. □

Theorem 1.3.5. U_{α} creates meets. Thus, if Sub(A) is a complete lattice, then so is the category SubAlg(⟨A, α⟩).

Proof. This follows from the fact that U:\xymatrix{E^{Γ} \ar[r] & E} creates limits (Theorem 1.2.4). □

1.3.1. Subalgebras generated by a subset. Let ⟨A, α⟩ be a Γ-algebra and P a subobject of A (in E). In this section, we discuss the least subalgebra containing P, which we denote ⟨P ⟩_{α} or just ⟨P ⟩. As we will see, this subalgebra exists under fairly weak assumptions. We give two constructions of ⟨P ⟩. The first construction (Theorem 1.3.6) requires that Sub_{E}(A) is a complete lattice. The second construction requires that E is almost regular and Γ preserves regular epis. Further, we assume that the algebraic forgetful functor U:\xymatrix{E^{Γ} \ar[r] & E} is monadic (equivalently, U has a left adjoint). See Section 2.1.2 for a discussion of the left adjoint of U.

We understand the functor ⟨−⟩_{α} in terms of adjointness. Specifically, if each subobject P of A is contained in a least subalgebra ⟨P ⟩_{α} of ⟨A, α⟩, then we have an adjoint pair ⟨−⟩_{α} ⊣ U_{α} (dropping the subscript when convenient). We call the subalgebra ⟨P ⟩_{α} the subalgebra generated by P.

Theorem 1.3.6. Let ⟨A, α⟩ be a Γ-algebra and suppose that Sub(A) is a complete lattice (say, if E is complete and well-powered). Then the functor

U_{α}:\xymatrix{SubAlg(⟨A, α⟩) \ar[r] & Sub(A)}

has a left adjoint

⟨−⟩_{α}:\xymatrix{Sub(A) \ar[r] & SubAlg(⟨A, α⟩)}.

1.3. SUBALGEBRAS 25

Proof. We will explicitly construct ⟨−⟩. Let i:[figure: P; A] be a subobject of A. We take the intersection of all the subalgebras containing P,

⟨P ⟩ = ⋀_{P ⊆Q}⟨Q, ρ⟩.

□

The following theorem is an alternate construction of ⟨P ⟩ that applies in the categories in which we are most interested. We also include it because the resulting construction is very natural: ⟨P ⟩ arises as the factorization of

\xymatrix{F P \ar[r] & ⟨A, α⟩},

where F ⊣ U. See Section 2.1 for a discussion of such adjoint functors.

Theorem 1.3.7. Suppose E is almost regular, Γ preserves regular epis and that U has a left adjoint F (i.e., Γ is a varietor, in the sense of [AP01]. Let ⟨A, α⟩ be a Γ-algebra and P be a subobject of A. Then we have an adjoint pair

\xymatrix{Sub(A) \ar[rr]^{⟨−⟩_{α}} & ⊥ & SubAlg(⟨A, α⟩) \ar[ll]^{U_{α}}} .

Proof. Let ε be the counit of the adjunction F ⊣ U. Let i: [figure: P; A] be the inclusion of P into A and take the regular epi-mono factorization j ∘ p of ε_{α} ∘ F i, shown in Figure 4.

[figure: F Q; F k; F P; F l; p; F A; ε_{α}; ⟨Q, ν⟩; k; ⟨P ⟩; j; ⟨A, α⟩]

Figure 4. The construction of ⟨P ⟩ as a regular epi-mono factorization.

We first show that P ≤ U⟨P ⟩. It suffices to show that j ∘p∘η_{P} = i (see Figure 5). One calculates

j ∘ p ∘ η_{P} = Uε_{α} ∘ UF i ∘ η_{P}
= Uε_{α} ∘ η_{A} ∘ i = i.

The inequality P ≤ U⟨P ⟩ is the unit of the adjunction, of course.

[figure: UF P; p; P; η_{P}; i; U_{α}⟨P ⟩_{α}; j; A]

Figure 5. P is contained in U⟨P ⟩.

Let k:[figure: ⟨Q, ν⟩; ⟨A, α⟩] be a subalgebra of ⟨A, α⟩ and P ≤ Q (with inclusion l). We wish to show that ⟨P ⟩ ≤ ⟨Q, ν⟩. We have

k ∘ ε_{ν} ∘ F l = ε_{α} ∘ F k ∘ F l
= ε_{α} ∘ F j = j ∘ p,

and so, since p is strong, we have the factorization desired. □

As we will see, in the dual category E_{Γ}, given a coalgebra ⟨A, α⟩ and a subobject P ≤ A, the natural construction yields the greatest subcoalgebra contained in P. In other words, we have a right adjoint to the analogous forgetful functor

U_{α}:\xymatrix{SubCoalg(⟨A, α⟩) \ar[r] & Sub(A)}.

We discuss this adjoint pair in Section 2.2.

The adjoint pair ⟨−⟩_{α} ⊣ U_{α} gives rise to a closure operator

U_{α}⟨−⟩_{α}:\xymatrix{Sub(A) \ar[r] & Sub(A)}

on the subobjects of A. This operator takes a subobject P and closes it under the operations (structure map) of the algebra. The unit of the monad is the inclusion

P ≤ U_{α}⟨P ⟩_{α}.

The multiplication is the identity

U_{α}⟨U_{α}⟨P ⟩_{α}⟩_{α} = U_{α}⟨P ⟩_{α}.

As Theorem 1.3.5 showed, if Sub(A) is complete, then so is SubAlg(⟨A, α⟩). General results in order theory tell one how to define joins on SubAlg(⟨A, α⟩), but it is worth stating the result explicitly: Given a collection

{⟨B_{i}, β_{i}⟩}_{i∈I}

of subalgebras of ⟨A, α⟩, their join is given by

⋁⟨B_{i}, β_{i}⟩ = ⟨⋁ B_{i}⟩_{α}.

1.4. CONGRUENCES 27

1.4. Congruences

We generalize the notions introduced above to binary relations here. It should be clear that these notions generalize to n-ary relations, but we do not do so explicitly. Binary relations deserve special attention since they arise as the kernels of homomorphisms.

Recall that a relation on ⟨A, α⟩ and ⟨B, β⟩ is a triple ⟨⟨R, ρ⟩, r_{1}, r_{2}⟩ where

r_{1} :\xymatrix{⟨R, ρ⟩ \ar[r] & ⟨A, α⟩},
r_{2} :\xymatrix{⟨R, ρ⟩ \ar[r] & ⟨B, β⟩}

are jointly monic (see the Appendix for a brief review of relations). This definition works whether we are speaking of algebras or coalgebras, of course. Again, we will want to pay particular attention to those relations of E^{Γ} which are preserved by U. We postpone the discussion of relations in E_{Γ} until Section 2.5, where we introduce bisimulations.

Definition 1.4.1. Let ⟨A, α⟩ and ⟨B, β⟩ be Γ-algebras. A relation

⟨⟨R, ρ⟩, r_{1}, r_{2}⟩

on ⟨A, α⟩ and ⟨B, β⟩ is a pre-congruence if ⟨R, r_{1}, r_{2}⟩ is a relation on A and B.

Let PreCong(⟨A, α⟩, ⟨B, β⟩) be the poset of pre-congruences on ⟨A, α⟩ and ⟨B, β⟩. We will often abbreviate this category as PreCong(α, β). Again, we relate this category to the related posets of relations, Rel_{E^{Γ}}(α, β) and Rel_{E}(A, B).

We also often abbreviate the product of two (co)algebras,

⟨A, α⟩ × ⟨B, β⟩,

as α × β.

Theorem 1.4.2. If E is almost regular, has binary products and Γ preserves regular epis, then

PreCong(α, β) ≅ Rel_{E^{Γ}}(α, β) = Sub_{E}(α × β).

Proof. A relation ⟨R, ρ⟩ on ⟨A, α⟩ and ⟨B, β⟩ is a subalgebra of the algebra ⟨A, α⟩ × ⟨B, β⟩. Because U preserves both products and monos, we see that R is a subobject of A × B and hence a relation in E. Thus, R is a pre-congruence. □

In Section 1.3, we defined a forgetful functor taking subalgebras of ⟨A, α⟩ to their carrier as a subobject of A. We analogously define a forgetful functor here

U_{α,β}:\xymatrix{PreCong(α, β) \ar[r] & Rel(A, B)},

taking a pre-congruence ⟨R, ρ⟩ to its carrier R as a relation on A and B.

28 1. ALGEBRAS AND COALGEBRAS

In fact, U_{α,β} is just

U_{α×β}:\xymatrix{SubAlg(α × β) \ar[r] & Sub_{E}(A × B)}.

Thus, from Theorems 1.3.4 and 1.3.5, we have the following corollaries.

Corollary 1.4.3. The functor U_{α,β} is an inclusion of PreCong_{E^{Γ}}(α, β) into Rel_{E}(A, B). In other words, the structure map on an algebraic relation is unique.

Corollary 1.4.4. The functor U_{α,β} creates meets. Hence, if Rel(A, B) (that is, Sub(A × B)) is complete, then so is PreCong(α, β) (= SubAlg(α × β)).

Remark 1.4.5. Again, we have a natural transformation (natural in both components) between the contravariant bifunctors

U:\xymatrix{PreCong \ar@{=>}[r] & Rel}.

The functor

⟨−⟩_{α×β}:\xymatrix{Sub(A × B) \ar[r] & SubAlg(α × β)},

if it exists, gives a construction of least pre-congruences. That is, given any relation R on A and B (any subobject of A×B), ⟨R⟩_{α×β} is the least pre-congruence on ⟨A, α⟩ and ⟨B, β⟩ containing R (i.e., the least subalgebra of α × β containing R). When we view ⟨−⟩_{α×β} as a functor

\xymatrix{Rel(A, B) \ar[r] & PreCong(α, β)},

we will sometimes write ⟨−⟩_{α,β}. We drop the subscripts entirely if the meaning of ⟨−⟩ is clear from context.

We are often interested in pre-congruences on an algebra ⟨A, α⟩ by itself — that is, in the category PreCong(α, α). These pre-congruences can be viewed as sets of equations (see Remark 1.4.7), which will play a central role in Chapter 3. The following principle is useful for reasoning about ⟨R⟩_{α,α}.

Theorem 1.4.6. Let E be finitely complete, and Γ:\xymatrix{E \ar[r] & E} be given. Let ⟨A, α⟩ be a Γ-algebra and R a relation on A. Let f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} be a Γ-homomorphism. Then the following diagram (in E) commutes

\xymatrix{R \ar[r] \ar[r] & A \ar[r]^{f} & B} (1)

iff the diagram (in E^{Γ}) below commutes.

\xymatrix{⟨R⟩ \ar[r] \ar[r] & ⟨A, α⟩ \ar[r]^{f} & ⟨B, β⟩} (2)

Proof. If (2) commutes, then the fact that R is contained in U⟨R⟩ ensures that (1) commutes.

Suppose, conversely, that (1) commutes and take the kernel pair ⟨K, κ⟩ of f in E^{Γ}. Because the forgetful functor U:\xymatrix{E^{Γ} \ar[r] & E} creates kernel pairs, K is the kernel pair

1.4. CONGRUENCES 29

of f in E, so R is a subrelation of K. Since ⟨R⟩ is the least pre-congruence containing R, ⟨R⟩ is contained in ⟨K, κ⟩. Thus, f coequalizes \xymatrix{⟨R⟩ \ar[r] \ar[r] & ⟨A, α⟩} . □

Remark 1.4.7. Let ⟨A, α⟩ and R be given as in the statement of Theorem 1.4.6. We can view R as a set of equations on A — namely, R corresponds to the set of equations

{r_{1}(x) = r_{2}(x) | x ∈ R}.

We say that B satisfies the equations in R under the assignment f if f equalizes r_{1} and r_{2}. That is,

B, f ⊧_{A} R

just in case the diagram

\xymatrix{R \ar[r] \ar[r] & A \ar[r]^{f} & B}

commutes.

In these terms, we can restate Theorem 1.4.6 as follows: For any homomorphism

f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩},

B, f ⊧_{A} R iff ⟨B, β⟩, f ⊧_{⟨A, α⟩} ⟨R⟩.

See Chapter 3 for a proper development of equations for categories E^{Γ}.

1.4.1. Exact categories of algebras. Throughout this section, we assume that E is finitely complete and has regular epi-mono factorizations, so that E is, in particular, “almost regular”. We also assume that Γ:\xymatrix{E \ar[r] & E} preserves regular epis, so that E^{Γ} inherits regular epi-mono factorization from E (Theorem 1.2.13).

A congruence is a pre-congruence which is an equivalence relation. Because precongruences are relations in two different categories (both E^{Γ} and E), there is apparent ambiguity in this definition. We will show that the ambiguity is illusory — a precongruence which is an equivalence relation in E is also an equivalence relation in E^{Γ}, and vice versa.

Because U:\xymatrix{E^{Γ} \ar[r] & E} creates limits and regular epi-mono factorizations, one has the following theorem.

Theorem 1.4.8. The forgetful functor U_{α,β} preserves the following structure of PreCong(α, β).

(1) For any composable pre-congruences ⟨R, ρ⟩ ∈ PreCong(α, β) and ⟨S, σ⟩ ∈ PreCong(β, γ),

U_{α,γ}(⟨S, σ⟩ ∘ ⟨R, ρ⟩) = S ∘ R.

(2) For any pre-congruence ⟨R, ρ⟩ on ⟨A, α⟩ and ⟨B, β⟩,

U_{β,α}(⟨R, ρ⟩^{0}) = R^{0}

(where R^{0} is the twist of relation R — see the Appendix).

30 1. ALGEBRAS AND COALGEBRAS

(3) For any algebra ⟨A, α⟩,

U_{α,α}Δ_{⟨A, α⟩} = Δ_{A}

(where Δ_{A} is equality on A — see the Appendix).

Proof. 2 and 3 are obvious. For the first, we use the fact that U creates pullbacks and finite regular epi-mono source factorizations. It creates the latter because it creates regular epi-mono factorizations and products (and because E has finite products). □

Definition 1.4.9. A pre-congruence on ⟨A, α⟩ which is also an equivalence relation is a congruence.

The following corollary shows that it is enough for ⟨R, ρ⟩ to be a pre-congruence such that R is an equivalence relation (in E).

Corollary 1.4.10. Let ⟨A, α⟩ be a Γ-algebra and let ⟨R, ρ⟩ be a pre-congruence. Then ⟨R, ρ⟩ is a congruence iff R is an equivalence relation in E.

Proof. By Theorem 1.4.8 and the fact that U_{α,α} is full. □

The remainder of the section is intended to give an example of reasoning about algebras in a categorical setting. We present a generalization of a standard theorem in the study of universal algebras. It states that one can take coequalizers of congruences in E^{Γ} (i.e., that E^{Γ} is exact — see Definition A.4.4). We will prove that this theorem holds in a variety of categories and for a variety of functors — namely, it holds in any exact category if the endofunctor Γ preserves exact sequences. The standard theorem about algebras over Set is an easy corollary.

Theorem 1.4.11. Let E be an exact category with binary products and Γ:\xymatrix{E \ar[r] & E} preserve exact sequences (coequalizers of kernel pairs). The category E^{Γ} is also exact.

Proof. Let p be a regular epi in E. Take the kernel pair of p,

\xymatrix{• \ar[r] \ar[r] & • \ar@{|->}[r]^{p} & •.}

Since Γ preserves exact sequences, we see that Γp is again a regular epi, so Γ preserves all regular epis. Hence, U preserves and reflects monos, regular epis and exact sequences (Theorem 1.2.15 — note that any regular category has regular epi-mono factorizations [Bor94, Proposition 2.2.1]).

Let

\xymatrix{⟨R, ρ⟩ \ar[r] \ar[r] & ⟨A, α⟩}

be an equivalence relation in E^{Γ}. Since

PreCong(⟨A, α⟩) ≅ Rel_{E^{Γ}}(⟨A, α⟩),

⟨R, ρ⟩ is a congruence, and so R is an equivalence relation in E. Since E is exact and R is an equivalence relation, R is the kernel pair of a regular epi q, as shown below.

\xymatrix{R \ar[r] \ar[r] & A \ar@{|->}[r]^{q} & Q}

This diagram is an exact sequence (in an exact category, an equivalence relation is always the kernel pair of its coequalizer), so its image under Γ is again an exact sequence.

Hence, the top row of the diagram below is a coequalizer.

\xymatrix{ΓR \ar[r] \ar[r] \ar[d]_{ρ} & ΓA \ar[d]_{α} \ar@{|->}[r]^{Γq} & ΓQ \ar@{.>}[d]^{ν} \\ R \ar[r] \ar[r] & A \ar@{|->}[r]_{q} & Q}

A simple diagram chase shows that there is a unique ν making the right hand square commute. Because U reflects regular epis, q is a regular epi in E^{Γ}. □

Theorem 1.4.12. Let E be a exact category with binary products and suppose E satisfies the weak axiom of choice. The category E^{Γ} is also exact.

Proof. It is easy to show that every exact sequence is an absolute coequalizer (see the proof of [Bor94, Volume 2, Theorem 4.3.5], for instance), and so is preserved by every functor. □

1.4.2. Least congruence constructions. Given an algebra ⟨A, α⟩ and a relation R on A, one is often interested in the least congruence \overline{R} containing R. These is the least relation on A such that the quotient A/\overline{R} can be taken in E^{Γ}. In this section, we will show that, if E is exact with binary products and Γ preserves exact sequences, then we can define a functor

\xymatrix{Rel(A, A) \ar[r] & Cong(α)}

(where Cong(α) is the category of congruences on ⟨A, α⟩) taking a relation to its least congruence. This material is included just to complete our development of congruences. It is a well-known result.

Theorem 1.4.13. Let E be exact, with binary products, and Γ preserve exact sequences (and, hence, regular epis). Then the inclusion functor

U_{α,α}:\xymatrix{Cong(α) \ar[r] & Rel(A, A)}

has a left adjoint.

32 1. ALGEBRAS AND COALGEBRAS

Proof. We know from Theorem 1.4.11 that E^{Γ} is exact. We construct a functor K:\xymatrix{PreCong(α, α) \ar[r] & Cong(α)}, left adjoint to the evident inclusion functor. This construction works in any exact category, just by taking a relation to the kernel pair of its coequalizer. Now, given a relation R on A and a congruence ⟨S, σ⟩ on ⟨A, α⟩, we see that

R ≤ S ⇔ ⟨R⟩ ≤ ⟨S, σ⟩ ⇔ K⟨R⟩ ≤ ⟨S, σ⟩.

□

1.5. Initial algebras and final coalgebras

In categories of algebras and coalgebras, the presence of initial objects and terminal objects, respectively, plays an important role. Initial algebras satisfy the induction proof principle and definition by recursion, while final coalgebras enjoy the analogous principles of coinduction and definition by corecursion. In this section, we discuss these principles and the nature of initial algebras and final coalgebras as least and greatest fixed points, respectively, for the endofunctor Γ.

Recall that in a category C, an initial object A is an object such that, for any Y ∈ C, there is exactly one arrow \xymatrix{A \ar[r] & Y} . Dually, a final or terminal object Z has the property that each Y ∈ C has exactly one arrow \xymatrix{Y \ar[r] & Z} . Any two initial (final) objects are clearly isomorphic. If C is a poset, then an initial object is just ⊥ and a final object is just ⊤.

For algebras, the initial algebra is an important object, coming equipped with certain “proof principles”. However, the final algebra is typically dull. If E has a final object, 1, then, for any functor Γ, there is a final Γ-algebra, namely ⟨1, !_{1}⟩, where !_{1} is the unique map \xymatrix{Γ1 \ar[r] & 1}. This is a corollary to the fact that U creates limits (Theorem 1.2.4). For Set, for example, this means that the one point algebra is always the final algebra. Dually, if E has an initial object, 0, then ⟨0, !_{0}⟩ is the initial coalgebra, where !_{0} :\xymatrix{0 \ar[r] & Γ0}. In Set, then, the empty coalgebra is always the initial coalgebra (whatever the endofunctor Γ:\xymatrix{Set \ar[r] & Set}).

1.5.1. Fixed points for a functor. Given a functor Γ:\xymatrix{E \ar[r] & E}, we can consider the collection of fixed points of Γ, i.e., those C ∈ E such that ΓC ≅ C. Such objects can be regarded as both Γ-algebras and Γ-coalgebras. Let Fix(Γ) be the full subcategory of E^{Γ} consisting of those algebras for which the structure map is an isomorphism. Equivalently, we could take the same full subcategory of E_{Γ}, since Γ algebra homomorphisms between fixed points are Γ coalgebra homomorphisms and vice-versa. Lambek’s lemma [Lam70] states, first, that the initial algebra (final coalgebra), if it exists, is in Fix(Γ). It easily follows that the initial algebra is also

\xymatrix{ΓA \ar[d]_{α} \ar[r]^{Γ!} & Γ^{2}A \ar[r]^{Γα} \ar[d]_{Γα} & ΓA \ar[d]^{α} \\ A \ar[r]_{!} & ΓA \ar[r]_{α} & A}

Figure 6. Initial algebras are fixed points.

initial in Fix(Γ), and the final coalgebra is final in Fix(Γ) (See Section 1.5.4 for a discussion of the unique homomorphism between the two).

Lemma 1.5.1 (Lambek’s lemma). If ⟨A, α⟩ is an initial Γ-algebra, then α is an isomorphism. Dually, the structure map of a final coalgebra is also an isomorphism.

Proof. Because ⟨A, α⟩ is initial, there is a unique homomorphism ! from ⟨A, α⟩ to the algebra

⟨ΓA, Γα:\xymatrix{Γ^{2}A \ar[r] & ΓA}⟩.

In Figure 6, the bottom composite is the identity, by the uniqueness condition for initiality. Because ! is a Γ-homomorphism, the left hand square commutes. Consequently,

! ∘ α = Γα ∘ Γ! = id_{ΓA} .
□

This result brings out a central fact about initial algebras/final coalgebras — namely, they are the same thing as initial fixed points/final fixed points for an endofunctor. In many cases (though, not all cases), they are in fact least fixed points/greatest fixed points for the endofunctor in the usual sense. In this respect, at least, initial algebras should seem familiar objects of study. Languages specified by a syntax are given as a least fixed point for an endofunctor on Set, for instance. In particular, the modal language L(AtProp) was described earlier as a least fixed point. Hence, we may regard this and similar languages as initial algebras for suitable functors.

Lambek’s lemma also gives us a negative result regarding initial algebras and final coalgebras. If a functor has no fixed points, then it has no initial algebra or final coalgebra. Of course, the power set functor, P:\xymatrix{Set \ar[r] & Set}, has no fixed points (due to Cantor’s theorem). Consequently, there is no initial algebra/final coalgebra for this functor as a functor on Set.

However, there is a closely related functor for which the initial algebra and final coalgebra both exist and are well known. Consider the category SET of all sets and classes (without the axiom of foundation). We can extend the functor P to a

34 1. ALGEBRAS AND COALGEBRAS

functor (also denoted P) on this category taking each class to its class of subsets (note: subsets, not subclasses). See [BM96] for details on the extension of set-based functors to the category SET. The initial algebra for this functor is the class WF of well-founded sets, with identity as the structure map. The final coalgebra for this functor is NWF, the category of sets with the anti-foundation axiom, again with identity as the structure map. For additional reading on fixed points for P, see [BM96], [Acz88] and [Tur96].

For existence theorems for both initial algebras and final coalgebras, see [Bar92]. James Worrell extends this discussion in [Wor00].

1.5.2. Induction and recursion. See also [JR97] for a nice exposition of this material.

The principle of definition by recursion is an explicit application of the property of initiality. Given any Γ-algebra ⟨B, β⟩, there is a unique homomorphism from the initial Γ-algebra ⟨I, ι⟩ to ⟨B, β⟩ (just by definition of initiality). This categorical property leads to familiar principles in application.

Example 1.5.2. For instance, consider the successor functor S:\xymatrix{Set \ar[r] & Set} taking a set X to the set X + 1 (the disjoint union of X and {∗}). The initial algebra for this functor is ⟨ℕ, [s, 0]⟩, where

s(n) = n + 1,
0(∗) = 0.

Indeed, the initial algebra for S in any category with + is called the natural numbers object (NNO).

To justify this terminology, consider the usual statement of definition by recursion on ℕ. Namely, given any set A together with an element a ∈ A and a map f:\xymatrix{A \ar[r] & A}, there is a unique map !:\xymatrix{ℕ \ar[r] & A} such that

!(0) = a,
!(n + 1) = f(!(n)).

(We’ll ignore the apparently stronger statement of definition by recursion with parameters for now.) But, specifying a and f is just the same as specifying a map

[f, a]:\xymatrix{A + 1 \ar[r] & A}.

Also, the equations above exactly require the diagram below

\xymatrix{ℕ + 1 \ar[d]_{[s,0]} \ar[r]^{!+id} & A + 1 \ar[d]^{[f,a]} \\ ℕ \ar[r]_{!} & A}

to commute, i.e., require that ! is an S-homomorphism.

Example 1.5.3. In Example 1.5.2, we showed that the statement that ℕ is an initial algebra for the successor functor is equivalent to the statement that for each a ∈ A and f:\xymatrix{A \ar[r] & A}, there is a unique map !:\xymatrix{ℕ \ar[r] & A} such that

!(0) = a,
!(n + 1) = f(!(n)).

Of course, one usually wants to define more complicated functions recursively. In this example, we will show that the statement that ℕ is an initial algebra for S allows the recursive definition of functions with parameters. Specifically, given two functions,

g:\xymatrix{A \ar[r] & A}, and
h:\xymatrix{A × A \ar[r] & A}

we will show that there exists a unique f:\xymatrix{ℕ × A \ar[r] & A} such that

(3)  f(0, a) = g(a),
(4)  f(s(n), a) = h(f(n, a), a).

Initiality guarantees maps with domain ℕ, so we will define a map f̃:\xymatrix{ℕ \ar[r] & A^{A}} and show that its transpose is the map f we desire. To define such a f̃ by recursion, we must find a structure map α:\xymatrix{A^{A} + 1 \ar[r] & A^{A}} such that the unique homomorphism \xymatrix{ℕ \ar[r] & A^{A}} , guaranteed by initiality, is the f̃ we desire.

Let α be defined by

α(∗) = g:\xymatrix{A \ar[r] & A},
α(k) = λa . h(k(a), a)  for all k:\xymatrix{A \ar[r] & A}.

Then, by initiality, there is a unique f̃ such that

f̃(0) = g,
f̃(n + 1) = λa . h(f̃(n)(a), a).

Consequently, the transpose of f̃ satisfies (3) and (4).

In a similar manner, we can show that there is a unique f:\xymatrix{ℕ \ar[r] & A} such that

f(0, a) = g(a),
f(s(n), a) = h(f(n, a), n, a).

For this, we must define a structure map α for (A × ℕ)^{A} so that the unique map f̃ making the square below commute

\xymatrix{ℕ + 1 \ar[r]^{f̃+id_{1}} \ar[d]_{[s,0]} & (A × ℕ)^{A} + 1 \ar[d]^{α} \\ ℕ \ar[r]_{α} & (A × ℕ)^{A}}

satisfies the appropriate equations. This is left as an exercise for the reader.

Example 1.5.4. In the category Poset, the natural numbers object (initial algebra for S) is again the algebra ⟨ℕ, [s, 0]⟩. As a poset, we take the trivial ordering: x ≤ y iff x = y.

The natural numbers with the standard ordering (which we denote ω) is also an initial algebra in Poset, but for a different functor. Consider the lifting functor −_{⊥}:\xymatrix{Poset \ar[r] & Poset} that takes a poset and adjoins a new bottom element. The initial algebra for this functor is ω. The structure map

\xymatrix{ω_{⊥} \ar[r] & ω}

takes ⊥ to 0 and takes each n ∈ ω to s(n).

Example 1.5.5. Example 1.5.2 shows that ℕ is an initial algebra for the polynomial functor S. Here, we examine the general case.

Let ℙ be a polynomial functor and define a signature Σ so that ℙ is the polynomial functor for Σ, i.e., so that

ℙ(A) = ∐_{f^{(n)}∈Σ} A^{n}.

Let L(Σ) be the collection of all Σ-terms. Explicitly, L(Σ) is the least set such that the following holds:

• If f^{(n)} ∈ Σ and τ_{1}, …, τ_{n} ∈ L(Σ), then f^{(n)}(τ_{1}, …, τ_{n}) ∈ L(Σ). Of course, this entails in particular that any constants (that is, zero-ary function symbols) of Σ are in L(Σ). One should also notice that, if Σ has no constants, then L(Σ) is empty.

We impose an algebraic structure on L(Σ) in the obvious manner. For each f^{(n)} ∈ Σ, we must define a map

\xymatrix{L(Σ)^{n} \ar[r] & L(Σ)} .

Let τ_{1}, …, τ_{n} be in L(Σ) and define the interpretation of f^{(n)} to be

⟨τ_{1}, …, τ_{n}⟩ ↦ f(τ_{1}, …, τ_{n}).

It is routine to check that L(Σ) together with this structure map is an initial ℙalgebra.

1.5. INITIAL ALGEBRAS AND FINAL COALGEBRAS 37

There is another description of the initial ℙ-algebra. Namely, we consider L(Σ) as a family of finitely branching, Σ-labeled trees, subject to the condition:

• If a node is labeled f^{(n)}, then the node has exactly n children (consequently,

a node labeled with a constant c^{(0)} is a leaf). We have, then, that L(Σ) is the least collection of trees such that

• For each f^{(n)} ∈ Σ and each τ_{1}, …, τ_{n} ∈ L(Σ), the tree with root labeled f^{(n)}

and with children τ_{1}, …, τ_{n} is in L(Σ).

Again, we stress that, in particular, for each constant c^{(0)} in Σ, the tree consisting of a node (with no children) labeled c^{(0)} is in L(Σ).

Example 1.5.6. We show now that ⟨Z^{<ω}, [push, ()]⟩ is an initial algebra for ΓA = Z ×A+1 (see Example 1.1.6). Let ⟨A, ⟨∗_{α}, ()_{α}⟩⟩ be any Γ-algebra. Define a sequence of maps !^{n}:\xymatrix{Z^{n} \ar[r] & A} as follows:

!^{0}(()) = ()_{α},
!^{n+1}(push(z, σ)) = z∗_{α}!(σ).

We take !:\xymatrix{Z^{<ω} \ar[r] & A} to be ⋃_{i=1}^{ω}!^{n}. It is easy to see that ! is a Γ-homomorphism and that it is unique.

The principle of definition by Γ-recursion can thus be stated: For any set A, element a ∈ A and map f:\xymatrix{Z × A \ar[r] & A}, there is a unique !:\xymatrix{Z^{ω} \ar[r] & A} such that

!(()) = a,
!(push(z, σ)) = f(z,!(σ)).

We also have a least fixed point definition of Z^{<ω}, arising from the discussion of Section 1.5.1. Namely, Z^{<ω} is the least collection such that

• () ∈ Z^{<ω};

• If z ∈ Z and σ ∈ Z^{<ω}, then push(z, σ) ∈ Z^{<ω}.

This description of Z^{<ω} agrees with the description of an initial algebra for a polynomial functor from Example 1.5.5 (allowing that the terms are interpreted as elements of Z^{<ω}).

This concludes our discussion of recursion. We now turn to the related property of induction.

The principle of induction allows one to conclude that a particular property P holds of all of the elements of an initial algebra if P is closed under the operations of the algebra. We will show in this section how the principle of induction is a minimality condition which follows from initiality. We will include some explicit examples of how the minimality condition leads to a familiar induction principle.

Lemma 1.5.7. Let ⟨I, ι⟩ be an initial Γ-algebra. Then any map into ⟨I, ι⟩ is a regular epi.

Proof. Let f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨I, ι⟩} be given and let !:\xymatrix{⟨I, ι⟩ \ar[r] & ⟨A, α⟩} be the homomorphism guaranteed by initiality. Then, by the uniqueness part of initiality, f∘! is the identity, so f is a regular epi. □

As one can see, Lemma 1.5.7 is not about initial algebras, per se, but rather is true of any initial object in any category. The next theorem is an abstract statement of the principle of induction. Again, it is a corollary to a general statement about initial objects.

Theorem 1.5.8. If ⟨I, ι⟩ is an initial Γ-algebra, then ⟨I, ι⟩ is minimal, i.e.,

Sub_{E^{Γ}}(⟨I, ι⟩) = {⟨I, ι⟩}.

So, in particular, ⟨I, ι⟩ has no proper subalgebras (subobjects preserved by U).

Proof. Let ⟨P, ρ⟩ be a subobject of ⟨I, ι⟩, with homomorphic inclusion

i:\xymatrix{⟨P, ρ⟩ \ar[r] & ⟨I, ι⟩}.

By Lemma 1.5.7, i is a regular epi and so is an isomorphism. □

Let ⟨A, α⟩ be an algebra. We say that a subobject [figure: P; i; A] of A is closed under α if there is a structure map

ρ:\xymatrix{ΓP \ar[r] & P}

such that

i:\xymatrix{⟨P, ρ⟩ \ar[r] & ⟨A, α⟩}

is a homomorphism. In other words, P is closed under α just in case

P = U_{α}⟨P ⟩_{α}

(that is, P is closed under the closure operator U_{α}⟨−⟩_{α}). The property of minimality ensures that any predicate closed under α exhausts the entire algebra. It is useful to see a couple of explicit examples.

We also say that a subobject P closed under α is an inductive predicate.

Remark 1.5.9. The category of all subobjects of A closed under α is isomorphic to SubAlg(⟨A, α⟩), so we aren’t really introducing a new concept here. Instead, we introduce new language that allows one to see that the principle of induction for initial algebras is the usual principle of induction for the familiar examples of initial algebras. When discussing induction, it is conventional to speak of predicates which are closed under certain operations, rather than to speak of subalgebras. We follow that convention, although there is no practical difference between the two.

1.5. INITIAL ALGEBRAS AND FINAL COALGEBRAS 39

Example 1.5.10. As discussed in previously, ⟨ℕ, [s, 0]⟩ is an initial algebra for the successor functor S. A subset P of ℕ is closed under [s, 0] just in case there is a ρ:\xymatrix{P + 1 \ar[r] & P} making the diagram below commute.

\xymatrix{P + 1 \ar[r]^{i+id_{1}} \ar[d]_{ρ} & ℕ + 1 \ar[d]^{[s,0]} \\ P \ar[r]_{i} & ℕ}

This means that

i ∘ ρ(∗) = 0,
i ∘ ρ(n) = s(n) for each n ∈ P .

In other words, P is a subalgebra of ℕ just in case 0 ∈ P and whenever n ∈ P, also s(n) ∈ P. From Theorem 1.5.8, we see that if P contains 0 and is closed under s, then P = ℕ. So, Theorem 1.5.8 yields induction on the natural numbers in the usual sense.

Example 1.5.11. Consider again the initial algebra L(Σ) for a fixed signature Σ (see Example 1.5.5). One can confirm that minimality on L(Σ) entails the following proof principle: If, for each f^{(n)} ∈ Σ

∀τ_{1}, …, τ_{n}(Φ(τ_{1}) ∧ … ∧ Φ(τ_{n})) → Φ(f(τ_{1}, …, τ_{n})),

then Φ(τ) for all τ ∈ Σ. Note that, as usual, if a predicate Φ is closed under function application, then, in particular, Φ holds for every constant.

Call a tree well-founded if the relation “is a descendant of” is well-founded in the usual sense — that is, if there are no infinite paths in the tree. Then, one can show, using the above principle of induction, that every element of L(Σ) (viewed as trees — see Example 1.5.5) is well-founded. We omit this proof, since it requires a more explicit representation of trees than we give here.

Example 1.5.12. Let P ⊆ Z^{<ω}. Then, P is inductive just in case

() ∈ P,
push(z, σ) ∈ P  if z ∈ Z and σ in P.

If P satisfies these conditions, then P = Z^{<ω}.

Example 1.5.13. As mentioned previously, the class WF of well-founded sets with identity is an initial algebra for the functor P:\xymatrix{SET \ar[r] & SET}. It is useful to see what the principal of induction yields for this algebra. A predicate on WF is a subclass of WF. A predicate Φ is inductive iff whenever Φ(S) for all S ∈ T, then

40 1. ALGEBRAS AND COALGEBRAS

Φ(T). Thus, induction says, for each predicate Φ,

∀T (∀S ∈ T Φ(S) → Φ(T)) → ∀T Φ(T),

where the quantifiers here range over WF. Equivalently, we have, for each Φ,

∃T Φ(T) → ∃T (Φ(T) ∧ ∀S ∈ T ¬Φ(S)).

In other words, the principle of induction on WF as an initial algebra is the usual foundation axiom. Put another way, the foundation axiom is equivalent to the assumption that the class of all sets is an initial algebra for P (although here, we’ve only shown one implication — see [Tur96] for the other).

It is worth mentioning that the property of minimality isn’t unique to initial algebras. On the contrary, any algebra which is a quotient of the initial algebra is also minimal, and so satisfies an inductive proof principle. Conceptually, if ⟨A, α⟩ is a quotient of the initial algebra, then each element of A can be picked out by a term (not necessarily uniquely). So, if the atomic elements (the interpretations of constants) satisfy a predicate and if the predicate is closed under term formation, then all of A satisfies the predicate.

Theorem 1.5.14. Let E be almost regular and Γ preserve regular epis and suppose that E^{Γ} has an initial object ⟨I, ι⟩. An algebra ⟨A, α⟩ is minimal iff the map !:\xymatrix{⟨I, ι⟩ \ar[r] & ⟨A, α⟩} is a regular epi.

Proof. Suppose ⟨A, α⟩ is minimal. Take the regular epi-mono factorization ! = i ∘ p. Then i is an isomorphism and so ! is a regular epi.

On the other hand, suppose that

!:\xymatrix{⟨I, ι⟩ \ar@{|->}[r] & ⟨A, α⟩}

is a regular epi and

i:[figure: ⟨P, ρ⟩; ⟨A, α⟩]

is a mono. Then i∘!_{ρ} =!_{α}, so i is a regular epi and hence an isomorphism. □

Corollary 1.5.15. Let E, Γ be as in Theorem 1.5.14. If ⟨A, α⟩ is minimal, then α is a regular epi.

Proof. Since α ∘ Γ! =! ∘ ι and the right hand side is the composite of two regular epis (ι is an isomorphism), α is a regular epi. □

Remark 1.5.16. The converse of Corollary 1.5.15 does not generally hold. That is, if α is a regular epi, then ⟨A, α⟩ need not be minimal. Let ⟨F, ϕ⟩ be the final Γ-coalgebra. Then ⟨F, ϕ^{−1}⟩ is a Γ-algebra in which the structure map is a regular epi. Typically, however, ⟨F, ϕ^{−1}⟩ is not minimal. Indeed, it is common that the initial algebra is a proper subalgebra of ⟨F, ϕ^{−1}⟩.

1.5. INITIAL ALGEBRAS AND FINAL COALGEBRAS 41

1.5.3. Corecursion and coinduction. Dually, the unique homomorphism into the final coalgebra is said to be defined by corecursion. Definition by corecursion resembles a kind of “baseless recursion”. However, it is important to keep in mind that corecursion gives a map into, not out of, the final coalgebra.

Example 1.5.17. In Example 1.5.2, we showed that ℕ forms an initial algebra for S. We can also describe the final coalgebra for the successor functor S. Take ℕ and adjoin a point ∞. Call this set \overline{ℕ}. Define a S-coalgebra structure p:\xymatrix{\overline{ℕ} \ar[r] & \overline{ℕ} + 1} on \overline{ℕ} by

p(x) = \begin{cases}∗ & if x = 0 \\ n & if x = n + 1 \\ ∞ & if x = ∞. \end{cases}

The intuition here is that p is the predecessor function, taking ∞ to itself, n + 1 to n and 0 to the “error condition”, ∗.

If ⟨A, α⟩ is any S-coalgebra, then we define !:\xymatrix{A \ar[r] & \overline{ℕ}} by

!(a) = \begin{cases}μn . α^{n}(a) = ∗ & if this is defined \\ ∞ & else \end{cases}

The proof that ! is a coalgebra homomorphism and that it is unique is left to the reader. It is worth noting that \overline{ℕ} is not the greatest fixed point for S (under inclusion). Of course, S doesn’t have a greatest fixed point, since any infinite set is a fixed point.

Example 1.5.18. Just as ω is an initial algebra for the lifting functor

−_{⊥}:\xymatrix{Poset \ar[r] & Poset},

ω + 1 is the final coalgebra for ⊥. Similarly, the set \overline{ℕ} is the final coalgebra for S.

Example 1.5.19. In Example 1.1.7, we claimed that coalgebras for the functor ΓA = Z × A could be regarded as collections of infinite streams over Z. Here, we will make precise what we meant by that claim. We first take the collection of Z-streams, Z^{ω}, and impose a coalgebraic structure on it. Specifically, we consider the coalgebra ⟨Z^{ω}, ⟨h, t⟩⟩, where

h(σ:\xymatrix{ω \ar[r] & Z}) = σ(0),
t(σ:\xymatrix{ω \ar[r] & Z}) = λn . σ(n + 1).

Let ⟨A, ⟨h_{α}, t_{α}⟩⟩ be a Γ-coalgebra. We define a mapping,

!:\xymatrix{A \ar[r] & Z^{ω}} ,

as in Example 1.1.7, by

a ↦ λn . h_{α} ∘ t_{α}^{n}(a).

42 1. ALGEBRAS AND COALGEBRAS

Then one can easily confirm that ! is a homomorphism. Furthermore, any map f:\xymatrix{A \ar[r] & Z^{ω}} satisfying

h_{α}(a) = h(f(a)),
f(t_{α}(a)) = t(f(a)).

must agree with !.

The principle of definition by Γ-corecursion can be stated thus: Given any set A and any pair of maps,

j:\xymatrix{A \ar[r] & Z},
k:\xymatrix{A \ar[r] & A},

there is exactly one map !:\xymatrix{A \ar[r] & Z^{ω}} such that, for all a ∈ A,

j(a) = h(!(a)),
!(k(a)) = t(!(a)).

Remark 1.5.20. We have not discussed the initial algebra for A ↦ Z × A. There is good reason for this: it is trivial. That is, the initial algebra for this functor is just the algebra

⟨0, [figure: Z × 0; 0] ⟩.

Example 1.5.21. In Example 1.5.19, we made precise the claim that each coalgebra for A ↦ Z × A could be considered a collection of streams over Z, as mentioned in Example 1.1.7. In this example, we will clarify the claim of Example 1.1.8, that every coalgebra for the functor ΓA = Z × A + 1 can be regarded as a collection of (finite and infinite) streams over Z. In particular, we will impose a coalgebraic structure on Z^{≤ω} and prove that the resulting coalgebra is final.

We define ζ:\xymatrix{Z^{≤ω} \ar[r] & Z × Z^{≤ω} + 1} by

ζ(σ) = \begin{cases}∗ & if σ ∈ Z^{0} (i.e., σ = ():\xymatrix{∅ \ar[r] & Z}) \\ ⟨σ(0), λn . σ(n + 1)⟩ & else \end{cases}

Notice that, if σ ∈ Z^{ω}, then λn . σ(n + 1) ∈ Z^{ω}, but if σ ∈ Z^{n+1}, then λn . σ(n + 1) ∈ Z^{n}. In other words, if σ ∈ Z^{ω}, then the “tail” of σ is again in Z^{ω}, while if σ ∈ Z^{n+1}, then the tail of σ is in Z^{n}.

Let ⟨A, α⟩ be any Γ-coalgebra. We define h_{α} and t_{α} as π_{1} ∘ α and π_{2} ∘ α, when these are defined. We define a map !:\xymatrix{A \ar[r] & Z^{≤ω}} by

!(a) = \begin{cases}() & if α(a) = ∗ \\ λn . h_{α} ∘ t_{α}^{n}(a) & else. \end{cases}

1.5. INITIAL ALGEBRAS AND FINAL COALGEBRAS 43

Notice that, in the second case, the resulting function may be defined only for certain n. More precisely, !(a) may as a function whose domain is an initial segment of ω, i.e., an element of Z^{n} for some n.

We omit the details of confirming that ! is a homomorphism and that it is unique.

Example 1.5.22. Let ℙ be a polynomial functor,

ℙ(A) = ∐_{i<ω} Z_{i}A^{i}

on the category Set. From Example 1.5.11, we saw that the initial algebra for ℙ can be viewed as a collection of well-founded labeled trees. The final coalgebra can similarly be viewed as the collection of all labeled trees (well-founded or not) with the same branching behavior as the initial algebra. To make this description precise, one needs a model of this collection of trees. While such a model can be described as a collection of sets of finite sequences, representing paths through the tree, closed under appropriate conditions, the details of such a description are more technical than illuminating and will be skipped here.

Alternatively, one could use Aczel’s non-well-founded set theory to describe the final coalgebra as the (necessarily unique) set T such that

T = ℙ(T),

and use the identity as the structure map, an approach made popular by [BM96].

The dual of the principle of induction for initial algebras is that final coalgebras are coalgebra!simple, i.e., that they have no proper quotients. This property is best expressed as a property about the relations on final coalgebras.

Remark 1.5.23. In fact, final coalgebras satisfy a stronger condition. If ⟨A, α⟩ is a final Γ homomorphism and

p:\xymatrix{⟨A, α⟩ \ar@{->>}[r] & ⟨B, β⟩}

is any (not necessarily regular) epi, then p is an isomorphism. We find that the condition of simplicity suffices for most of our purposes, however, and use it instead.

Just as any quotient of a minimal algebra is again minimal, any subcoalgebra of a simple coalgebra is again simple. Furthermore, if there is a final Γ-coalgebra ⟨F, ϕ⟩, then any simple coalgebra is a (regular) subobject of ⟨F, ϕ⟩, as the following corollary shows. Hence, a coalgebra ⟨A, α⟩satisfies the principle of coinduction iff ⟨A, α⟩is simple iff ⟨A, α⟩is an open object of E_{Γ}, in the sense of [LM92, Chapter IV.6].

44 1. ALGEBRAS AND COALGEBRAS

Corollary 1.5.24. Let E be almost co-regular factorizations and Γ preserve regular monos and let ⟨F, ϕ⟩ be the final Γ-coalgebra. A coalgebra ⟨A, α⟩ is simple iff !:\xymatrix{⟨A, α⟩ \ar[r] & ⟨F, ϕ⟩} is a regular mono.

Proof. This is the dual of Theorem 1.5.14. □

Typically, we view coinduction as a proof principle that says, if two elements of a simple coalgebra are related by a coalgebraic relation, then they are equal. This next theorem is a step to that proof principle, which we return to in Section 2.6.

Theorem 1.5.25. Let E have all coequalizers. The following are equivalent:

(1) ⟨A, α⟩ is simple.

(2) For any coalgebra ⟨B, β⟩, there is at most one map

\xymatrix{⟨B, β⟩ \ar[r] & ⟨A, α⟩} .

(3) (If E has kernel pairs of coequalizers and Γ preserves weak pullbacks) the equality relation Δ_{⟨A, α⟩} is the largest relation on ⟨A, α⟩, i.e., the maximal element of Rel_{E_{Γ}}(⟨A, α⟩, ⟨A, α⟩).

Proof. We prove that (1) and (2) are equivalent and that they imply (3). Then, we assume that Γ preserves weak pullbacks and prove that (3) implies (1).

(1) ⇒ (2): Let f, g:\xymatrix{⟨B, β⟩ \ar[r] & ⟨A, α⟩} be given and take the coequalizer of f and g (since E_{Γ} has all coequalizers). This coequalizer is again ⟨A, α⟩, and so f = g.

(2) ⇒ (1): Let

\xymatrix{⟨B, β⟩ \ar[r]^{b_{1}} \ar[r]_{b_{2}} & ⟨A, α⟩ \ar@{|->}[r]^{q} & ⟨Q, ν⟩}

be a coequalizer diagram. Then b_{1} = b_{2}, so ⟨Q, ν⟩ ≅ ⟨A, α⟩.

(2) ⇒ (3): Let ⟨R, ρ⟩ be a relation on ⟨A, α⟩, with projections r_{1} and r_{2}. Then, r_{1} = r_{2}, and so we have the factorization shown below.

[figure: ⟨R, ρ⟩; r_{1}; r_{2}; r_{1}=r_{2}; Δ_{⟨A, α⟩}; id; id; ⟨A, α⟩]

(3) ⇒ (1): Let q:\xymatrix{⟨A, α⟩ \ar@{|->}[r] & ⟨Q, ν⟩} be a regular epi, and take the kernel pair of q in E,

\xymatrix{K \ar[r]^{k_{1}} \ar[r]_{k_{2}} & A \ar@{|->}[r]^{q} & Q} .

Because Γ preserves weak pullbacks, there is a structure map for K,

κ:\xymatrix{K \ar[r] & ΓK} ,

1.5. INITIAL ALGEBRAS AND FINAL COALGEBRAS 45

making k_{1} and k_{2} homomorphisms. Because U reflects jointly monic families, ⟨K, κ⟩ is a relation on ⟨A, α⟩, with projections k_{1} and k_{2}. Since Δ_{⟨A, α⟩} is the largest relation, the following diagram commutes.

[figure: ⟨K, κ⟩; k_{2}; k_{1}; Δ_{⟨A, α⟩}; id; id; A]

Hence, k_{1} = k_{2} and so, since every coequalizer is the coequalizer of its kernel pair, ⟨Q, ν⟩ ≅ ⟨A, α⟩.

□

Definition 1.5.26. We say that a coalgebra ⟨A, α⟩ satisfies the principle of coinduction if Δ_{⟨A, α⟩} is the largest relation on ⟨A, α⟩.

Corollary 1.5.27. Any simple coalgebra satisfies the principle of coinduction. If E has kernel pairs of coequalizers and Γ preserves weak pullbacks, then any coalgebra satisfying the principle of coinduction is simple.

We will return to the topic of coinduction in Section 2.6, where we will show how it leads to a proof principle for simple coalgebras.

1.5.4. The comparison map. Let Γ:\xymatrix{E \ar[r] & E} be given and suppose that E^{Γ} has an initial object, ⟨I, ι⟩, and E_{Γ} a final object, ⟨F, ϕ⟩. From Lambek’s lemma, we know that the structure map ι is an isomorphism and the same holds for ϕ. Consequently, we can view the initial algebra as a coalgebra, namely, the coalgebra ⟨I, ι^{−1}⟩. By finality, there is a unique map ! from ⟨I, ι^{−1}⟩ to ⟨F, ϕ⟩. That is, there is a unique map ! in E such that the diagram below commutes.

\xymatrix{ΓI \ar[r]^{Γ!} & ΓF \\ I \ar[u]^{ι^{−1}} \ar[r]_{!} & F \ar[u]_{ϕ}} (5)

On the other hand, we can view the final coalgebra as an algebra, ⟨F, ϕ^{−1}⟩. As such, there is a unique homomorphism from the initial algebra ⟨I, ι⟩ to ⟨F, ϕ^{−1}⟩. It is easy to see that this is simply two descriptions of the same map. The map ! in (5) clearly makes the diagram (6), below, commute.

\xymatrix{ΓI \ar[r]^{Γ!} \ar[d]_{ι} & ΓF \ar[d]^{ϕ^{−1}} \\ I \ar[r]_{!} & F} (6)

46 1. ALGEBRAS AND COALGEBRAS

In fact, the map ! is just the unique map from the initial object to the final object in the category Fix(Γ). The point is that this map is a homomorphism in both relevant senses.

In the examples that we’ve seen thus far, this comparison map ! is precisely what one expects: it is an inclusion of the initial algebra into the final coalgebra. For instance, the initial algebra for the functor ΓA = Z × A + 1 for a fixed X is the collection of finite streams over Z.

In [Bar93], Michael Barr shows that the initial algebra is often a dense subspace of the final coalgebra (under a natural topology), with the comparison map an inclusion. In [Adá01], Jiří Adámek extends these results.

CHAPTER 2 Constructions arising from a (co)monad

In this chapter, we focus on categories of (co)algebras which come with a left (right, resp.) adjoint to the forgetful functor. These categories are equivalent to categories of (co)algebras for a (co)monad, a stricter notion that categories of (co)algebras for an endofunctor. We begin the chapter with a review of (co)monads and their (co)algebras.

Following this, we introduce subcoalgebras. We view subcoalgebras as dual to quotients of algebras, and so take a subcoalgebra to be a regular subobject of the coalgebra. Theorems about subcoalgebras, then, are dual to theorems about quotients of algebras, or, equivalently when E is exact, theorems about congruences.

Given a Γ-coalgebra ⟨A, α⟩, we introduce a modal operator □ on Sub(A), taking a subobject P ≤ A to the largest subcoalgebra ⟨B, β⟩ such that B ≤ P. We show that □ is an S4 modal operator. Furthermore, we discuss a left adjoint ◁ taking P to the least subcoalgebra containing P. This closure operator exists if Γ preserves non-empty intersections.

We revisit the topic of limits in categories of coalgebras (and colimits in categories of algebras) and show that we may construct all limits (colimits, resp.) if the forgetful functor is comonadic (monadic, resp.). However, these constructed limits are not typically preserved by U.

We close the chapter by introducing the definition of bisimulations, which we take to be the image of a coalgebraic relation. This definition differs from the familiar definition in many texts, but we take our definition to be a reasonable expansion of the term for settings in which the axiom of choice is unavailable. We show, in fact, that the definition offered here coincides with the more traditional definition, given choice, and so feel that this generalization is suitable.

We discuss coinduction in terms of the introduced notion of bisimulation and also briefly generalize to n-simulations, to facilitate the development of the internal logic in Chapter 4.

2.1. (Co)monads and (co)algebras

A central notion in the study of universal algebras is the concept of a free algebra. Such algebras can be viewed as term algebras over a set of variables. Hence, from free

48 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

algebras, one comes to a notion of equation (a pair of elements of the free algebra) and the definition of equation satisfaction. Categorically, such free algebras are easily understood in terms of adjoint functors. In particular, as we will see in Section 2.1.2, an algebra ⟨A, α⟩ is free over X if ⟨A, α⟩ ≅ F X, where F is the left adjoint to the forgetful functor.

Such adjoint functors give rise to monads in a natural way, which we discuss in the Appendix. One may ask whether every monad comes from a pair of adjoint functors. In fact, this is the case. Moreover, starting with a monad T, one can show that there are (at least) two methods of constructing an adjoint pair of functors that give rise to T. One method, the Kleisli construction, will not concern us much in what follows. Instead, we will focus on the Eilenberg-Moore construction. This construction considers the category of algebras for a monad T and shows that this category comes with a pair of adjoint functors F ⊣ U such that T = UF.

We begin by going into some detail on the definition of the category of algebras for a monad and sketch the proof of the Eilenberg-Moore theorem. This naturally leads into a discussion of (co)free (co)algebras in Section 2.1.2.

2.1.1. (Co)algebras for a (co)monad. In this section, we will define algebras for a monad and state the Eilenberg-Moore theorem. This theorem says that every monad arises as the monad for an adjunction. Moreover, every monad 𝕋 = ⟨T, η, μ⟩ arises as the monad for an adjunction F ⊣ U where U is the forgetful functor for the category of 𝕋-algebras. Here, however, we mean algebras for the monad 𝕋. This is not the same as algebras for the endofunctor T — it is a narrower definition.

See Section A.5 for a brief review of monads.

In Section 2.1.2, we will discuss the situation in which the category of Γ algebras for an endofunctor Γ is equivalent to a category of algebras for a monad.

Definition 2.1.1. Let 𝕋 = ⟨T, η, μ⟩ be a monad over E. A 𝕋-algebra is an algebra ⟨A, α⟩ for the endofunctor T such that the following diagrams commute.

[figure: T^{2}A; T α; μ_{A}; T A; α; A; η_{A}; T A; α; T A; α; A; A]

We refer to the commutativity of these diagrams as the associativity and unit conditions for 𝕋-algebras. A 𝕋-homomorphism is just a T -homomorphism in the sense of homomorphisms between algebras for an endofunctor (Definition 1.1.1). That is, a 𝕋-homomorphism

f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩}

is a map f:\xymatrix{A \ar[r] & B} in E such that the diagram below commutes.

\xymatrix{T A \ar[r]^{T f} \ar[d]_{α} & T B \ar[d]^{β} \\ A \ar[r]_{f} & B}

The 𝕋-algebras and their homomorphisms form a full subcategory of the C^{T}, the category of algebras for the endofunctor T. We denote this category as C^{𝕋} (note the different font for the endofunctor T and the monad 𝕋 = ⟨T, η, μ⟩).

Theorems 1.2.4, 1.2.7 and 1.2.13 hold in categories of coalgebras for a monad as well. That is, the forgetful functor creates limits, creates whatever colimits T preserves and E^{𝕋} inherits the regular epi-mono factorizations from an almost regular E if T also preserves regular epis. The first two facts can be found in [Bor94, Volume 2]. That E^{𝕋} has regular epi-mono factorizations is easily verified. In fact, E^{𝕋} is closed under quotients and subalgebras as a subcategory of E^{T} — indeed, it is a variety of E^{T} (see Section 3.2.1).

Dually, we define a 𝔾-coalgebra for a comonad 𝔾. This definition is a straightforward exercise in turning the arrows around in Definition 2.1.1, but we include it for reference.

Definition 2.1.2. Let 𝔾 = ⟨G, ε, δ⟩ be a comonad over E. A 𝔾-coalgebra is a G-coalgebra ⟨A, α⟩ such that the following diagrams commute.

[figure: G^{2}A; GA; δ_{A}; A; GA; ε_{A}; GA; Gα; A; α; α; A; α]

A 𝔾-homomorphism is just a G-homomorphism between 𝔾-coalgebras. The category of 𝔾-coalgebras and their homomorphisms is denoted E_{𝔾}. It is a full subcategory of the category E_{G} (indeed, a covariety).

The theorem below originally appeared in [EM65]. It can be found in any basic category theory text, including [Bor94, Volume 2] and [BW85]. We take it from the latter.

Theorem 2.1.3 (Eilenberg-Moore theorem). Let 𝕋 = ⟨T, η, μ⟩ be a monad over E and let U:\xymatrix{E^{𝕋} \ar[r] & E} be the evident forgetful functor. Then there is a functor F:\xymatrix{E \ar[r] & E^{𝕋}} such that F ⊣ U and 𝕋 is the monad associated with the adjunction F ⊣ U.

Proof. We define F:\xymatrix{E \ar[r] & E^{𝕋}} on objects C ∈ E by

F C = ⟨T C, μ_{C}:\xymatrix{T^{2}C \ar[r] & T C} ⟩.

50 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

One must check that F C is a 𝕋-algebra, i.e., that it satisfies the associativity and unit conditions for 𝕋-algebras. This follows just from the associativity and (one of the) unit conditions for the monad 𝕋 itself.

Let C ∈ E and ⟨A, α⟩ ∈ E^{𝕋}. One must show

Hom(E, C)A ≅ Hom(E^{𝕋}, F C)⟨A, α⟩.

The isomorphism takes a map f:\xymatrix{C \ar[r] & A} to

α ∘ T f:\xymatrix{F C \ar[r] & ⟨A, α⟩}.

The inverse takes a homomorphism g:\xymatrix{F C \ar[r] & ⟨A, α⟩} to

g ∘ η_{C}:\xymatrix{C \ar[r] & A}.

Clearly, we have that T = UF, as desired. One must check that the unit of the adjunction F ⊣ U is η, the unit of 𝕋, and that the multiplication μ of 𝕋, is given by Uε_{F}, where ε is the counit of the adjunction. This is easy.

It is worth noting that the counit of the adjunction arises naturally enough: If ⟨A, α⟩ is a 𝕋-algebra, then ε_{⟨A, α⟩} = α. □

So, given any monad 𝕋, we can “factor” 𝕋 into an adjoint pair via the Eilenberg-Moore construction. This factorization is not unique, however. Indeed, every monad has at least one other factorization: the factorization given by Kleisli in [Kle65]. However, the Eilenberg-Moore factorization is distinguished: It is final among all such factorizations^{1}. We state the theorem more precisely here, but it will not play a significant role in this thesis.

Theorem 2.1.4. Let 𝕋 = ⟨T, η, μ⟩ and

\xymatrix{D \ar[rr]^{L} & ⊥ & E \ar[ll]^{R}}

be given such that

• T = R ∘ L

• The unit of the adjunction L ⊣ R is η, the unit of the monad.

• The multiplication of the monad, μ, is equal to Rε_{L}, where ε is the counit of the adjunction R ∘ L.

1The Kleisli construction is initial among all such factorizations. See [Bor94, Volume 2] or [BW85].

Then, there is a unique J:\xymatrix{D \ar[r] & E^{𝕋}} such that the following diagram commutes.

\xymatrix{D \ar[rr]^{J} \ar[dr]_{R} &  & E^{𝕋} \ar[dl]_{U} \\  & E \ar[ul]_{L} \ar[ur]_{F}}

The Eilenberg-Moore construction dualizes in a natural way. Given a comonad 𝔾 = ⟨G, ε, δ⟩ over E, the forgetful functor

U:\xymatrix{E_{𝔾} \ar[r] & E}

has a right adjoint,

H:\xymatrix{E \ar[r] & E_{𝔾}},

such that the comonad 𝔾 is induced by the adjunction U ⊣ H. The functor H takes an object C ∈ E to the coalgebra ⟨GC, δ_{C}⟩.

2.1.2. Free algebras. A basic notion in the theory of universal algebras is that of the free algebra over a set of variables. Let Σ be a signature and X a set of variables. The free Σ-algebra over X, denoted F X, can be described informally as the collection of all terms that can be constructed from the variables of X using the function symbols of Σ. This informal description can be stated more precisely in terms of least fixed points, but we do not take these descriptions to be the definition of a free algebra over X. Instead, the property of freeness is defined in terms of homomorphic extensions of maps.

Specifically, the property of freeness says: for every Σ-algebra ⟨A, α⟩ and every assignment σ of the variables of X to the carrier A, there is a unique homomorphism σ̃:\xymatrix{F X \ar[r] & ⟨A, α⟩} extending the assignment σ. An assignment of the variables of X to A is just a map σ:\xymatrix{X \ar[r] & A}. Thus, the defining property of F X can be stated: there is a map

η_{X}:\xymatrix{X \ar[r] & UF X}

(called the insertion of generators) such that, for every

σ:\xymatrix{X \ar[r] & A},

there is a unique

σ̃:\xymatrix{F X \ar[r] & ⟨A, α⟩}

making the following diagram commutes:

\xymatrix{ & UF X \ar[d]^{σ̃} \\ X \ar[r]_{σ} \ar[ur]^{η_{X}} & A}

52 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

This condition should look familiar. If, for every X ∈ Set, there is a free algebra over X, then the operator F taking each X to its free algebra extends to a functor which is left adjoint to the forgetful functor U.

This allows us to state quite abstractly what it means for a Γ-algebra to be a free algebra over some object X. Namely, ⟨K, κ⟩ is free over X just in case there is a left adjoint F:\xymatrix{E \ar[r] & E^{Γ}} to the forgetful functor U and ⟨K, κ⟩ ≅ F X. Notice that an initial Γ-algebra is free over the initial object of E, if it exists.

The universal mapping property of the free algebra gives another description of it. Let F X = ⟨K, κ⟩ be the free Γ-algebra over X. We have a pair of maps, then,

\xymatrix{X \ar[r]^{η_{X}} & K & ΓK \ar[l]_{κ}} ,

and so we can consider the X + Γ-coalgebra, ⟨K, [η_{X}, κ]⟩.

By the adjunction F ⊣ U, we have, for all Γ-algebras ⟨A, α⟩ and maps σ:\xymatrix{X \ar[r] & A}, there is a unique Γ-homomorphism σ̃ such that σ̃∘η_{X} = σ. Any such Γ-algebra ⟨A, α⟩ and assignment σ corresponds to an X + Γ-algebra, namely ⟨A, [σ, α]⟩. Furthermore, by the conditions of the adjunction, the diagram below, commutes.

\xymatrix{ & K \ar[d]^{σ̃} & ΓK \ar[l]_{κ} \ar[d]^{Γσ̃} \\ X \ar[ur]^{η_{X}} \ar[r]_{σ} & A & ΓA \ar[l]^{α}}

But, this is exactly the condition needed to show that σ̃ is an X + Γ-homomorphism, i.e., that the following diagram commutes.

\xymatrix{X + ΓK \ar[d]_{[η_{X},κ]} \ar[r]^{id_{X} +Γσ̃} & X + ΓA \ar[d]^{[σ,α]} \\ K \ar[r]_{σ̃} & A}

Thus, we see that ⟨K, κ⟩ satisfies the following condition: For every X + Γ-algebra ⟨A, [σ, α]⟩, there is a unique X + Γ-homomorphism \xymatrix{⟨K, [η_{X}, κ]⟩ \ar[r] & ⟨A, [σ, α]⟩} . In other words, ⟨K, [η_{X}, κ]⟩ is the initial X + Γ-algebra.

This observation leads to an alternative definition of free algebra over X, one that does not require that every object of E has a free algebra. Namely, we say that ⟨K, κ⟩ is a free Γ-algebra over X just in case there is a map f:\xymatrix{X \ar[r] & K} such that ⟨K, [f, κ]⟩ is an initial X + Γ algebra. We have, then, the following fact:

Theorem 2.1.5. Let E have binary coproducts, Γ:\xymatrix{E \ar[r] & E} be given and U:\xymatrix{E^{Γ} \ar[r] & E} be the forgetful functor. Then U has a left adjoint F iff, for each X ∈ E, the initial X + Γ-algebra exists.

As an immediate corollary, we have

Corollary 2.1.6. Let Γ:\xymatrix{E \ar[r] & E} be given and let F:\xymatrix{E \ar[r] & E^{Γ}} be the left adjoint to the forgetful functor U:\xymatrix{E^{Γ} \ar[r] & E}, with η the unit of the adjunction. Then, for every X ∈ E,

[η_{X}, κ]:\xymatrix{X + ΓUF X \ar[r] & UF X}

is an isomorphism, where κ:\xymatrix{ΓUF X \ar[r] & UF X} is the structure map of the algebra F X (so F X = ⟨UF X, κ⟩).

Proof. Lambek’s lemma (Lemma 1.5.1). □

Thus, the existence of a free functor F depends on whether an initial X+Γ-algebra exists for every X ∈ E. So, one can use existence theorems for initial algebras to prove that U has a left adjoint. For instance, if Γ is co-continuous, then, for every X, the functor X + Γ is also co-continuous and so has an initial algebra (from a wellknown fixed point theorem, generalized in [Bar92]). For the most part, we will not be concerned here with the question of the existence of a functor F, any more than we are concerned with the existence theorems for initial algebras and final coalgebras.

We can apply the results of Section 1.5.2 to free algebras. Since a free Γ-algebra over X is an initial X + Γ-algebra, it comes with the proof principles common to all initial algebras: induction and recursion. We have seen the principle of recursion. It is the principle that, for every Γ-algebra ⟨A, α⟩ and every map σ:\xymatrix{X \ar[r] & A}, there is a unique homomorphism σ̃:\xymatrix{F X \ar[r] & ⟨A, α⟩} extending σ. This gives a nice description of ε, the counit of the adjunction F ⊣ U, namely, ε_{⟨X, ξ⟩} is the extension of the assignment id_{X}:\xymatrix{X \ar[r] & X}.

The principle of induction for free algebras should be familiar as well. This principle commonly occurs in proof theory, for instance — it is the principle of structural induction for terms. After all, the term algebras for a language are just ℙ-algebras for some polynomial functor ℙ. If ℙ is a polynomial, then X + ℙ is also a polynomial. Thus, structural induction for terms over a set of variables is just a special case of Example 1.5.11.

Induction for free algebras for other functors is similar. It states that, for each property P, if P holds of the elements of X, and if P is preserved under “term formation” (whatever that means for the functor at hand), then P holds for all of F X.

Example 2.1.7. Consider the Set-functor ΓA = Z × A + 1, from Example 1.1.6. The forgetful functor U:\xymatrix{Set^{Γ} \ar[r] & Set} has a left adjoint, F:\xymatrix{Set \ar[r] & Set^{Γ}}. The functor F takes a set X to the initial X + Z × − + 1 algebra. We can understand this object as the initial algebra for a polynomial functor. Hence, we can think of it as a collection of terms for a signature (Example 1.1.5). The signature includes a constant for each

54 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

x ∈ X and also a constant ∗ for the unique element of 1. Also, for each z ∈ Z, we have a unary function symbol z^{(1)}. Thus, the free Γ-algebras are easily understood.

But, this characterization isn’t very useful for the interpretation of Set^{Γ} we’ve chosen. We’ve said that the initial algebra for Set^{Γ} is the collection of finite streams over Z, denoted Z^{<ω}. So, we would like to describe the free algebras in these terms as well. Of course, the initial algebra itself is a free algebra — it is the free algebra over the empty set, F 0. So, we also want our description of free algebras to coincide with our description of the initial algebra.

Let X ∈ Set. We consider the elements of UF X as finite streams over Z again, with one important difference. In the initial Γ-algebra, there is a single object that represents an empty stream, which we denote (). In the Γ-algebra F X, there are many “empty streams”. In addition to (), we have an empty stream for each x ∈ X. Let

[push_{X}, ()_{X}]:\xymatrix{Z × UF X + 1 \ar[r] & UF X}

be the structure map for F X and η the unit of the adjunction F ⊣ U. The map

[η_{X}, ()]:\xymatrix{X + 1 \ar[r] & UF X}

picks out these empty streams, while the map push_{X} constructs a new stream from an element of Z together with an element of UF X.

More concretely, the free Γ-algebra over X is given by

UF X = (X + 1) × Z^{<ω}.

The X + 1 component denotes the “type” of the end of the stream. The structure map

[push_{X}, ()_{X}]:\xymatrix{Z × UF X + 1 \ar[r] & UF X}

is defined by

()_{X} = ⟨∗, ()⟩,
push_{X}(z, ⟨a, σ⟩) = ⟨a, push(z, σ)⟩,

where z ∈ Z, a ∈ X + 1 and σ ∈ Z^{<ω}. The functions () and push here were defined for the initial algebra

⟨Z^{<ω}, [push, ()]⟩

in Example 1.5.6.

2.1.3. Monadicity. We now return to the topic of algebras for a monad and show how it relates to free algebras for an endofunctor: Specifically, if the forgetful functor U:\xymatrix{E^{Γ} \ar[r] & E} has a left adjoint F, then E^{Γ} is isomorphic to E^{𝕋}, where 𝕋 is the triple induced by the adjunction F ⊣ U. Moreover, the isomorphism commutes with the respective forgetful functors. Thus, U is monadic in the sense below.

2.1. (CO)MONADS AND (CO)ALGEBRAS 55

Definition 2.1.8. Let G:\xymatrix{C \ar[r] & D} be given. We say that G is monadic if there is a monad 𝕋 on D and an equivalence of categories J:\xymatrix{C \ar[r] & D^{𝕋}} such that the following diagram commutes.

\xymatrix{C \ar[rr]^{J} \ar[dr]_{G} &  & D^{𝕋} \ar[dl]^{U} \\  & D}

The functor U, above, is the forgetful functor for the category of algebras for the monad 𝕋.

One can learn about monadic functors in the standard category theory texts. This definition and Theorem 2.1.10, below, come from [Bor94, Volume 2]. They can also be found in [BW85]. Before stating Beck’s theorem, we must have a definition, also from [Bor94, Volume 2].

Definition 2.1.9. A diagram of the form

\xymatrix{A \ar[r]|{a_{1}} \ar[r]_{a_{2}} & B \ar[l]_{f} \ar[r]_{q} & Q \ar[l]_{g}}

is a split coequalizer if the following hold:

q ∘ a_{1} = q ∘ a_{2}
q ∘ g = id_{Q}
a_{1} ∘ f = id_{B}
a_{2} ∘ f = g ∘ q

It is easy to check that split coequalizers are indeed coequalizers and moreover are absolute (preserved by every functor). Split coequalizers naturally arise in the context of algebras for an monad 𝕋 = ⟨T, η, μ⟩ since, for any 𝕋-coalgebra ⟨A, α⟩, the diagram below is a split coequalizer.

\xymatrix{T^{2}A \ar[r]|{μ_{A}} \ar[r]_{T α} & T A \ar[l]_{η_{T A}} \ar[r]_{α} & Q \ar[l]_{η_{A}}}

It is this fact which is crucial in the characterization of monadic functors, first due to J. M. Beck [Bec67].

Theorem 2.1.10 (Beck’s theorem). Let G:\xymatrix{D \ar[r] & C} be given. The following are equivalent.

(1) G is monadic.

(2) (a) G has a left adjoint. (b) G reflects isomorphisms.

56 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

(c) For any pair

\xymatrix{A \ar[r]^{f} \ar[r]_{g} & B}

such that Gf and Gg have a split coequalizer in C, f and g have a coequalizer in D which is preserved by G.

Corollary 2.1.11. Let Γ:\xymatrix{E \ar[r] & E} be given. The forgetful functor U:\xymatrix{E^{Γ} \ar[r] & E} has a left adjoint iff U is monadic.

Proof. Let Γ be given. Because U is faithful, it reflects isomorphisms. If homomorphisms f, g:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} have a split coequalizer in E, then Γ preserves the split coequalizer (since it is an absolute coequalizer). Hence, U reflects and preserves the split coequalizer. Thus, applying Theorem 2.1.10 completes the proof. □

In [AP01], a functor Γ is called a varietor if the forgetful functor U:\xymatrix{E^{Γ} \ar[r] & E} is monadic.

We can strengthen the results of this corollary. First, we put the corollary in the context of results from Section 2.1.2. Let Γ:\xymatrix{E \ar[r] & E} be given and suppose that U:\xymatrix{E^{Γ} \ar[r] & E} has a left adjoint F:\xymatrix{E \ar[r] & E^{Γ}}. Let 𝕋 = ⟨T = UF, η, Uε_{F} ⟩ be the monad induced by the adjunction F ⊣ U, and let

\xymatrix{E \ar[rr]^{F^{𝕋}} & ⊥ & E^{𝕋} \ar[ll]^{U^{𝕋}}}

be the adjoint functors given in the Eilenberg-Moore theorem (Theorem 2.1.3). One can show that there is an isomorphism (rather than a mere equivalence) E^{Γ} ≅ E^{𝕋} that commutes with the forgetful functors.

A nice presentation of this fact is given in Daniele Turi’s dissertation [Tur96]. The reader should look there for the details, but it is worth describing the action of J and its inverse. We map a Γ-algebra,

⟨A, α:\xymatrix{ΓA \ar[r] & A}⟩,

to the 𝕋-algebra

⟨A, Uε_{α}:\xymatrix{T A \ar[r] & A}⟩.

On the other hand, suppose we start with a 𝕋-algebra,

⟨C, γ:\xymatrix{T C \ar[r] & C}⟩.

Recall that we have an isomorphism [figure: C + ΓT C; T C] (Corollary 2.1.6). The left component \xymatrix{C \ar[r] & T C} is the unit of the monad (and of the adjunction F ⊣ U). Call the right component θ_{C}. Then, we map ⟨C, γ⟩ to the Γ-algebra with structure map

\xymatrix{ΓC \ar[r]^{Γη_{C}} & ΓT C \ar[r]^{θ_{C}} & T C \ar[r]^{γ} & C}

2.1. (CO)MONADS AND (CO)ALGEBRAS 57

We omit the proof that these operators extend to functors that are inverses of each other.

This concludes our discussion of free algebras and the associated category of algebras for a monad. We have covered this well-traveled ground in order to consider the dual case. In Section 2.1.4, we will put the algebraic theorems to work in order to learn about cofree coalgebras.

2.1.4. Cofree coalgebras. An early discussion of cofree coalgebras occurs in [Rut96]. There, Rutten gives the now familiar discussion of cofreeness in terms of colorings. This interpretation of cofreeness arises naturally from dualizing the work in Section 2.1.2. We follow this approach.

Previously, we saw that a Γ-algebra ⟨A, α⟩ is free over X just in case there is a map η_{X}:\xymatrix{X \ar[r] & A} such that ⟨A, [η_{X}, α]⟩ is the initial X + Γ-algebra. We dualize this observation to define cofreeness.

Definition 2.1.12. Let Γ:\xymatrix{E \ar[r] & E} be given and let C be an object of E. A Γcoalgebra ⟨A, α⟩ is cofree over C just in case there is a map ε_{C}:\xymatrix{A \ar[r] & C} such that the C × Γ-coalgebra ⟨A, ⟨ε_{C}, α⟩⟩ is final (in the category E_{C×Γ}).

Let ⟨A, α⟩ be cofree over C and let ⟨B, β⟩ be a Γ-coalgebra. Then, for any p:\xymatrix{B \ar[r] & C}, we have a C × Γ-coalgebra, namely, ⟨B, ⟨p, β⟩⟩. Thus, there is a unique map f:\xymatrix{B \ar[r] & A} such that the diagram below commutes.

\xymatrix{ & A \ar[dl]_{ε_{C}} \ar[r]^{α} & ΓA \\ C & B \ar[r]_{p} \ar[u]_{f} \ar[l]^{β} & ΓB. \ar[u]_{Γf}}

We understood free algebras over X by considering X to be a set of variables. The free algebra over X, then, was the collection of Γ-terms over a set of variables. When considering cofree coalgebras over C, we imagine C to be a set of colors. We interpret maps p:\xymatrix{B \ar[r] & C} as colorings of the elements of B by the colors C (i.e., as a C-coloring of B). To each element of B, the coloring p assigns a color from C. The map ε_{C} is also a coloring: It colors the elements of the cofree coalgebra ⟨A, α⟩. Thus, we can state the principal of cofreeness as follows: ⟨A, α⟩ is cofree over C iff there is a C-coloring ε_{C} of A such that, for every Γ-coalgebra ⟨B, β⟩ and C-coloring p of B, there is a unique homomorphism f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} “consistent” with the coloring p. By consistent, we simply mean that the following diagram commutes, so that elements of B are mapped to elements of A of the same color (under p and ε_{C},

58 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

respectively).

\xymatrix{ & A \ar[d]^{ε_{C}} \\ B \ar@{-->}[ur]^{f} \ar[r]_{p} & C}

Example 2.1.13. Consider the Set-functor ΓA = Z × A from Example 1.1.7 and let C be a set. Then, ⟨A, α⟩ is cofree over C just in case there is a coloring ε_{C}:\xymatrix{A \ar[r] & C} such that ⟨A, ⟨ε_{C}, α⟩⟩ is the final C × Γ-coalgebra.

A C × Γ-coalgebra is just a coalgebra for the functor

A ↦ C × Z × A.

Thus, the final C ×Γ-coalgebra is the collection of all streams over C ×Z. Therefore, the cofree coalgebra over C exists and is given by (C ×Z)^{ω}, with the evident structure map and coloring (counit).

Let E and Γ be given and suppose that, for every C ∈ E, there is a cofree coalgebra over C. Then, there is a

H:\xymatrix{E \ar[r] & E_{Γ}}

such that H is right adjoint to the forgetful functor U:\xymatrix{E_{Γ} \ar[r] & E}. Namely, we take HC to be the cofree Γ-coalgebra over C. Indeed, the principal of cofreeness leads directly to the adjunction conditions: For every

p:\xymatrix{U⟨B, β⟩ \ar[r] & C},

there exists a unique

p̃:\xymatrix{⟨B, β⟩ \ar[r] & HC}

such that the following diagram commutes.

\xymatrix{ & UHC \ar[d]^{ε_{C}} \\ B \ar[ur]^{Up̃} \ar[r]_{p} & C}

Notice that the C-coloring ε_{C} of the cofree coalgebra HC is the component at C of the counit of the adjunction U ⊣ H. This is analogous to the result in Section 2.1.2 that the insertion of variables arose from the unit of the adjunction F ⊣ U.

We can also dualize the monadicity results from Section 2.1.3. Accordingly, we define comonadic functor below and show that, if U:\xymatrix{E_{Γ} \ar[r] & E} has a right adjoint, then U is comonadic. We do this directly, without discussing the dual of Beck’s theorem, since split equalizers do not play a significant role either in the literature or in the remainder of this thesis.

2.1. (CO)MONADS AND (CO)ALGEBRAS 59

Definition 2.1.14. Let K:\xymatrix{C \ar[r] & D} be given. We say that K is comonadic if there is a comonad 𝔾 on D and an equivalence of categories J: \xymatrix{C \ar[r] & D_{𝔾}} such that the following diagram commutes.

\xymatrix{C \ar[rr]^{J} \ar[dr]_{K} &  & D_{𝔾} \ar[dl]^{U_{𝔾}} \\  & D}

The functor U_{𝔾}, above, is the forgetful functor for the category of coalgebras for the comonad 𝔾.

Theorem 2.1.15. Let E and Γ be given such that the forgetful functor U:\xymatrix{E_{Γ} \ar[r] & E} has a right adjoint H:\xymatrix{E \ar[r] & E_{Γ}}. Then U is comonadic.

Proof. We simply sketch the proof here, since the dual construction was discussed in Section 2.1.3. The category E_{Γ} is isomorphic to the category E_{𝔾} of coalgebras for the comonad

𝔾 = ⟨G = UH, ε, Uη_{H}⟩

where ε and η are the counit and unit, respectively, of the adjoint U ⊣ H. The isomorphism takes a Γ-coalgebra ⟨A, α⟩ to the 𝔾-coalgebra

⟨A, Uη_{α}:\xymatrix{A \ar[r] & GA}⟩.

The inverse takes a 𝔾-coalgebra ⟨C, γ⟩ to the Γ-coalgebra

⟨C, γ ∘ ξ_{C} ∘ Γε_{C}⟩,

where ξ_{C}:\xymatrix{GC \ar[r] & ΓGC} arises from the isomorphism

[figure: GC; ⟨ε_{C}, ξ_{C}⟩; C × GC.]
□

In [AP01], a functor Γ is called a covarietor just in case the coalgebraic forgetful functor U:\xymatrix{E_{Γ} \ar[r] & E} is comonadic (equivalently, has a right adjoint).

This next theorem is dual to the well-known fact that, if Γ:\xymatrix{Set \ar[r] & Set} is a varietor, then an algebra ⟨A, α⟩is the quotient of F A.

Theorem 2.1.16. Let E be almost co-regular and let Γ preserve regular monos. Suppose further that U:\xymatrix{E_{Γ} \ar[r] & E} has a right adjoint H. Then, each Γ-coalgebra ⟨A, α⟩ is a regular subcoalgebra of HA.

Proof. Let η and ε be the unit and counit, resp., of the adjunction U ⊣ H. Then, it is a basic fact of adjunctions that ε_{U} ∘ Uη = id_{E} (see, for instance, [Bor94, Chapter 4, Volume 2] or any other introduction of monads). Thus,

ε_{A} ∘ Uη_{⟨A, α⟩} = id_{A}

60 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

and so Uη_{⟨A, α⟩} is a regular mono. Since U reflects regular monos (by the dual of Corollary 1.2.15), we have

η_{⟨A, α⟩}:[figure: ⟨A, α⟩; HA].
□

Remark 2.1.17. The dual of this is worth mentioning: If E satisfies the conditions of Corollary 1.2.15, and the algebraic forgetful functor U:\xymatrix{E^{Γ} \ar[r] & E} is monadic, then each algebra ⟨A, α⟩ is a quotient of the free algebra F A.

2.1.5. Covarietors and inheritance. In the remainder of this section, we sketch an application of covarietors which has not, apparently, been explored in the literature. As is well-known, categories of coalgebras over Set can be used to model objects in an object oriented programming language (at least certain objects — we ignore here constructors and other complications found in [PZ01]). Typically, the functors one uses for the categories of coalgebras are polynomial functors and hence are covarietors.

For our purposes at present, a class specification consists of a list of methods (together with their signatures). For example, consider the specification below:

begin Counter

operations

inc:\xymatrix{X \ar[r] & X}
val:\xymatrix{X \ar[r] & ℕ}

end Counter

This specification describes a class Counter with two methods, inc and val. It should be clear that any (− × ℕ)-coalgebra provides a set of such Counters, and so we call such coalgebras interpretations of the specification Counter. (We do not intend here to give a rigorous presentation of coalgebraic semantics for class specification, but rather a reasonable sketch of this topic. See [RTJ01] for a development of this topic.) Of course, most (− × ℕ)-coalgebras do not behave like a proper counter — certainly, we have not required that val(inc(x)) = val(x) + 1 here. The name Counter is meant to be suggestive, but for the purposes of this example, a specification merely gives the signatures of the methods, without any assertions about the behavior of these methods. See, however, Example 3.6.16 for a discussion of such assertions and their relation to coequations.

Often, given such a class specification, one extends the specification to a new class, which is augmented with additional methods. For instance, given the specification of Counter above, we may wish to specify a counter which comes with a decrement method (in addition to the increment and value methods of Counter). Thus, we may wish to give a specification as shown below:

begin DecCounter extends Counter

operations

dec:\xymatrix{X \ar[r] & X + 1}

end DecCounter

We could model DecCounter by (− × ℕ × (− + 1))-coalgebras, and this is what is typically done. However, there is a sense in which this interpretation neglects the relation between DecCounter and Counter. Since DecCounter arises by adding methods to Counter, it seems natural to consider interpretations of DecCounter to be coalgebras over Set_{(−×ℕ)}, the category of interpretations of Counter. Thus, we would like to find a functor

Δ:\xymatrix{Set_{(−×ℕ)} \ar[r] & Set_{(−×ℕ)}}

such that (Set_{(−×ℕ)})_{Δ} ≡ Set_{(−×ℕ×(−+1))}.

One would be tempted to take Δ to be the obvious functor, ΔX = X + 1, since we are adding a method of type \xymatrix{X \ar[r] & X + 1}. However, this will not work, since we do not expect the structure map dec to be a (−×ℕ)-homomorphism. Instead, it suffices to take Δ to be the composite H ∘ (− + 1) ∘ U, as the following theorem shows.

Theorem 2.1.18. Let E be a category with binary products, Γ:\xymatrix{E \ar[r] & E} be a covarietor and Δ:\xymatrix{E \ar[r] & E} any endofunctor. Then

E_{Γ×Δ} ≅ (E_{Γ})_{HΔU}.

Proof. Let ⟨A, α:\xymatrix{A \ar[r] & (Γ × Δ)A}⟩ be a Γ × Δ-coalgebra. Then ⟨A, π_{1}α⟩ is a Γ-algebra. Let

α′:\xymatrix{⟨A, π_{1}α⟩ \ar[r] & HΔU⟨A, π_{1}α⟩}

be the adjoint transpose of π_{2}α:\xymatrix{A \ar[r] & ΔA}. Then ⟨⟨A, π_{1}α⟩, α′⟩ is an HΔU-coalgebra (over E_{Γ}). It is easy to check that this construction is functorial and yields the isomorphism desired. □

2.2. Subcoalgebras

In Sections 1.3 and 1.4, we introduces subalgebras and congruences. A subalgebra of ⟨A, α⟩ is a subobject of A which is closed under the structure map α. A precongruence on ⟨A, α⟩ and ⟨B, β⟩ is a relation on A and B which is similarly closed under the operations of α and β. The attractiveness of these definitions come from the view that subobjects and relations on E are familiar concepts, so we focus attention on subobjects and relations in E^{Γ} which are also subobjects and relations in E (that is, are mapped to subobjects and relations by the forgetful functors U_{α} and U_{α,β}, respectively).

Our definition of the corresponding notions, subcoalgebra and bisimulation, will be similarly motivated. A subcoalgebra of ⟨A, α⟩ is a subobject of ⟨A, α⟩ which

62 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

is preserved by the forgetful functor. A bisimulation R on ⟨A, α⟩ and ⟨B, β⟩ is a relation on A and B — so, it is a relation in a familiar sense. However, the definition is a bit more complicated than the definition of a pre-congruence. We will not require that

R = U_{α×β}(⟨S, σ⟩)

for some relation ⟨S, σ⟩ on ⟨A, α⟩ and ⟨B, β⟩. Instead, we require that R is the image of some U_{α×β}(⟨S, σ⟩). We discuss bisimulations in detail in Section 2.5.

For subcoalgebras, we have a separate motivation which determines our definition. In categories of algebras, regular epis play a central role in the development of the theory. Indeed, the correspondence between regular epis and congruences can be viewed as a key reason that congruences are an important concept for categories of algebras. As we will see in Chapter 3, when reasoning about congruences (in this case, deductively closed sets of equations), it is convenient to reason about their quotients and translate the results into theorems about congruences. If congruences play a more central role in the theorems than quotients, it is because relations seem a more familiar concept than their coequalizers.

If we take the straightforward approach and define a subcoalgebra as a subobject in Sub(⟨A, α⟩) which is preserved by U_{α}, then we lose the structural advantage that regular epis have in categories of algebras over epis in general. Just as regular epis^{2} are central in E^{Γ}, one expects that their dual, regular monos, will play a central role in the dual category, E_{Γ}. Thus, we offer the following definition.

Definition 2.2.1. Let ⟨A, α⟩ be a Γ-coalgebra. A subcoalgebra of ⟨A, α⟩ is a Γ-coalgebra ⟨B, β⟩ together with a regular mono homomorphism

i:[figure: ⟨B, β⟩; ⟨A, α⟩].

The category of (equivalence classes of) subcoalgebras of ⟨A, α⟩ is denoted

SubCoalg(⟨A, α⟩).

Example 2.2.2. Let ⟨A, O_{A}⟩ be a topological space and ⟨A, α⟩ the associated F-coalgebra (see Example 1.1.12). Then ⟨B, β⟩ is a subcoalgebra of ⟨A, α⟩ iff B is (isomorphic to) an open subset of ⟨A, α⟩ and β is the neighborhood filter on the subspace ⟨B, O_{B}⟩.

Throughout this section, we assume that Γ preserves regular monos. Thus, if ⟨B, β⟩ is a subcoalgebra of ⟨A, α⟩, then B is a regular subobject of A, so subcoalgebras are regular subobjects in E. In a more general setting, we would make a

2In fact, it would be just as well to work with strong epis and monos, and alter the theorems accordingly, but we would lose the connection between quotients and congruences in the algebraic setting.

2.2. SUBCOALGEBRAS 63

distinction between the category of regular subobjects of ⟨A, α⟩ and their images under U_{α}, corresponding to the definition of bisimulation in Section 2.5.

We also will assume that E is regularly well-powered throughout.

Remark 2.2.3. If E is a topos, then every mono is regular. So our definition of subcoalgebra coincides with the usual definition of subcoalgebra: Namely, ⟨B, β⟩ is a subcoalgebra of ⟨A, α⟩ just in case there is a monic homomorphism

i:[figure: ⟨B, β⟩; ⟨A, α⟩].

In other words, if E is a topos, then

SubCoalg(⟨A, α⟩) = Sub(⟨A, α⟩).

Let RegSub(A) be the poset of regular subobjects of A. We define a functor

U_{α}:\xymatrix{SubCoalg(⟨A, α⟩) \ar[r] & RegSub(A)},

taking a regular subcoalgebra

[figure: ⟨B, β⟩; i; ⟨A, α⟩]

to the regular subobject

[figure: B; i; A]

(again, using the assumption that Γ preserves regular monos).

Theorem 2.2.4. The subcoalgebra forgetful functor U_{α} is full and injective on objects. In other words, SubCoalg(⟨A, α⟩) is a full subcategory of RegSub(A).

Proof. U_{α} is full by Corollary 1.2.10 (a map into a mono is a homomorphism when the composite is).

Let U_{α}(⟨B, β⟩) = U_{α}(⟨B, β′⟩) = B and let

i:[figure: B; A]

be the regular mono homomorphic inclusion for B. Then, Γi is a regular mono (and hence a mono). Since

Γi ∘ β = α ∘ i = Γi ∘ β′,

β = β′. □

Theorem 2.2.5. Let E be cocomplete and almost co-regular and Γ preserve regular monos. The functor U_{α} creates joins and commutes with ∃_{f}.

Proof. The join of regular subcoalgebras ⟨P_{i}, ρ_{i}⟩ of ⟨A, α⟩ is given as the epiregular mono factorization of the map

\xymatrix{∐_{i}⟨P_{i}, ρ_{i}⟩ \ar[r] & ⟨A, α⟩}.

64 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

Because coproducts are created by U and U preserves regular epi-mono factorizations, U_{α} preserves the join ⋁_{i} P_{i}.

Let f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} and i:[figure: ⟨P, ρ⟩; ⟨A, α⟩] be given. Then

U_{β}∃_{f}⟨P, ρ⟩ = U_{β} Im(f ∘ i) = Im U(f ∘ i) = ∃_{Uf}U_{α}⟨P, ρ⟩.
□

Theorem 2.2.6. If, in addition to the assumptions of Theorem 2.2.5, Γ preserves pullbacks of regular monos, then U_{α} also creates finite meets. Furthermore, U_{α} commutes with pullback of subobjects, i.e., for every f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩},

U_{α} ∘ f^{∗} = (Uf)^{∗} ∘ U_{β}.

Proof. By Corollary 1.2.8, U creates pullbacks along regular monos. □

2.2.1. About the functor [−]_{α}. In universal algebras, one can construct a least subcoalgebra containing a subset of the carrier of an algebra. This construction was discussed in Theorem 1.3.6, where we showed that the functor

⟨−⟩_{α}:\xymatrix{Sub(A) \ar[r] & SubAlg(⟨A, α⟩)}

was left adjoint to the forgetful functor

U_{α}:\xymatrix{SubAlg(⟨A, α⟩) \ar[r] & Sub(A)}

.

The functor ⟨−⟩ was constructed under the assumption that Sub(A) had all meets. Using the fact that the meet of subalgebras again yields a subalgebra, ⟨P ⟩ is defined as the meet of all subalgebras containing P.

In this section, we will carry out the analogous construction for regular subcoalgebras. Here, we use the fact that the join of regular subcoalgebras is again a regular subcoalgebra.

Theorem 2.2.7. Let E be cocomplete, regularly well-powered and have epi-regular mono factorizations and let Γ preserve regular monos. Then the forgetful functor

U_{α}:\xymatrix{SubCoalg(⟨A, α⟩) \ar[r] & RegSub(A)}

has a right adjoint,

[−]_{α}:\xymatrix{RegSub(A) \ar[r] & SubCoalg(⟨A, α⟩)}.

Proof. The proof is a straightforward construction following the proof of Theorem 1.3.6, but we include it nonetheless.

Let [figure: P; i; RegSub(A)] be given. Define [P]_{α} to be the join of the collection

𝔓 = {[figure: ⟨B, β⟩; ⟨A, α⟩] | B ≤ P }.

Proof.

\xymatrix{SubCoalg(⟨A, α⟩) \ar[d]_{U_{α}}|{⊣} \ar[r]^{∃_{f}} & SubCoalg(⟨B, β⟩) \ar[l]^{f^{∗}}_{⊥} \ar[d]_{U_{β}}|{⊣} \\ RegSub(A) \ar[u]_{[−]_{α}} \ar[r]^{∃_{Uf}} & RegSub(B) \ar[u]_{[−]_{β}} \ar[l]^{_{Uf_{∗}}}|{⊥}}

Figure 1. [−] commutes with pullback

Then, if ⟨Q, ν⟩ is any regular subcoalgebra of ⟨A, α⟩ such that Q ≤ P, then ⟨Q, ν⟩ ∈ 𝔓 and so ⟨Q, ν⟩ ≤ [P]_{α}. On the other hand, if ⟨Q, ν⟩ ≤ [P]_{α}, then

Q ≤ U_{α}[P]_{α} ≤ P.
□

For each of the three corollaries which follow, we work under the assumptions of Theorem 2.2.7.

Corollary 2.2.8. For any homomorphism f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩},

[−]_{β} ∘ Uf^{∗} = f^{∗} ∘ [−]_{α}.

In Figure 1, the left adjoints commute by Theorem 2.2.5, and so the right adjoints commute as well. □

In Theorem 1.4.6, we showed that a homomorphism equalizes a relation R just in case it equalizes the least pre-congruence [R] containing R. Our definition of subcoalgebra is dual to quotient of an algebra (which is, under certain assumptions, equivalent to congruences). Thus, it is theorems about congruences which yield theorems about subcoalgebras, rather than theorems about subalgebras^{3}.

Corollary 2.2.9. Let ⟨A, α⟩ be a Γ-coalgebra, with P a regular subobject of A. Let ⟨B, β⟩ be a Γ-coalgebra and f:\xymatrix{⟨B, β⟩ \ar[r] & ⟨A, α⟩} a Γ-homomorphism. Then Uf factors through P iff f factors through [P]_{α}.

3Theorem 2.2.7 can be viewed as the dual of the theorem that we can construct least congruences containing a relation. In this sense, it is the dual of a theorem about congruences, rather than a theorem about subalgebras. One simply looks at the corresponding theorem regarding quotients of a congruence to see this.

Proof.

Im(Uf) = U_{α} Im(f) ≤ P iff Im f ≤ [P]_{α}.
□

Corollary 2.2.10. Let ⟨A, α⟩ and ⟨B, β⟩ be given, with f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} a homomorphism. Let ⟨D, δ⟩ ≤ ⟨A, α⟩ and P ≤ B. Then

∃_{Uf}D ≤ P iff ∃_{f}⟨D, δ⟩ ≤ [P]_{β}.

Proof. Follows immediately from Corollary 2.2.9. □

The next theorem gives some equivalent constructions of [P]_{α}. The requirement that U be comonadic is only necessary for those constructions which explicitly use the right adjoint H — namely, for (3) and (4).

Theorem 2.2.11. Let E be regularly well-powered, cocomplete and have pullbacks and epi-regular mono factorizations. Let Γ be a covarietor that preserves regular monos with U ⊣ H. Let

[figure: ⟨B, β⟩; b; ⟨A, α⟩]

and

[figure: P; i; A]

be given. The following are equivalent.

(1) ⟨B, β⟩ ≅ [P]_{α}.

(2) Let [figure: P; i; A] be the equalizer of \xymatrix{A \ar[r]^{c_{1}} \ar[r]_{c_{2}} & C} and let \xymatrix{⟨A, α⟩ \ar[r]^{c̃_{1}} \ar[r]_{c̃_{2}} & HC} be the adjoint transposes of c_{1} and c_{2}, respectively. Then

[figure: ⟨B, β⟩; b; ⟨A, α⟩; c̃_{1}; c̃_{2}; HC]

is an equalizer.

(3) There is a (necessarily regular mono) map k: [figure: ⟨B, β⟩; HP] such that the following diagram is a pullback, where η:\xymatrix{1 \ar@{=>}[r] & HU} is the unit of the adjunction U ⊣ H.

[figure: ⟨B, β⟩; k; b; HP; Hi; ⟨A, α⟩; η_{α}; HA]

[figure: ⟨D, δ⟩; f; g; ⟨B, β⟩; η_{β}; b; HB; Hb; HP; ⟨A, α⟩; η_{α}; c̃_{1}; c̃_{2}; HA; Hc_{1}; Hc_{2}; HC; HC]

Figure 2. The construction of [P] as a pullback along the unit.

(4) (If E has a regular subobject classifier Ω) Let \overline{ı} be the classifying map for i, so the diagram below is a pullback.

[figure: P; !; i; 1; true; A; \overline{i}; Ω]

Then, the diagram below is also a pullback,

[figure: ⟨B, β⟩; !; b; H1; Htrue; ⟨A, α⟩; ĩ; HΩ]

where ĩ is the adjoint transpose of \overline{ı}.

Proof. (1)⇒(2): Let g: \xymatrix{⟨D, δ⟩ \ar[r] & ⟨A, α⟩} be given, and suppose that g equalizes

\xymatrix{⟨A, α⟩ \ar[r]^{c̃_{1}} \ar[r]_{c̃_{2}} & HC} .

Then,

c_{1} ∘ g = ε_{C} ∘ c̃_{1} ∘ g = ε_{C} ∘ c̃_{2} ∘ g = c_{2} ∘ g

and so g factors through P. Hence, g factors uniquely through [P] (Corollary 2.2.9).

(2)⇒(3): Let ⟨B, β⟩ be the equalizer of c̃_{1} and c̃_{2}, as in (2). We claim that the top rectangle in the Figure 2 forms a pullback. Let ⟨D, δ⟩, f and g be given so that Figure 2 commutes. Then, g equalizes c̃_{1} and c̃_{2} and so factors uniquely through b, as shown. It is easy to show that the upper triangle also commutes.

[figure: [P]; η_{[P]}; HU[P]; ⟨B, β⟩; HP; Hi; ⟨A, α⟩; η_{α}; HA]

Figure 3. The construction of [P] as a pullback along Hi.

(3)⇒(1): In Figure 3, the right hand triangle commutes because U[P] ≤ P. The diagonal square commutes by naturality of the unit η. Hence, we have a unique map [figure: [P]; ⟨B, β⟩], as shown, making the diagram commute. Thus,

[P] ≤ ⟨B, β⟩.

On the other hand, let k̃:\xymatrix{B \ar[r] & P} be the adjoint transpose of

k:\xymatrix{⟨B, β⟩ \ar[r] & HP} .

Because

Hi ∘ Hk̃ ∘ η_{β} = Hi ∘ k
= η_{α} ∘ b
= Hb ∘ η_{β},

we see that k̃ ∘ i = b. In other words, B ≤ P. Hence, ⟨B, β⟩ ≤ [P] and so ⟨B, β⟩ ≅ [P].

(3)⇔(4): The right adjoint H preserves pullbacks. Consequently, the left hand square in Figure 4 is a pullback iff the whole rectangle is a pullback [Bor94, Proposition 2.5.9, Volume 1].

[figure: ⟨B, β⟩; b; !; HP; H!; Hi; H1; Htrue; ⟨A, α⟩; η_{α}; ĩ; HA; H\overline{ı}; HΩ]

Figure 4. [P] as a pullback along Htrue.

□

2.2. SUBCOALGEBRAS 69

Remark 2.2.12. In the proof of (3)⇒(1), above, we assumed the existence of [P]. This is not necessary. With a bit more work, one can loosen the assumptions of Theorem 2.2.11 (removing the assumption of coproducts) and replace (1) in with

(1)′ [P] exists and [P] ≅ ⟨B, β⟩.

Remark 2.2.13. In Theorem 2.2.11, the construction of [P] found in (3) is essentially the same construction one finds on [BW85, p. 216].

2.2.2. The associated modal operator. Let E be regularly well-powered, cocomplete and almost co-regular and let Γ preserve regular monos and pullbacks along regular monos. Let ⟨A, α⟩ be a Γ-coalgebra. The adjunction U_{α} ⊣ [−]_{α} yields a comonad in the usual way. We will denote the functor part of this comonad,

U_{α}[−]_{α}:\xymatrix{RegSub(A) \ar[r] & RegSub(A)},

by □_{α} (sometimes dropping the subscript).

Remark 2.2.14. The associated monad

[−]_{α}U_{α}:\xymatrix{SubCoalg(⟨A, α⟩) \ar[r] & SubCoalg(⟨A, α⟩)}

yields the trivial closure operator

1:\xymatrix{SubCoalg(⟨A, α⟩) \ar[r] & SubCoalg(⟨A, α⟩)}

on subcoalgebras.

Because □_{α} is a functor on a poset, it is monotone. The counit and comultiplication transformations yield, for every P,

□_{α}P ≤ P
□_{α}P ≤ □_{α}□_{α}P

Furthermore, because U_{α} preserves finite meets, so does □_{α} = U_{α}[−]_{α}. Hence, we have shown that □ is an S4 modal necessity operator.

Definition 2.2.15. An operator □: \xymatrix{P \ar[r] & P} on a Heyting algebra P is an S4 operator if it satisfies the following:

(1) □ is monotone (i.e., is an endofunctor);

(2) □ is deflationary (i.e., □ ≤ 1);

(3) □ is idempotent (i.e., □□ = □);

(4) □(A → B) ≤ □A → □B;

(5) ⊤ ≤ □⊤. In other words, an S4 operator is just a left exact comonad on a Heyting algebra.

Theorem 2.2.16. □_{α}:\xymatrix{RegSub(A) \ar[r] & RegSub(A)} is an S4 operator.

70 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

Proof. (4) follows from the fact that □ preserves meets. The argument for (4) from this is standard, but we include it here.

By (1), we have

□((φ → ψ) ∧ φ) ⊢ □ψ,

and, hence,

□(φ → ψ) ∧ □φ ⊢ □ψ.

Therefore, □(φ → ψ) ⊢ □φ → □ψ.

The top element ⊤ of RegSub(A) is just A itself. Clearly, □_{α}A = A, and so (5) holds. □

Theorem 2.2.17. Let f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} be given. Then

□_{α} ∘ (Uf)^{∗} = (Uf)^{∗} ∘ □_{β}.

In other words, □ is a natural transformation

□:\xymatrix{RegSub(−) ∘ U \ar@{=>}[r] & RegSub(−) ∘ U.}

Proof. Both U_{α} and [−]_{α} preserve pullbacks along regular monos. See Figure 5. The front, right and rear faces are pullbacks and the bottom face commutes, so the left face is also a pullback. □

[figure: □_{β}P; UHP; □_{α}f^{∗}P; UHf^{∗}P; B; UHB; A; Uf; UHA]

Figure 5. □ commutes with pullback.

Example 2.2.18. In Example 1.1.10 we discussed coalgebras for the set functor

Γ = P(AtProp) × P − .

Such coalgebras are Kripke models for the modal language L(AtProp). Given a Γ-coalgebra ⟨A, ⟨α_{1}, α_{2}⟩⟩, we consider the elements of A to be worlds. The first component,

α_{1} :\xymatrix{A \ar[r] & P(AtProp)},

2.2. SUBCOALGEBRAS 71

of the structure map picks out those atomic formulas which are true in a world, while the second component,

α_{2} :\xymatrix{A \ar[r] & P(A)},

gives the accessibility relation. A world b is accessible to a (written a → b) just in case b ∈ α_{2}(a).

Let ϕ ∈ L(AtProp) and 𝔄 = ⟨A, ⟨α_{1}, α_{2}⟩⟩ a Γ-coalgebra. Let Mod_{𝔄}(ϕ) be the collection

{a ∈ A | a ⊧_{𝔄} ϕ}.

We can characterize Mod_{𝔄}(ϕ) by induction on the structure of ϕ as follows. • Mod_{𝔄}(⊤) = A.

• Mod_{𝔄}(ϕ) = α_{1}^{−1}(ϕ) if ϕ ∈ AtProp.
• Mod_{𝔄}(¬ϕ) = A \ Mod_{𝔄}(ϕ).
• Mod_{𝔄}(♢ϕ) = {a ∈ A | α_{2}(a) ∩ Mod_{𝔄}(ϕ) ≠ ∅}.
• Mod_{𝔄}(⋀ S) = ⋂_{ϕ∈S} Mod_{𝔄}(ϕ).

Thus, for each ϕ ∈ L(AtProp), we have Mod_{𝔄}(ϕ) ⊆ A. We calculate □_{𝔄} Mod_{𝔄}(ϕ), the (carrier of the) largest subcoalgebra of Mod_{𝔄}(ϕ). Note: this predicate over A should not be confused with the proposition □ϕ, where □ is defined as ¬♢¬ϕ in L(AtProp). As we will show, despite the syntactic similarity,

□_{𝔄} Mod_{𝔄}(ϕ) ≠ Mod_{𝔄}(□ϕ),

although the two are related.

Let →^{∗} be the reflexive and transitive closure of →. We extend the language L(AtProp) by adding a new modal operator ⊡. We extend the semantics to include this operator by adding the rule:

• a ⊧_{𝔄} ⊡ϕ iff, for all b such that a →^{∗} b, b ⊧ ϕ. In particular, a ⊧_{𝔄} ⊡ϕ

implies a ⊧_{𝔄} ϕ.

The proposition ⊡ϕ represents the condition that, not only is ϕ necessary, but ϕ is necessarily necessary and so on. Indeed, one can easily show

a ⊧_{𝔄} ⊡ϕ iff a ⊧_{𝔄} ⋀_{i<ω} □^{i}ϕ.

If the accessibility relation for 𝔄 is reflexive and transitive, then ⊡ϕ is equivalent to □ϕ.

We claim that

□_{𝔄} Mod_{𝔄}(ϕ) = Mod_{𝔄}(⊡ϕ).

First, suppose a ∈ Mod_{𝔄}(⊡ϕ) and a → b. Then, clearly, b ⊧_{𝔄} ⊡ϕ as well, so

α_{2}(a) ⊆ Mod_{𝔄}(⊡ϕ).

72 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

In other words, Mod_{𝔄}(⊡ϕ) is (the carrier of) a subcoalgebra of ⟨A, ⟨α_{1}, α_{2}⟩⟩. So, since

Mod_{𝔄}(⊡ϕ) ⊆ Mod_{𝔄}(ϕ),

we have

Mod_{𝔄}(⊡ϕ) ⊆ □_{𝔄} Mod_{𝔄}(ϕ).

To prove equality, one must show that Mod_{ϕ}(⊡ϕ) is the greatest subcoalgebra of ⟨A, ⟨α_{1}, α_{2}⟩⟩ contained in Mod_{𝔄}(ϕ).

Let ⟨B, ⟨β_{1}, β_{2}⟩⟩ be a subcoalgebra of ⟨A, ⟨α_{1}, α_{2}⟩⟩ such that B ⊆ Mod_{𝔄}(ϕ). To complete the proof, it suffices to show that B ⊆ Mod_{𝔄}(⊡ϕ). Let b ∈ B and suppose that b →^{∗} c. Then c ∈ B ⊆ Mod_{𝔄}(ϕ), so c ⊧_{𝔄} ϕ. Hence, b ⊧_{𝔄} ⊡ϕ and so b ∈ Mod_{𝔄}(⊡ϕ), as desired.

Example 2.2.19. Let ⟨A, O_{A}⟩ be a topological space and ⟨A, α⟩ the associated F-coalgebra (see Examples 1.1.12 and 2.2.2). Then U_{α}[−]_{α} is the interior operator. That is, if S ⊆ A, then U_{α}[S]_{α} is the largest open subset of S.

2.2.3. The structure of SubCoalg(⟨A, α⟩). In this section, we will show that, if RegSub(A) is a complete Heyting algebra, then so is SubCoalg(⟨A, α⟩). This is an indication that subcoalgebras are the “right” objects to consider as unary predicates in the category E_{Γ}. We extend this result to bisimulations in Section 2.5.

Throughout this section, we assume that E is regularly well-powered, almost coregular and cocomplete and that Γ:\xymatrix{E \ar[r] & E} preserves regular monos. Thus, by Theorem 2.2.7, the subcoalgebra forgetful functor

U_{α}:\xymatrix{SubCoalg(⟨A, α⟩) \ar[r] & RegSub(A)}

has a right adjoint, [−]_{α}. We further assume that Γ preserves pullbacks of regular monos.

Definition 2.2.20. A complete Heyting algebra is a complete lattice ⟨S, ∧, ⋁⟩ which satisfies the infinitary distributive law

s ∧ ⋁_{i∈I} t_{i} = ⋁_{i∈I}(s ∧ t_{i}).

Theorem 2.2.21. If RegSub(A) is a complete Heyting algebra, then so is the category SubCoalg(⟨A, α⟩).

Proof. The subcoalgebra forgetful functor U_{α} creates joins and finite meets, so SubCoalg(⟨A, α⟩) inherits the infinitary distributive law from RegSub(A). □

Definition 2.2.22. A Heyting algebra is a lattice with ⊤ and ⊥ such that ∧ has a right adjoint →.

Remark 2.2.23. Definition 2.2.20 is equivalent to the statement that S is a complete lattice which is a Heyting algebra.

Theorem 2.2.24. If RegSub(A) is a Heyting algebra, then so is SubCoalg(⟨A, α⟩).

Proof. We need to show that ∧ in SubCoalg(⟨A, α⟩) has a right adjoint. Let ⟨B, β⟩ and ⟨C, γ⟩ be subcoalgebras of ⟨A, α⟩. We calculate

⟨B, β⟩ ∧ ⟨C, γ⟩ ≤ ⟨D, δ⟩ iff B ∧ C ≤ D  since U_{α} creates meets,
iff B ≤ C → D  since − ∧ C ⊣ C → −,
iff ⟨B, β⟩ ≤ [C → D]_{α}  since U_{α} ⊣ [−]_{α}.
□

Remark 2.2.25. Theorem 2.2.24 implies that the negation for SubCoalg(⟨A, α⟩) is given as

¬⟨B, β⟩ = [¬B]_{α}.

Example 2.2.26. The category SubCoalg(⟨A, α⟩) is not usually boolean, even if RegSub(A) is boolean. Consider the functor ΓA = ℕ × A and the coalgebra ⟨A, α⟩ where A = {a, b} and

α(a) = ⟨17, b⟩,
α(b) = ⟨17, b⟩.

Let ⟨B, β⟩ be the subcoalgebra B = {b} and β(b) = α(b). Then

¬⟨B, β⟩ = [{a}]_{α} = ⟨0, !⟩,

so ⟨B, β⟩ ∨ ¬⟨B, β⟩ ≠ ⟨A, α⟩.

2.3. Subcoalgebras generated by a subobject

Let ⟨A, α⟩ be a Γ-algebra and P ⊆ A. If RegSub(A) is a complete lattice, then one can construct ⟨P ⟩, the least subalgebra of ⟨A, α⟩ containing P (see Theorem 1.3.6). This construction yields a left adjoint to the forgetful functor for subalgebras:

\xymatrix{Sub(A) \ar[rr]^{⟨−⟩} & ⊥ & SubAlg(⟨A, α⟩) \ar[ll]^{U}} .

As we’ve shown, the coalgebraic analogue for ⟨−⟩ is [−], a right adjoint to the subcoalgebra forgetful functor. Whereas, in categories of algebras, a closure operation naturally arises (by closing a subobject under the algebraic operations), in categories of coalgebras, an interior operation is the “natural” operation.

Nonetheless, for certain functors Γ:\xymatrix{E \ar[r] & E}, there is a left adjoint

⟨−⟩_{α}:\xymatrix{Sub(A) \ar[r] & SubCoalg(⟨A, α⟩)}

74 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

to the forgetful functor, taking a subobject to the least subcoalgebra containing it. We describe the operation here.

The following theorem is almost an immediate corollary of Theorem 1.2.7 (U creates whatever limits Γ preserves). The weakening of the assumption that Γ preserves intersections to just Γ preserves non-empty intersections requires a bit of work to ensure that it goes through, but as one can see, the work is really just the proof of Theorem 1.2.7 again.

The use of non-empty intersections for categories of coalgebras first appears in the work of Gumm and Schröder, as seen in [Gum01b].

Theorem 2.3.1. If Γ preserves regular monos non-empty κ-intersections, then

U:\xymatrix{E_{Γ} \ar[r] & E}

creates κ-intersections of regular subcoalgebras.

Proof. Let {⟨C_{i}, γ_{i}⟩}_{i<κ} be a family of regular subcoalgebras of ⟨B, β⟩. If ⋂ C_{i} = 0, then clearly

⋂⟨C_{i}, γ_{i}⟩ = ⟨0, !⟩.

Otherwise, let C be the intersection of the C_{i}’s, with inclusions

c_{i}:[figure: C; C_{i}].

Then, ΓC is the limit of the ΓC_{i}’s, with the Γc_{i}’s forming a limiting cone. Since the maps

γ_{i} ∘ c_{i}:\xymatrix{C \ar[r] & ΓC_{i}}

form a cone for C over the ΓC_{i}’s, there is a unique structure map \xymatrix{γ \ar[r]^{C} & ΓC} such that each c_{i} is a homomorphism.

It is routine to check that, for any regular subcoalgebra ⟨A, α⟩ of ⟨B, β⟩ contained in each of the ⟨C_{i}, γ_{i}⟩’s, the inclusion

A ≤ ⋂ C_{i}

is a homomorphism. For this, we use the fact that Γ preserves regular monos. □

Example 2.3.2. The filter functor F doesn’t preserve non-empty intersections. Indeed, from Example 1.1.12, we learn that the category of topological spaces and open, continuous maps is a subcategory of Set_{F}. The open subsets of a space form the subcoalgebras when we view the space as a filter coalgebra, but open sets are typically not closed under intersection.

Theorem 2.3.3. Let E be almost co-regular, regularly well-powered and have coproducts and let Γ preserve regular monos. Let ⟨A, α⟩ ∈ E_{Γ}. The following are equivalent.

2.3. SUBCOALGEBRAS GENERATED BY A SUBOBJECT 75

(1) U_{α}:\xymatrix{SubCoalg(⟨A, α⟩) \ar[r] & RegSub(A)} creates intersections.

(2) U_{α} has a left adjoint, ⟨−⟩_{α}.

(3) (Assuming E is well-pointed) For each global element a ∈ A, there is a least subcoalgebra containing a (denoted ⟨a⟩_{α}).

Proof. We prove that (1) and (2) are equivalent. Clearly, ( 2) implies ( 3). We complete the proof by assuming that E is well-pointed and show that ( 3) implies ( 2).

(1) ⇒( 2): Let P ≤ A and define ⟨P ⟩_{α} to be the meet

⋀_{P ≤B}⟨B, β⟩

in SubCoalg(⟨A, α⟩). The proof that ⟨−⟩_{α} ⊣ U_{α} is essentially the same as that in Theorem 1.3.6.

( 2)⇒(1): Let {⟨B_{i}, β_{i}⟩}_{i∈I} ⊆ SubCoalg(⟨A, α⟩). We will show that

(7)  ⋀_{i∈I}⟨B_{i}, β_{i}⟩ = ⟨⋀_{i∈I} B_{i}⟩_{α},
(8)  U_{α}⟨⋀_{i∈I} B_{i}⟩_{α} = ⋀_{i∈I} B_{i}.

Since ⋀_{i∈I} B_{i} ≤ B_{i}, we have

⟨⋀_{i∈I} B_{i}⟩_{α} ≤ ⟨B_{i}⟩_{α} = ⟨B_{i}, β_{i}⟩.

Now, let ⟨C, γ⟩ ≤ ⟨B_{i}, β_{i}⟩ for all i ∈ I. Then C ≤ ⋀_{i∈I} B_{i}. Hence,

⟨C, γ⟩ = ⟨C⟩_{α} ≤ ⟨⋀_{i∈I} B_{i}⟩_{α},

and so (7) holds.

For (8), we use the unit of the adjunction ⟨−⟩_{α} ⊣ U_{α} to conclude

⋀_{i∈I} B_{i} ≤ U_{α}⟨⋀_{i∈I} B_{i}⟩_{α}.

Since ⟨⋀_{i∈I} B_{i}⟩_{α} ≤ ⟨B_{i}, β_{i}⟩ for all i, we have U_{α}⟨⋀_{i∈I} B_{i}⟩_{α} ≤ B_{i} for all i. Hence, U_{α}⟨⋀_{i∈I} B_{i}⟩_{α} ≤ ⋀_{i∈I} B_{i}.

(3)⇒( 2): Let P ≤ A. We define ⟨P ⟩_{α} = ⋁_{a∈P} ⟨a⟩_{α} (where each a is a global element of P). Because E is well-pointed,

P = ⋁_{a∈P} a ≤ ⋁_{a∈P} U_{α}⟨a⟩_{α} = U_{α} ⋁_{a∈P}⟨a⟩_{α}.

Hence, if ⟨P ⟩_{α} ≤ ⟨C, γ⟩, then P ≤ U_{α}⟨P ⟩_{α} ≤ C.

76 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

Let ⟨C, γ⟩ ≤ ⟨A, α⟩ and P ≤ C. We must show that ⟨P ⟩_{α} ≤ ⟨C, γ⟩. For each global element a ∈ P, also a ∈ C. Thus, for each a, ⟨a⟩_{α} ≤ ⟨C, γ⟩ and

so ⋁_{a∈P} ⟨a⟩_{α} ≤ ⟨C, γ⟩.
□

Theorem 2.3.4. Let ⟨−⟩_{α} ⊣ U_{α}. The composite

⟨−⟩_{α} ∘ U_{α}

is the identity \xymatrix{SubCoalg(⟨A, α⟩) \ar[r] & SubCoalg(⟨A, α⟩)}.

Proof. By the adjunction ⟨−⟩_{α} ⊣ U_{α}, we have ⟨−⟩_{α} ∘ U_{α} ≤ 1. Also by the adjunction, we have

U_{α} ≤ U_{α} ∘ ⟨−⟩_{α} ∘ U_{α}

and U_{α} is full (Theorem 2.2.4). □

On the other hand, U⟨⟩ is a non-trivial closure operator, which we denote ◁, taking a subobject A ≤ U⟨B, β⟩ to its closure under the structure map β. We see that we have another adjunction, ◁⊣ □. This closure operator is also discussed in [Gum01b, Jac99].

Example 2.3.5. Let Γ:\xymatrix{Set \ar[r] & Set} be the functor A ↦ Z ×A (see Example 1.1.7). Let ⟨A, α⟩ be a Γ-coalgebra and a ∈ A. Then it is easy to see that

U_{α}⟨a⟩_{α} = {t_{α}^{i} | i < ω}.

In other words, we close {a} under the tail operation, t.

More generally, if ℙ is any polynomial functor,

ℙ(A) = ∐_{i<ω} Z_{i} × A^{i},

we can define ⟨a⟩_{α} to be the collection of all b ∈ A such that there is a path from a to b via the structure map α. To make this precise, define a relation → on A by

b→c iff α(b) ∈ Z_{i} × A^{i} and ∃j < i(π_{j} ∘ α(b) = c).

Let →^{∗} be the reflexive and transitive closure of →. We claim that

U_{α}⟨a⟩_{α} = {b | a →^{∗} b}.

We show that ⟨a⟩_{α} (by this definition) is a subcoalgebra of ⟨A, α⟩. Let a →^{∗} b and

α(b) = ⟨z, ⟨b_{1}, …, b_{i−1}⟩⟩.

Then a →^{∗} b for each b_{j} (j < i), so ⟨z, ⟨b_{1}, …, b_{i−1}⟩⟩ ∈ Γ⟨a⟩_{α}. In other words, ⟨a⟩_{α} is closed under the structure map α.

It is easy to check that ⟨a⟩_{α} ≤ ⟨C, γ⟩ iff a ∈ C for all ⟨C, γ⟩ ≤ ⟨A, α⟩.

2.4. LIMITS IN CATEGORIES OF COALGEBRAS REVISITED 77

Example 2.3.6. Let Γ = P(AtProp) × P− from Examples 1.1.10 and 2.2.18. In Example 2.2.18, we defined →^{∗} as the transitive and reflexive closure of the accessibility relation, →. It is easy to see that, for any Γ-coalgebra 𝔄 = ⟨A, ⟨⟩, α_{1}⟩α_{2},

U_{𝔄}⟨a⟩_{𝔄} = {b | a →^{∗} b}.

This operation doesn’t yield a “natural” operation on Mod_{𝔄}(ϕ) like □_{𝔄} did. One calculates

U_{𝔄}⟨Mod_{𝔄}(ϕ)⟩_{𝔄} = {b | ∃a . a ⊧ ϕ and a →^{∗} b},

which seems a less interesting collection — one which is not expressible in terms of the modal operations of the language L(AtProp).

One has the impression that ⟨−⟩_{α} is often definable as a closure of a relation → like those found in Examples 2.3.5 and 2.3.6. It is difficult to make this intuition precise, since it involves defining an accessibility relation for a class of functors. In Example 2.3.5, we use the inductive definition of polynomial functors for the definition of →. We can extend this class to include functors which are built from P in addition to constant and identity functors by + and ×, as in Example 2.3.6. It is unclear how to do this for a class of functors generally^{4} — the inductive construction of the functor seems to play a key role in the definition of →.

2.4. Limits in categories of coalgebras revisited

The presence of a right adjoint to the coalgebraic forgetful functor allows one to construct limits in the category of coalgebras, E_{Γ}, given that the corresponding limits exist in E. We present here essentially a generalization of the proof that Set_{Γ} is complete if Γ is a covarietor, as found in [GS01].

While developing limits in categories of coalgebras, we also sketch the corresponding proofs that categories of algebras have colimits. However, we sometimes prefer to strengthen the assumptions on the algebraic theorems, so that we may reason about congruences (rather than a closure operator on quotients). This preference comes from a desire to explicitly see how reasoning about E^{Γ} comes directly from proofs about universal algebras, and categories of universal algebras do satisfy these stronger assumptions. In any case, we make clear that the theorem holds under the weaker assumptions as well, and also present the basic concepts necessary to prove it there.

4For similar reasons, Bart Jacobs focuses on inductively specified classes of functors in [Jac99] and elsewhere.

78 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

2.4.1. Equalizers in E_{Γ}, coequalizers in E^{Γ}. Equalizers of coalgebras was first discussed in [Wor98], where Worrell proves that equalizers exist when one-generated subcoalgebras exist and Γ is bounded (see Definition 3.7.20). The theorem below is a generalization of [GS01, Theorem 5.1], where it is proved for coalgebras over Set. A general proof of the completeness of E_{Γ}, given that E is complete and certain other assumptions, can be found in [JPT^{+}98] as well as [GS01].

Theorem 2.4.1. Let E be regularly well-powered, cocomplete, have equalizers and epi-regular mono factorizations and let Γ preserve regular monos. Then E_{Γ} has all equalizers.

Proof. Let

\xymatrix{⟨A, α⟩ \ar[r]^{f} \ar[r]_{g} & ⟨B, β⟩}

be given and take the equalizer [figure: P; A] of Uf and Ug in E. Then, [P]_{α} is the equalizer of f and g in E_{Γ}. Indeed, if h is a homomorphism that equalizes f and g, then Uh factors through P. From Corollary 2.2.9, we conclude that h factors through [P]_{α}. Uniqueness easily follows. □

Theorem 2.4.2. Let E be regularly co-well-powered, complete and have all coequalizers and regular epi-mono factorizations and let Γ preserve regular epis. Then, E^{Γ} has all coequalizers.

Proof. We sketch the proof. Let Quot(B) denote the category of quotients of B, i.e., Quot(B) consists of equivalence classes of regular epis. Let Quot(⟨B, β⟩) be the corresponding category of quotients in E^{Γ}. Show that there is a functor

Θ:\xymatrix{Quot(B) \ar[r] & Quot(⟨B, β⟩)}

left adjoint to the evident inclusion [figure: Quot(⟨B, β⟩); Quot(B)]. Specifically, given \xymatrix{B \ar@{|->}[r] & Q} be given. Define ΘQ to be the regular epi-mono factorization of the evident map \xymatrix{⟨B, β⟩ \ar[r] & ⟨Q′, ν⟩}, where ⟨Q′, ν⟩ is the limit of

\{\xymatrix{⟨B, β⟩ \ar@{|->}[r] & ⟨P, ρ⟩} | P ∈ Quot(Q)\}.

This is the formal dual of the construction of [−], of course.

Show that, if Q is the coequalizer of U( \xymatrix{⟨A, α⟩ \ar[r] \ar[r] & ⟨B, β⟩} ), then ΘQ is the coequalizer of \xymatrix{⟨A, α⟩ \ar[r] \ar[r] & ⟨B, β⟩} .

An equivalent proof in a more restrictive setting may seem more familiar. Suppose, in addition to our other assumptions, that E is exact and that Γ preserves exact sequences. Given

\xymatrix{⟨A, α⟩ \ar[r]^{f} \ar[r]_{g} & ⟨B, β⟩} ,

2.4. LIMITS IN CATEGORIES OF COALGEBRAS REVISITED 79

take the kernel pair K of the coequalizer of f and g in E, and then take the least congruence \overline{K} containing K, according to Theorem 1.4.13. Since E^{Γ} is also exact (by Theorem 1.4.11), we can take the coequalizer ⟨Q, ν⟩ of \overline{K}. It is little work to show that ⟨Q, ν⟩is also the coequalizer of f and g. □

2.4.2. Products in E_{Γ}, coproducts in E^{Γ}. We find Theorems 2.4.3 and 2.4.6 in [GS01], where they are proved for coalgebras over Set. We extend the theorems to categories E which have a suitable structure inherited by E_{Γ}, for appropriate functors Γ.

Theorem 2.4.3. Let E be cocomplete, κ-complete, regularly well-powered and have epi-regular mono factorizations and let Γ preserve regular monos. Let {⟨A_{i}, α_{i}⟩}_{i<κ} be Γ-coalgebras and assume that ∏⟨A_{i}, α_{i}⟩ exists. We’ll denote this product ⟨D, δ⟩ with projections

d_{i}:\xymatrix{⟨D, δ⟩ \ar[r] & ⟨A_{i}, α_{i}⟩}.

Let

{c_{i}:[figure: ⟨C_{i}, γ_{i}⟩; ⟨A_{i}, α_{i}⟩]}_{i<κ}

be a family of regular subcoalgebras of the ⟨A_{i}, α_{i}⟩’s. Then the product ∏ ⟨C_{i}, γ_{i}⟩ exists in E_{Γ}.

Proof. Let P be the pullback (in E) shown below.

[figure: P; p_{1}; p_{2}; D; ⟨d_{i}⟩; ∏ C_{i}; ∏ c_{i}; ∏ A_{i}]

We will show that [P]_{δ}, the largest regular subcoalgebra of ⟨D, δ⟩ contained in P, is the product of the ⟨C_{i}, γ_{i}⟩’s. We claim that the projections

r_{i}:\xymatrix{[P] \ar[r] & ⟨C_{i}, γ_{i}⟩}

are given by the composite

[figure: [P]; j; P; p_{1}; ∏ C_{i}; π_{i}; C_{i},]

but we must first establish that this composite is a coalgebra homomorphism. For this, we refer to Figure 6. We want to show that the front face of this diagram commutes. We use the fact that Γc_{i}:\xymatrix{ΓC_{i} \ar[r] & ΓA_{i}} is a (regular) mono and show that

Γc_{i} ∘ Γ(π_{i} ∘ p_{1} ∘ j ∘ ρ) = Γc_{1} ∘ γ_{i} ∘ π_{i} ∘ p_{1} ∘ j,

where ρ is the structure map for the coalgebra [P]. The squares on each end and the rectangle in back commute because the maps along the bottom (c_{i}, p_{2} ∘ j and

[figure: ΓD; Γ ∏ A_{i}; ΓA_{i}; ΓU[P]; ΓP; Γ ∏ C_{i}; ΓC_{i}; D; ∏ A_{i}; A_{i}; U[P]; P; ∏ C_{i}; C_{i}]

Figure 6. The projection r_{i}:\xymatrix{U[P] \ar[r] & C_{i}} is a Γ-homomorphism.

π_{i} ∘ ⟨d_{i}⟩ = d_{i}, respectively) are coalgebra homomorphisms. The right hand square on the bottom face commutes by naturality, while the left hand square is a pullback.

To show that [P] is a product, let ⟨B, β⟩ be a Γ-coalgebra and let a family of homomorphisms \{f_{i}:\xymatrix{⟨B, β⟩ \ar[r] & ⟨C_{i}, γ_{i}⟩}\}_{i<κ} be given. Then, by the definition of P, there is a unique map \xymatrix{B \ar[r] & P} so that the diagram below commutes.

[figure: B; ⟨f_{i}⟩; U⟨c_{i}∘f_{i}⟩; P; p_{1}; p_{2}; D; ⟨d_{i}⟩; ∏ C_{i}; ∏ c_{i}; ∏ A_{i}]

By Corollary 2.2.9, we get a factorization of \xymatrix{B \ar[r] & P} through [P]. Uniqueness easily follows. □

For many functors of interest, the step of applying [−] to P is unnecessary. The following theorem shows that, if Γ preserves non-empty intersections, then [P] = P. In particular, for finite products, if Γ preserves weak pullbacks, then the carrier for the product ∏⟨C_{i}, γ_{i}⟩ is just P.

Corollary 2.4.4. Let E, Γ, {⟨A_{i}, α_{i}⟩}, etc., be given as in the statement of Theorem 2.4.3 and suppose, further, that Γ preserves pullbacks along regular monos

[figure: P; P_{2}; C_{2}; P_{1}; D; A_{2}; C_{1}; A_{1}]

Figure 7. P is an intersection of the P_{i}’s.

and non-empty κ-intersections. Then, the pullback

[figure: P; p_{1}; p_{2}; D; ⟨d_{i}⟩; ∏ C_{i}; ∏ c_{i}; ∏ A_{i}]

is invariant under [−] ([P] = P). In fact, there is a (necessarily unique) structure map

ρ:\xymatrix{P \ar[r] & ΓP}

such that

⟨P, ρ⟩ = ∏ ⟨C_{i}, γ_{i}⟩.

Proof. For each i, let P_{i} be the pullback shown below.

[figure: P_{i}; D; d_{i}; C_{i}; c_{i}; A_{i}]

Because Γ preserves pullbacks along regular monos, U creates such pullbacks. Hence, each P_{i} is invariant. One can show that P is the intersection of the P_{i}’s (see Figure 7 for an illustration of the case κ = 2). Theorem 2.3.1 completes the proof. □

The following theorem dualizes the result of Theorem 2.4.3.

Theorem 2.4.5. Let E be complete, κ-cocomplete, regularly co-well-powered and have regular epi-mono factorizations and let Γ preserve regular epis. Let {⟨A_{i}, α_{i}⟩}_{i<κ} be Γ-algebras and assume that ∐⟨A_{i}, α_{i}⟩ exists. Let

\{ \xymatrix{⟨A_{i}, α_{i}⟩ \ar@{|->}[r] & ⟨C_{i}, γ_{i}⟩} \}_{i<κ}

be a family of quotients of the ⟨A_{i}, α_{i}⟩’s. Then the coproduct ∐ ⟨C_{i}, γ_{i}⟩ exists in E_{Γ}.

82 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

Proof. The proof of the theorem as stated is just the dualization of Theorem 2.4.3, using the functor Θ defined in the proof that E^{Γ} has coequalizers (Theorem 2.4.2). Instead of explicitly dualizing the theorem, we prefer to sketch the proof using congruences in the case that E is exact and Γ preserves exact sequences, so that E^{Γ} is also exact (Theorem 1.4.11). We also restrict our interest to the case κ = 2, just to simplify notation.

By assumption, we have a pair of regular epis

p:\xymatrix{⟨A, α⟩ \ar@{|->}[r] & ⟨C, γ⟩},
q:\xymatrix{⟨B, β⟩ \ar@{|->}[r] & ⟨D, δ⟩}

and the coproduct ⟨A, α⟩ + ⟨B, β⟩ exists in E^{Γ}. Let K be the kernel pair of p + q, shown below.

\xymatrix{K \ar[r] \ar[r] & A + B \ar@{|->}[r]^{p+q} & C + D}

We would like to take the smallest congruence containing K, but K is not necessarily a relation on U(⟨A, α⟩ + ⟨B, β⟩). So, we first take the coequalizer

\xymatrix{U(⟨A, α⟩ + ⟨B, β⟩) \ar@{|->}[r]^{r} & R}

of the diagram below.

\xymatrix{K \ar[r] \ar[r] & A + B \ar[r] & U(⟨A, α⟩ + ⟨B, β⟩)}

Then, we take the kernel pair of r,

\xymatrix{L \ar[r] \ar[r] & U(⟨A, α⟩ + ⟨B, β⟩).}

We claim that ⟨C, γ⟩ + ⟨D, δ⟩ is the coequalizer of the least congruence containing L, but we omit the proof. □

Theorem 2.4.6. Let E be cocomplete, κ-complete, regularly well-powered and have epi-regular mono factorizations. Let Γ preserve regular monos. Suppose further that U:\xymatrix{E_{Γ} \ar[r] & E} has a right adjoint H (i.e., Γ is a covarietor). Then E_{Γ} has κ-products.

Proof. Let H be the right adjoint to U and let {⟨A_{i}, α_{i}⟩}_{i<κ} be a κ-family of coalgebras. Then, from Corollary 2.1.16, each ⟨A_{i}, α_{i}⟩ is a regular subalgebra of the HA_{i}. Because H is a right adjoint, it preserves limits and so

H(∏ A_{i}) ≅ ∏ HA_{i}.

Hence, ∏ HA_{i} exists in E_{Γ} and we can apply Theorem 2.4.3. □

Corollary 2.4.7. If E is cocomplete, κ-complete, regularly well-powered and has epi-regular mono factorizations, Γ a covarietor that preserves regular monos, then E_{Γ} is κ-complete.

2.4. LIMITS IN CATEGORIES OF COALGEBRAS REVISITED 83

Theorem 2.4.6 shows that, given a right adjoint to the coalgebraic forgetful functor (and the conditions of Theorem 2.4.3), the category E_{Γ} has products. The algebraic analogue to Theorem 2.4.6 states that, if free algebras are available, then E^{Γ} has coproducts. This fact is well-known in the study of universal algebras. We state the theorem in the same generality as Theorem 2.4.6.

Theorem 2.4.8. Let E be complete, κ-cocomplete, regularly co-well-powered and have regular epi-mono factorizations and let Γ a varietor that preserves regular epis. Then E^{Γ} is κ-cocomplete.

Proof. Essentially the same as Theorem 2.4.6. We have coproducts of free algebras, and each algebra is the quotient of a free algebra. □

The next theorem shows some equivalent constructions of the product of coalgebras.

Theorem 2.4.9. Let E, Γ and H be given as in Theorem 2.4.6 and let

{⟨A_{i}, α_{i}⟩}_{i<κ}

be a κ-family of coalgebras. Then the following are equivalent.

(1) ⟨B, β⟩ ≅ ∏⟨A_{i}, α_{i}⟩

(2) ⟨B, β⟩ = [P]_{∏ HA_{i}}, where P is the pullback shown below.

[figure: P; p_{2}; p_{1}; UH(∏ A_{i}); ⟨UHπ_{i}⟩; ∏ A_{i}; ∏ Uη_{α_{i}}; ∏ UHA_{i}] (9)

(3) ⟨B, β⟩ is the largest regular subcoalgebra of H ∏ A_{i} such that, for every i ∈ I,

[figure: B; UH ∏ A_{i}; ε_{∏ A_{i}}; ∏ A_{i}; π_{i}; A_{i}]

is a Γ-homomorphism.

(4) ⟨B, β⟩ fits into a pullback as shown below.

[figure: ⟨B, β⟩; ∏ HA_{i}; ∏ HUη_{α_{i}}; ∏ HA_{i}; ∏ η_{HA_{i}}; ∏ HUHA_{i}]

(5) ⟨B, β⟩ = [E]_{∏ HA_{i}}, where E is the equalizer of the diagram below.

\xymatrix{U(∏ HA_{i}) \ar[r]^{∏ Uη_{α_{i}}∘ε_{∏ A_{i}}} \ar[r]_{⟨UHπ_{i}⟩} & ∏ UHA_{i}}

Proof. We prove (1)⇔(2), (1)⇔(3), (2)⇔(4) and (2)⇔(5).

(1)⇔(2): This was proven in Theorem 2.4.6, as a corollary to Theorem 2.4.3. (1)⇔(3): Let ⟨B, β⟩ be the product ∏⟨A_{i}, α_{i}⟩, with projections b_{i}. Then

Ub_{i} = ε_{A_{i}} ∘ Uη_{α_{i}} ∘ Ub_{i}
= ε_{A_{i}} ∘ UHπ_{i} ∘ U ∏ η_{α_{i}}
= π_{i} ∘ ε_{∏ A_{i}} ∘ U ∏ η_{α_{i}},

so, since each η_{α_{i}} is a regular mono, ⟨B, β⟩ is a regular subcoalgebra of H ∏ A_{i}, with the composite

[figure: B; UH ∏ A_{i}; ∏ A_{i}; A_{i}]

a homomorphism.

Let j:[figure: ⟨D, δ⟩; H ∏ A_{i}] be given and assume that, for each i ∈ I, the composite π_{i} ∘ ε_{∏ A_{i}} ∘ Uj is a homomorphism. Then, because ⟨B, β⟩ is the product of the ⟨A_{i}, α_{i}⟩’s, there is a unique homomorphism

k:\xymatrix{⟨D, δ⟩ \ar[r] & ⟨B, β⟩}

such that, for each i,

Ub_{i} ∘ Uk = π_{i} ∘ ε_{∏ A_{i}} ∘ Uj.

Using the previous calculation, we see

π_{i} ∘ ε_{∏ A_{i}} ∘ U ∏ η_{α_{i}} ∘ Uk = π_{i} ∘ ε_{∏ A_{i}} ∘ Uj.

Hence, ∏ η_{α_{i}} ∘ k = j, and ⟨D, δ⟩ ≤ ⟨B, β⟩, as desired. (2)⇔(4): Suppose that ⟨B, β⟩ = ∏⟨A_{i}, α_{i}⟩. By the proof of Theorem 2.4.6, we see that ⟨B, β⟩ = [P]_{∏ HA_{i}}, where P is the pullback shown in (9).

In Theorem 2.2.11, we showed that the left hand square in Figure 8 is a pullback. Because the right hand square is just H applied to (9), it is also a pullback and so the rectangle is a pullback.

[figure: ⟨B, β⟩; b_{1}; b_{2}; HP; Hp_{2}; Hp_{1}; H ∏ A_{i}; H ∏ Uη_{α_{i}}; H ∏ A_{i}; η_{H ∏ A_{i}}; HUH ∏ A_{i}; H⟨UHπ_{i}⟩; H ∏ UHA_{i}]

Figure 8. ∏⟨A_{i}, α_{i}⟩ as a composite of two pullbacks in E_{Γ}.

2.4. LIMITS IN CATEGORIES OF COALGEBRAS REVISITED 85

A simple calculation confirms that the composite along the bottom is ∏ η_{HA_{i}}.

H⟨UHπ_{i}⟩ ∘ η_{H ∏ A_{i}} = ⟨HUHπ_{i} ∘ η_{H ∏ A_{i}}⟩
= ⟨η_{HA_{i}} ∘ Hπ_{i}⟩
= ∏ η_{HA_{i}} ∘ H⟨π_{i}⟩ = ∏ η_{HA_{i}}.

Conversely, if ⟨B, β⟩ is the pullback of ∏ η_{HA_{i}} along ∏ HUη_{α_{i}}, then there is a unique b_{1} making the diagram in Figure 8 commute. Since the rectangle and the right hand square are pullbacks, so is the left hand square. Hence, ⟨B, β⟩ = [P] and thus ⟨B, β⟩ ≅ ∏⟨A_{i}, α_{i}⟩. (2)⇔(5): Let P be the pullback of ⟨UHπ_{i}⟩ along ∏ Uη_{α_{i}}, and let E be the equalizer of ⟨UHπ_{i}⟩ and ∏ Uη_{α_{i}} ∘ ε_{∏ A_{i}}. To show that P ≅ E, it suffices to show that p_{1} equalizes ⟨UHπ_{i}⟩ and ∏ Uη_{α_{i}} ∘ ε_{∏ A_{i}} (see Figure 9).

[figure: P; p_{1}; p_{2}; UH ∏ A_{i}; ⟨UHπ_{i}⟩; ε_{∏ A_{i}}; ∏ A_{i}; ∏ Uη_{α_{i}}; ∏ UHA_{i}; ∏ ε_{A_{i}}]

Figure 9. ∏⟨A_{i}, α_{i}⟩ as an equalizer.

For this, we use the fact that, for every i ∈ I,

π_{i} ∘ ε_{∏ A_{i}} = ε_{A_{i}} ∘ UHπ_{i} = π_{i} ∘ ∏ ε_{A_{i}} ∘ ⟨UHπ_{i}⟩,

and, hence, ε_{∏ A_{i}} = ∏ ε_{A_{i}} ∘ ⟨UHπ_{i}⟩. Thus, we have

∏ Uη_{α_{i}} ∘ ε_{∏ A_{i}} ∘ p_{1} = ∏ Uη_{α_{i}} ∘ ∏ ε_{A_{i}} ∘ ⟨UHπ_{i}⟩ ∘ p_{1}
= ∏ Uη_{α_{i}} ∘ ∏ ε_{A_{i}} ∘ ∏ Uη_{α_{i}} ∘ p_{2}
= ∏ Uη_{α_{i}} ∘ p_{2} = ⟨UHπ_{i}⟩ ∘ p_{1}.
□

Example 2.4.10. We consider the functor

P_{fin} :\xymatrix{Set \ar[r] & Set}

which takes a set A to the set of finite subsets of A. This functor preserves weak pullbacks and hence it preserves regular monos. We will calculate the product of two

[figure: a; b; w; x; c; z; y]

Figure 10. A graph representation of ⟨A, α⟩ and ⟨X, χ⟩.

simple P_{fin}-coalgebras. Although we do this in considerable detail here, in practice it is often quite simple. In particular, if a functor preserves pullbacks, then the product is easily calculated. This extended example will show how one actually uses many of the tools we’ve developed (embeddings into cofree coalgebras, the [−] operator, etc.) to reason about coalgebras.

Recall that the product of coalgebras is constructed as a regular subcoalgebra of the product of the corresponding cofree coalgebras. Accordingly, in order to calculate this product, we first discuss the cofree P_{fin}-coalgebras. In order to ease the presentation, we use non-well-founded set theory. In the terms of NWF, it is easy to describe the cofree P_{fin}-coalgebra over A: It is the set UHA such that

UHA = A × P_{fin}(UHA).

The structure map for this coalgebra, as usual, is the identity function. In particular, the final P_{fin}-coalgebra is the set of hereditarily finite (non-well-founded) sets.

We consider two uncomplicated coalgebras. Let A be the set {a, b, c and X the set \{w, x, y, z\}. We define the structure maps α:\xymatrix{A \ar[r] & P_{fin}A} and χ:\xymatrix{X \ar[r] & P_{fin}X} as follows:

α(a) = ∅,  χ(w) = ∅,
α(b) = {b},  χ(x) = {x},
α(c) = {b, c},  χ(y) = {x, y},
χ(z) = {w, z}.

One calculates the units η_{α}:\xymatrix{⟨A, α⟩ \ar[r] & HA} and η_{χ}:\xymatrix{⟨X, χ⟩ \ar[r] & HX} thus:

η_{α}(a) = ⟨a, ∅⟩,  η_{χ}(w) = ⟨w, ∅⟩,
η_{α}(b) = ⟨b, S_{b}⟩,  η_{χ}(x) = ⟨x, S_{x}⟩,
η_{α}(c) = ⟨c, S_{c}⟩,  η_{χ}(y) = ⟨y, S_{y}⟩,
η_{χ}(z) = ⟨z, S_{z}⟩,

where

S_{b} = {⟨b, S_{b}⟩},
S_{c} = {⟨c, S_{c}⟩, ⟨b, S_{b}⟩},
S_{x} = {⟨x, S_{x}⟩},
S_{y} = {⟨x, S_{x}⟩⟨y, S_{y}⟩},
S_{z} = {⟨w, ∅⟩, ⟨z, S_{z}⟩}.

The evident map

⟨e_{A}, e_{X}⟩:\xymatrix{U(HA × HX) ≅ UH(A × X) \ar[r] & UHA × UHX}

is also easily described. The set UH(A × X) satisfies the equation

UH(A × X) = A × X × P_{fin}(UH(A × X)).

Let ⟨s, t, S⟩ ∈ A × X × P_{fin}(UH(A × X)). Then,

⟨e_{A}, e_{X}⟩(⟨s, t, S⟩) = ⟨⟨s, S_{A}⟩, ⟨t, S_{X}⟩⟩,

where S_{A} is the image of S under e_{A} and S_{X} the image of S under e_{X}. In other words,

S_{A} = P_{fin}e_{A}(S),
S_{X} = P_{fin}e_{X}(S).

Recall the definition of the set P from the proof of Theorem 2.4.3. From the definition of P as a pullback, we see that

P = {⟨s, t, S⟩ ∈ UH(A × X) | ⟨e_{A}, e_{X}⟩(⟨s, t, S⟩) ∈ Im(η_{A} × η_{X})}.

Because A and X are such small sets, it is not difficult to calculate P directly. Suppose, for some t ∈ X, S ⊆ UH(A × X), the triple ⟨a, t, S⟩ is in P. Then,

e_{A}(⟨a, t, S⟩) = ⟨a, P_{fin}e_{A}(S)⟩ = η_{α}(a) = ⟨a, ∅⟩,

and so, S is empty. Since this entails that χ(t) = ∅, we conclude that t = w. Similarly, the only triple of the form ⟨s, w, S⟩ is the triple ⟨a, w, ∅⟩.

Suppose that ⟨s, z, S⟩ is in P for some s ∈ A and S ⊆ UH(A × X). Then, with a little work, one can show that ⟨a, w, ∅⟩ is in S. This entails that a ∈ α(s), yielding a contradiction. Thus, there is no triple of the form ⟨s, z, S⟩ in P.

Let S ⊆ UH(A × X) be given. Then, ⟨b, x, S⟩ is in P iff

P_{fin}e_{A}(S) = S_{b} = {⟨b, S_{b}⟩},
P_{fin}e_{X}(S) = S_{x} = {⟨x, S_{x}⟩}.

88 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

These equations hold just in case S ≠ ∅ and, for all ⟨u, v, T ⟩ in S,

e_{A}(⟨u, v, T ⟩) = ⟨b, S_{b}⟩,
e_{X}(⟨u, v, T ⟩) = ⟨x, S_{x}⟩.

Thus, ⟨b, x, S⟩ ∈ P iff S ≠ ∅ and, for all ⟨u, v, T ⟩ ∈ S, u = b, t = x and ⟨u, v, T ⟩ ∈ P. We will use this fact to show that there is only one set S such that ⟨b, x, S⟩ ∈ P.

We do this by using the principle of coinduction for the cofree coalgebra^{5} H(A × X). We will show that, if ⟨b, x, S⟩ and ⟨b, x, S′⟩ are in P, then there is a coalgebraic relation

⟨R, ρ⟩ ∈ Rel_{E_{A×X×P_{fin}}}(H(A × X))

relating ⟨b, x, S⟩ and ⟨b, x, S′⟩. Since H(A × X) is the final A × X × P_{fin}-coalgebra, we may conclude ⟨b, x, S⟩ = ⟨b, x, S′⟩ (since equality is the largest relation on H(A× X)).

We discuss relations on coalgebras and the related notion of bisimulation in more detail in Section 2.5. For now, it suffices to note that a relation R on UH(A×X) is the carrier for a relation on H(A × X) (in E_{A×X×P_{fin}}) if, whenever ⟨s, t, T ⟩ R ⟨s′, t′, T′⟩, then

• s = s′,

• t = t′,

• for each u ∈ T, there is a u′ ∈ T′ such that u R u′ and

• for each u′ ∈ T′, there is a u ∈ T such that u R u′. Let R be the relation such that ⟨s, t, T ⟩ R ⟨s′, t′, T′⟩ holds iff

• s = s′ = b,

• t = t′ = x and

• ⟨b, x, T ⟩ and ⟨b, x, T′⟩ are in P. Then, one may show that R is (the carrier of) a coalgebraic relation. Thus, there is at most one set S such that ⟨b, x, S⟩ ∈ P.

Let S_{b,x} satisfy the equation

S_{b,x} = {⟨b, x, S_{b,x}⟩}.

A simple calculation verifies that ⟨b, x, S_{b,x}⟩ is in P.

A similar argument shows that ⟨b, y, S⟩ ∈ P iff S = S_{b,y}, where

S_{b,y} = {⟨b, x, S_{b,x}⟩, ⟨b, y, S_{b,y}⟩}.

Also, ⟨c, x, S⟩ ∈ P iff S = S_{c,x}, where

S_{c,x} = {⟨b, x, S_{b,x}⟩, ⟨c, x, S_{c,x}⟩}.

5One could also use the principle of coinduction for NW F to show that, if ⟨b, x, S⟩ and ⟨b, x, S′⟩ are in P, then S and S′ are P-bisimilar. The relation one defines to show S ∼ S′ is more complicated, however.

2.5. BISIMULATIONS 89

Finally, we consider triples of the form ⟨c, y, S⟩. Such triples are in P just in case S satisfies the equations

(10)  P_{fin}e_{A}(S) = {⟨b, S_{b}⟩, ⟨c, S_{c}⟩},
(11)  P_{fin}e_{X}(S) = {⟨x, S_{x}⟩, ⟨y, S_{y}⟩}.

Consider the set

S_{c,y} = {⟨b, x, S_{b,x}⟩, ⟨c, y, S_{c,y}⟩}.

Then one can show that S_{c,y} satisfies (10) and (11), so ⟨c, y, S_{c,y}⟩ is in P. However, the set

V = {⟨c, x, S_{c,x}⟩, ⟨b, y, S_{b,y}⟩}

also satisfies (10) and (11). Indeed, there are many sets which satisfy these two equations: Any set S such that

V ⊆ S ⊆ V ∪ S_{c,y} or S_{c,y} ⊆ S ⊆ V ∪ S_{c,y}.

satisfies (10) and (11), and one can show that these are the only sets which satisfy these equations.

Thus, we have characterized the set

P = {⟨s, t, S⟩ ∈ UH(A × B) | ⟨e_{A}, e_{X}⟩(⟨s, t, S⟩) ∈ Im(η_{A} × η_{X})}.

Namely, P is the set

{⟨a, w, ∅⟩, ⟨b, x, S_{b,x}⟩, ⟨b, y, S_{b,y}⟩, ⟨c, x, S_{c,x}⟩}

joined with the set

{⟨c, y, S⟩ | V ⊆ S ⊆ V ∪ S_{c,y} or S_{c,y} ⊆ S ⊆ V ∪ S_{c,y}}.

By Corollary 2.4.4, the set P (with the projection π_{3} as a structure map) is the product ⟨A, α⟩ × ⟨X, χ⟩. The projections are just the obvious projections:

π_{α}(⟨s, t, S⟩) = s,
π_{χ}(⟨s, t, S⟩) = t.

2.5. Bisimulations

We now turn our attention to bisimulations — relations on coalgebras which in some sense respect the coalgebraic structure. We had postponed our discussion of bisimulations until we had shown how one defines products of coalgebras. This allows a simple definition of regular relations in the category E_{Γ}. We focus on regular relations for the same reasons that we restricted our attention to regular subobjects when defining subcoalgebras. Namely, since E_{Γ} inherits epi-regular mono factorizations, under our usual assumptions on E and Γ, the regular relations come with a richer set of construction principles. These are the relations that are well-behaved,

90 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

both in E and in E_{Γ}. A bisimulation will be a regular relation in E that is the image of a regular relation in E_{𝔾}.

Compared to the definition of bisimulation we find in other works on coalgebras, the definition we adopt may seem a bit complicated. There are two reasons for the apparent complexity of our development. The first reason is that we stress the importance of regular relations and in the usual setting (coalgebras over Set), every relation is regular, thus removing the distinction. Secondly, in Set, one has the advantage of the axiom of choice. This simplifies the definition of bisimulation considerably (Theorem 2.5.8). So, one finds that, in the category Set, our definition coincides with the definition of bisimulation found in [JR97], [BM96], etc. The additional complexity of the definition of bisimulation found here seems a necessary effect of generalizing the setting in which we are interested.

Because the theory of bisimulations has not been well developed outside of Set_{Γ}, we feel justified in offering an alternative definition for categories E_{Γ} which reduces to the familiar definition when E = Set. What one wants, however, is a compelling example of a category of coalgebras for which the two definitions differ, and for which the definition offered here is demonstrably preferable. Unfortunately, because of the results in Section 2.5.2 (which show that, if 𝔾 preserves regular relations, then again Definition 2.5.4 reduces to the definition of bisimulation found elsewhere), such examples are difficult to come by. One would like to look at power object coalgebras over a topos which does not satisfy choice and see how the class of bisimulations discussed here differ from the class of coalgebraic relations preserved by U. This is an obvious area for future research.

Definition 2.5.1. Let C be a category with finite products. A relation R on A and B is a regular relation if the inclusion

[figure: R; A × B]

is a regular mono.

Remark 2.5.2. The notion of a regular relation doesn’t really require that C has finite products. One could say that R is a regular relation on A and B just in case, for every C ∈ C, the map

\xymatrix{Hom(A, C) × Hom(B, C) \ar[r] & Hom(R, C)}

is a regular epi. See the definition of regular epimorphic family in [BW85] for details. We won’t require that kind of generality here.

Remark 2.5.3. In a category in which every mono is regular (say, a category with a subobject classifier), every relation is regular.

2.5. BISIMULATIONS 91

Let E be almost co-regular and let Γ be a covarietor that preserves regular monos, with H the right adjoint to U. Let ⟨A, α⟩ and ⟨B, β⟩ be Γ-coalgebras. Then there are two evident categories of regular relations to consider. On the one hand, there are the regular relations on A and B in E, that is,

RegSub_{E}(A × B).

On the other, there are the regular relations on ⟨A, α⟩ and ⟨B, β⟩ in E_{Γ},

SubCoalg(⟨A, α⟩ × ⟨B, β⟩),

which we abbreviate as SubCoalg(α × β). We define a functor

U_{α,β}:\xymatrix{SubCoalg(α × β) \ar[r] & RegSub(A × B)}

as follows: Given a regular relation ⟨R, ρ⟩ over ⟨A, α⟩ and ⟨B, β⟩, with projections r_{1}, r_{2}, we factor

⟨Uπ_{α}, Uπ_{β}⟩ ∘ U⟨r_{1}, r_{2}⟩

(i.e., we factor ⟨Ur_{1}, Ur_{2}⟩), as shown in Figure 11. In other words, U_{α,β} = ∃_{⟨Uπ_{α}, Uπ_{β}⟩}∘ U_{α×β}.

[figure: R; U_{α,β}⟨R, ρ⟩; U(α × β); ⟨Uπ_{α}, Uπ_{β}⟩; A × B]

Figure 11. The definition of U_{α,β}.

We define the category Bisim(α, β) of bisimulations over ⟨A, α⟩ and ⟨B, β⟩ to be the image of U_{α,β} in the category of regular relations over A and B (that is, RegSub(A × B)). Explicitly, Bisim(α, β) is the full subcategory of RegSub(A × B) consisting of U_{α,β}⟨R, ρ⟩ for ⟨R, ρ⟩ ∈ SubCoalg(α × β).

[figure: SubCoalg(α × β); U_{α,β}; RegSub(A × B); Bisim(α, β)]

Figure 12. The definition of Bisim(α, β).

92 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

Definition 2.5.4. Let ⟨A, α⟩ and ⟨B, β⟩ be Γ-coalgebras. A regular relation R on A and B is a bisimulation on ⟨A, α⟩ and ⟨B, β⟩ just in case there is a regular relation ⟨S, σ⟩ on ⟨A, α⟩ and ⟨B, β⟩ such that R is the image of

[figure: S; U(α × β); A × B] .

In other words, R is a bisimulation just in case R = ∃_{⟨Uπ_{α}, Uπ_{β}⟩}S for some relation ⟨S, σ⟩ on ⟨A, α⟩ and ⟨B, β⟩.

This definition of bisimulation differs from the definition one finds in [JR97], etc. Typically, one defines a bisimulation over ⟨A, α⟩ and ⟨B, β⟩ as a relation R on A and B such that R can be augmented with a structure map making it a relation in E_{Γ}. This simpler definition is well-suited for coalgebras over Set, but is not wellbehaved when the base category does not satisfy the axiom of choice. For instance, the simpler definition does not, in general, define a class of relations closed under joins. Definition 2.5.4 is a proper generalization of the definition of bisimulation in ibid, since it reduces to the more familiar definition of bisimulation in the presence of choice, as the following theorem shows (it also reduces to the simpler definition if Γ preserves regular relations — see Corollary 2.5.27).

The next few theorems give standard examples of bisimulations, which can be found in most introductions to coalgebras. One important construction of bisimulations does not seem to hold in this setting generally, however. It is apparently not the case that if R and S are composable bisimulations, then R ∘ S is a bisimulation. From [JR97], we have a proof that R ∘ S is a bisimulation, given that E satisfies the axiom of choice. In Section 4.2.6, we prove (using the internal logic of E_{Γ} and E developed in Chapter 4) that R ∘ S is a bisimulation if Γ preserves regular relations. In both of the cases in which we have proofs that bisimulations compose, the bisimulations consist of those relations in E which can be augmented with structure maps, making the projections homomorphisms. More general results would be nice, but the situation is unclear.

Theorem 2.5.5. For any coalgebra ⟨A, α⟩, Δ_{A} is a bisimulation.

Proof. U_{α,α}Δ_{α} is the image of

⟨Uπ_{1}, Uπ_{2}⟩ ∘ U⟨id_{α}, id_{α}⟩ = ⟨U id_{α}, U id_{α}⟩ = ⟨id_{A}, id_{A}⟩,

and so U_{α,α}Δ_{α} = Δ_{A}. □

Theorem 2.5.6. Let f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} be a Γ-homomorphism. Then the graph of Uf is a bisimulation.

Proof. The graph of f in E_{Γ} is the relation ⟨⟨A, α⟩, id_{α}, f⟩. Hence, U_{α,β} graph(f) is the image of

⟨Uπ_{α}, Uπ_{β}⟩ ∘ U⟨id_{α}, f⟩ = ⟨id_{A}, Uf⟩.

2.5. BISIMULATIONS 93

Therefore, U_{α,β} graph(f) = graph(Uf). □

The next theorem is well-known, first appearing in [Rut96]. Since our definition of bisimulations include all those relations which are the carrier for some subcoalgebra of α × β, the result also holds in our setting. We include the proof nonetheless.

Theorem 2.5.7. If Γ preserves weak pullbacks, then for any pair of homomorphisms

f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩},
g:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨B, β⟩},

the pullback of f along g (properly, Uf along Ug) is a bisimulation.

Proof. Let E be the pullback of f along g, as shown in Figure 13. Since, by assumption, Γ preserves weak pullbacks, the top face is a weak pullback. Hence, there is a structure map ε:\xymatrix{E \ar[r] & ΓE} making the two projections homomorphisms. Therefore, the inclusion [figure: E; A × C] factors through \xymatrix{U(α × β) \ar[r] & A × B} and thus ⟨E, ε⟩ is a regular relation in E_{Γ}. It is easy to verify that U_{α,β}⟨E, ε⟩ = E.

[figure: ΓE; ΓC; ΓA; ΓB; E; C; A; B]

Figure 13. Pullbacks of homomorphisms are bisimulations.

□

Theorem 2.5.8. Let ⟨A, α⟩ and ⟨B, β⟩ be Γ-coalgebras and suppose that E satisfies the axiom of choice. Then a relation R on A and B is a bisimulation iff there is a structure map

ρ:\xymatrix{R \ar[r] & ΓR}

such that the projections r_{1} and r_{2} are Γ-homomorphisms.

Proof. Clearly, if R has a structure map making r_{1} and r_{2} homomorphisms, then R is a bisimulation.

94 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

Suppose that R is a bisimulation. Let ⟨S, σ⟩ ∈ SubCoalg(α × β) such that R = U_{α,β}⟨S, σ⟩, with p:\xymatrix{S \ar@{|->}[r] & R} the (necessarily regular) epi part of the factorization, as shown in Figure 14, and i the right inverse of p. Then it is easy to see that Γp ∘ σ ∘ i suffices as the desired structure map. □

[figure: ΓS; Γp; ΓR; ΓA × ΓB; S; σ; p; R; i; A × B; α×β]

Figure 14. Definition of a structure map for a bisimulation, given choice.

2.5.1. The right adjoint to U_{α,β}. In Section 2.2.1, we saw that the subcoalgebra forgetful functor U_{α} has a right adjoint. We generalize that result to the functor U_{α,β} here.

Remark 2.5.9. In what follows, we write α × β as an abbreviation for ⟨A, α⟩ × ⟨B, β⟩. This is not to be confused with the morphism

α × β:\xymatrix{A × B \ar[r] & ΓA × ΓB}

in E.

Theorem 2.5.10. U_{α,β} has a right adjoint.

Proof. By definition,

U_{α,β} = ∃_{⟨Uπ_{α}, Uπ_{β}⟩} ∘ U_{α×β}.

Since U_{α×β} ⊣ [−]_{α×β} and ∃_{⟨Uπ_{α}, Uπ_{β}⟩} ⊣ ⟨Uπ_{α}, Uπ_{β}⟩^{∗} (pullback along ⟨Uπ_{α}, Uπ_{β}⟩), the composite

[−]_{α,β} = [−]_{α×β} ∘ ⟨Uπ_{α}, Uπ_{β}⟩^{∗}

is a right adjoint to U_{α,β}. □

Corollary 2.5.11. U_{α,β} preserves colimits.

Theorem 2.5.12. Given R ≤ A×B, A = U⟨A, α⟩, B = U⟨B, β⟩, the coalgebraic relation [R]_{α,β} is the pullback shown below, where the arrow on the bottom is the adjoint transpose of ⟨Uπ_{α}, Uπ_{β}⟩.

[figure: [R]_{α,β}; f; g; HR; H⟨r_{1}, r_{2}⟩; α × β; H(A × B)]

[figure: [p^{∗}R]; Hp^{∗}R; HR; α × β; η_{α×β}; HU(α × β); Hp; H(A × B)]

Figure 15. Alternate definition of [−]_{α,β}

Proof. Let p = ⟨Uπ_{1}, Uπ_{2}⟩:\xymatrix{U(α × β) \ar[r] & A × B}. By Theorem 2.2.11 ( 3), [p^{∗}R] is the pullback on the left hand square of Figure 15. The right hand square is also a pullback, since H preserves pullbacks. Hence, the composite is a pullback. □

The adjoint functors U_{α,β} and [−]_{α,β} give rise to a monad on RegSub(A × B) and a comonad on SubCoalg(α × β), that is, an interior operator □_{α,β} = U_{α,β}[−]_{α,β} and a closure operator_{▽α,β} = [−]_{α,β}U_{α,β}. In the case of subcoalgebras, the comonad [−]_{α}U_{α} is just the identity on SubCoalg(⟨A, α⟩), but for relations, this is not generally the case, as the following example shows. Instead, the closure of a coalgebraic relation ⟨R, ρ⟩ on ⟨A, α⟩ and ⟨B, β⟩ is the largest relation ⟨S, σ⟩ such that

U_{α,β}⟨R, ρ⟩ = U_{α,β}⟨S, σ⟩.

We return to a discussion of □_{α,β} in Section 2.5.2.

Example 2.5.13. Consider again the P_{fin}-coalgebras ⟨A, α⟩ and ⟨X, χ⟩ from Example 2.4.10. Recall that A is the set {a, b, c} and X the set {w, x, y, z}. The structure maps α:\xymatrix{A \ar[r] & P_{fin}A} and χ:\xymatrix{X \ar[r] & P_{fin}X} are given by:

α(a) = ∅,  χ(w) = ∅,
α(b) = {b},  χ(x) = {x},
α(c) = {b, c},  χ(y) = {x, y},
χ(z) = {w, z}.

We calculated their product as the set

{⟨a, w, ∅⟩, ⟨b, x, S_{b,x}⟩, ⟨b, y, S_{b,y}⟩, ⟨c, x, S_{c,x}⟩}

joined with the set

{⟨c, y, S⟩ | V ⊆ S ⊆ V ∪ S_{c,y} or S_{c,y} ⊆ S ⊆ V ∪ S_{c,y}},

S_{b,x} = {⟨b, x, S_{b,x}⟩},
S_{b,y} = {⟨b, x, S_{b,x}⟩, ⟨b, y, S_{b,y}⟩},
S_{c,x} = {⟨b, x, S_{b,x}⟩, ⟨c, x, S_{c,x}⟩},
S_{c,y} = {⟨b, x, S_{b,x}⟩, ⟨c, y, S_{c,y}⟩},
V = {⟨c, x, S_{c,x}⟩, ⟨b, y, S_{b,y}⟩}.

We consider a relation ⟨R, ρ⟩ on ⟨A, α⟩ and ⟨X, χ⟩ where

R = {⟨a, w, ∅⟩, ⟨b, x, S_{b,x}⟩, ⟨b, y, S_{b,y}⟩, ⟨c, x, S_{c,x}⟩, ⟨c, y, S_{c,y}⟩}.

The structure map ρ on R is the projection π_{3}.

One sees that U_{α,χ}R is the relation {⟨a, w⟩, ⟨b, x⟩, ⟨b, y⟩, ⟨c, x⟩, ⟨c, y⟩}. In other words, U_{α,χ}R is the largest bisimulation on ⟨A, α⟩ and ⟨X, χ⟩. Consequently,

▽α,χ⟨R, ρ⟩ = α × χ ≩ ⟨R, ρ⟩.

The following observation is a standard fact about Galois correspondences.

Theorem 2.5.14. The following posets are isomorphic:

Fix(□_{α,β}) ≅ Fix(_{▽α,β}) ≅ Bisim(α, β),

(where Fix is the poset of fixed points of the operator).

Let f: \xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} be given. We saw, in Corollary 2.2.9 that Uf factors through a subobject P of B just in case f factors through [P]. We prove an analogous result here for pairs of homomorphisms into α × β. First, we prove a lemma.

Lemma 2.5.15. Let

f:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨A, α⟩},
g:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨B, β⟩}

be Γ-homomorphisms. Then

U_{α,β} Im⟨f, g⟩ = Im⟨Uf, Ug⟩.

Proof. We use the facts that

⟨Uf, Ug⟩ = ⟨Uπ_{α}, Uπ_{β}⟩ ∘ U⟨f, g⟩,
U Im⟨f, g⟩ = Im U⟨f, g⟩.

The commutative diagram in Figure 16 completes the proof. □

[figure: •; U⟨f, g⟩; U Im⟨f, g⟩; U_{α,β} Im⟨f, g⟩; U(α × β); ⟨Uπ_{α}, Uπ_{β}⟩; A × B]

Figure 16. U_{α,β} commutes with Im.

Theorem 2.5.16. Let

f:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨A, α⟩},
g:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨B, β⟩}

be Γ-homomorphisms and R a relation on A and B. Then ⟨f, g⟩ factors through [R]_{α,β} just in case ⟨Uf, Ug⟩ factors through R.

Proof.

Im⟨f, g⟩ ≤ [R]_{α,β} iff U_{α,β} Im⟨f, g⟩ ≤ R iff Im⟨Uf, Ug⟩ ≤ R.
□

Corollary 2.5.17. Let the left hand square of Figure 17 be a pullback. Then the right hand square is also a pullback.

[figure: •; h; k; •; h; k; P; B; g; [P]_{α,β}; ⟨B, β⟩; g; A; f; C; ⟨A, α⟩; f; ⟨C, γ⟩]

Figure 17. [P] is a pullback.

Proof. Let h and k be homomorphisms making the right hand square commute. Then the left hand square, which is just the image of the right hand square under U, also commutes, and so there is a unique factorization of ⟨h, k⟩ through P. Apply Theorem 2.5.16 to conclude that ⟨h, k⟩ factors through [P]. □

Remark 2.5.18. Example 2.5.13 also shows that the functor U_{α,β} is not generally full. In this example, U_{α,β}(α × β) ≤ U_{α,β}⟨R, ρ⟩, but α × β ≰ ⟨R, ρ⟩. This is a difference between the subcoalgebra functor U_{α} and the bisimulation functor U_{α,β}.

98 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

The functor [−]_{α,β} is a natural transformation between contravariant bifunctors. In order to make that precise, we define the functors RegRel(⟨A, α⟩, ⟨B, β⟩) (abbreviated RegRel(α, β)) and RegRel(A, B) as bifunctors. Their definition is clear from the preceding discussion. Namely,

RegRel(α, β) = SubCoalg(α × β) and
RegRel(A, B) = RegSub(A × B).

Thus, the effect of RegRel_{E_{Γ}}, say, on a pair of maps

f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨C, γ⟩}
g:\xymatrix{⟨B, β⟩ \ar[r] & ⟨D, δ⟩}

is a functor

RegRel(f, g):\xymatrix{RegRel(γ, δ) \ar[r] & RegRel(α, β)}.

Namely, it takes a relation ⟨R, ρ⟩ on ⟨C, γ⟩ and ⟨D, δ⟩ to the pullback shown below.

[figure: (f × g)^{∗}⟨R, ρ⟩; ⟨R, ρ⟩; α × β; f×g; γ × δ]

Theorem 2.5.19. [−] :\xymatrix{RegRel_{E} ∘U × U \ar@{=>}[r] & RegRel_{E_{Γ}}} is natural. I.e., for every pair of maps, f and g, as above,

[−] ∘ (Uf × Ug)^{∗} = (f × g)^{∗} ∘ [−].

Proof. Let f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨C, γ⟩} and g:\xymatrix{⟨B, β⟩ \ar[r] & ⟨D, δ⟩} be given. Let R be a regular relation over C and D and S = (Uf × Ug)^{∗}R. We will show that [S]_{α,β} = (f, g)^{∗}[R]_{γ,δ}.

Figure 18. [−] is natural.

[figure: [S]_{α,β}; HS; [R]_{γ,δ}; HR; α × β; f×g; HA × HB; HUf×HUg; γ × δ; η_{γ}×η_{δ}; HC × HD]

2.5. BISIMULATIONS 99

In Figure 18, the front and rear faces are pullbacks by Theorem 2.5.12. The right hand face is also a pullback, since H preserves pullbacks. The bottom commutes by naturality. The arrow

\xymatrix{[S]_{α,β} \ar[r] & [R]_{γ,δ}}

is the unique map making the top and left hand squares commute (due to the pullback in front).

Because the composite of the left and front faces is a pullback, and so is the front face itself, we see that the left face is a pullback. □

For each pair of maps,

f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨C, γ⟩}
g:\xymatrix{⟨B, β⟩ \ar[r] & ⟨D, δ⟩}

the functor (f × g)^{∗} (i.e., RegRel(f, g)) has a left adjoint

∃_{f,g}:\xymatrix{RegRel(α, β) \ar[r] & RegRel(γ, δ)}.

Namely, given a regular relation ⟨R, ρ⟩ on ⟨A, α⟩ and ⟨B, β⟩, we take the epi-regular mono factorization shown below.

[figure: ⟨R, ρ⟩; ∃_{f,g}⟨R, ρ⟩; α × β; f×g; γ × δ]

The same fact holds in E as well. That is, for any pair of maps h and k, the pullback functor (h × k)^{∗} has a left adjoint, ∃_{h,k}.

\xymatrix{RegRel(α, β) \ar[d]_{U_{α,β}}|{⊣} \ar[r]^{∃_{f,g}} & RegRel(γ, δ) \ar[l]^{_{(f×g)_{∗}}}|{⊥} \ar[d]_{U_{γ,δ}}|{⊣} \\ RegRel(A, B) \ar[u]_{[−]_{α,β}} \ar[r]^{∃_{Uf,Ug}} & RegRel(C, D) \ar[u]_{[−]_{γ,δ}} \ar[l]^{_{(Uf×Ug)_{∗}}}|{⊥}}

Figure 19. U_{α,β} commutes with ∃

The following corollary is found in [JR97, Lemma 5.3], where it is proved for coalgebras over Set. Of course, the proof offered here differs inasmuch as it uses our definition of bisimulation, but the basic approach is the same.

Name  Category Description
Subalgebra  SubAlg A subobject of ⟨A, α⟩ preserved by U.
Pre-congruence  PreCong A relation on ⟨A, α⟩ and ⟨B, β⟩ preserved

by U

Congruence  Cong  A pre-congruence equivalence relation
Subcoalgebra  SubCoalg A regular subobject of ⟨A, α⟩ (necessarily

preserved by U).

Bisimulation Bisim The image of a regular relation over

⟨A, α⟩ and ⟨B, β⟩

Bisimulation equivalence BisimEq A bisimulation which is an equivalence

relation Table 1. A summary of predicates and relations.

Corollary 2.5.20. U_{α,β} commutes with ∃. In other words, for any pair of homomorphisms f:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨A, α⟩}, g:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨B, β⟩}, the image of ⟨f, g⟩ is a bisimulation over ⟨A, α⟩ and ⟨B, β⟩.

Proof. The right adjoints in Figure 19 commute by Theorem 2.5.19, and so the left adjoints also commute. Thus,

∃_{Uf,Ug} ∘ U_{α,β} = U_{γ,δ} ∘ ∃_{f,g}.
□

2.5.2. □_{α,β} and relation-preserving functors. In Section 2.2.2, we saw that the operator □_{α} = U_{α}∘[−]_{α} is an S4 modal operator. The situation for the analogous bisimulation operator is more difficult. The operator

□_{α,β}:\xymatrix{RegRel(A, B) \ar[r] & RegRel(A, B)}

defined by □_{α,β} = U_{α,β}[−]_{α,β} easily satisfies certain of the properties of S4 operators, namely

• □ is monotone;

• □ is deflationary;

• □ is idempotent. These properties are satisfied by any comonad on a poset. Nonetheless, it is not clear that □ is a normal modal operator, that is, that

□_{α,β}R ∧ □_{α,β}S ≤ □_{α,β}(R ∧ S). (12)

Indeed, even over Set, bisimulations need not be closed under finite meets, and so □ need not be normal. Worse, even if □ does preserve binary meets, it does not generally preserve ⊤, so □ simply won’t be S4 typically.

2.5. BISIMULATIONS 101

In this section, we give sufficient conditions that □ preserves binary meets, namely that the endofunctor Γ preserve regular relations. This is a fairly strong condition and is not met by some functors of interest. In the following example, we will show that the □ operator for P_{fin}-coalgebras is not normal.

Example 2.5.21. Consider the finite powerset functor and the coalgebra ⟨A, α⟩ represented by the graph in Figure 20. Let

R = {⟨a, a⟩, ⟨b, b⟩, ⟨c, c⟩},
S = {⟨a, a⟩, ⟨b, c⟩, ⟨c, b⟩}.

Then □R = R, □S = S and □(R∧S) = □{⟨a, a⟩} = ∅. (Thanks to Tobias Schröder for this example.)

\xymatrix{ & a \ar[dl] \ar[dr] \\ b &  & c}

Figure 20. P_{fin}-bisimulations are not closed under ∧.

As we will see, if Γ preserves regular relations, then the category of bisimulations Bisim(α, β) inherits much of its structure from the category RegSub(A × B) of relations in E. In fact, in this case, the category Bisim(α, β) is isomorphic to SubCoalg(α × β) and is a full subcategory of RegSub(A × B), with the inclusion a complete Heyting algebra homomorphism. Such a close connection between these three categories requires a correspondingly strong assumption on Γ.

From [GS01], we learn that a functor Γ preserves pullbacks iff Γ preserves weak pullbacks and mono 2-sources (i.e., binary relations). Indeed, the same claim holds if we replace mono 2-sources with regular mono 2-sources (regular relations). We include this and other proofs from ibid here, replacing mono 2-sources with regular relations.

Definition 2.5.22. A functor Γ preserves regular relations if, for every regular relation ⟨R, r_{1}, r_{2}⟩ on X and Y, the triple ⟨ΓR, Γr_{1}, Γr_{2}⟩ is a regular relation on ΓX, ΓY, i.e., ⟨Γr_{1}, Γr_{2}⟩ is a regular mono.

As Gumm and Schröder showed, it is sufficient that Γ take binary products to (in our setting, regular) relations.

Lemma 2.5.23. Γ preserves regular relations iff, for every X, Y,

⟨Γ(X × Y), Γπ_{X}, Γπ_{Y} ⟩

is a regular relation.

102 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

Proof. Clearly if Γ preserves regular relations, then it preserves the regular relation X ×Y. Suppose, conversely, that for every X, Y, Γ(X ×Y) is a regular relation, i.e., ⟨Γπ_{X}, Γπ_{Y} ⟩ is a regular mono. Then, for any regular relation [figure: R; X × Y] , the composite

[figure: ΓR; Γ(X × Y); ΓX × ΓY]

is a regular relation. □

Theorem 2.5.24. Γ preserves pullbacks iff Γ preserves weak pullbacks and regular relations.

Proof. If Γ preserves pullbacks, then Γ takes the pullback square

[figure: X × Y; Y; X; 1]

to a pullback, so ⟨Γπ_{1}, Γπ_{2}⟩ is a regular mono. Apply Theorem 2.5.23 to conclude that Γ preserves regular relations.

For the converse, notice that pullbacks are both regular relations and weak pullbacks, and that a weak pullback which is a regular relation is also a pullback. □

On the one hand, as the following theorems show, preservation of regular relations is the “right” condition to ensure well-behaved bisimulations. On the other hand, preservation of regular relations is an unfortunately strong condition, not satisfied by many functors of interest (such as P_{fin}). Nonetheless, there seems to be no reasonable middle ground. If one wants □ to be well-behaved as a modal operator (although, even here, we will typically not preserve the final subobject), then one must restrict interest to pullback-preserving functors (or some similarly suitable domain).

Theorem 2.5.25. If Γ preserves regular relations, then U preserves regular relations. In other words, for any relation ⟨⟨R, ρ⟩, r_{1}, r_{2}⟩ on ⟨A, α⟩, ⟨B, β⟩,

U_{α,β}⟨⟨R, ρ⟩, r_{1}, r_{2}⟩ = ⟨R, r_{1}, r_{2}⟩.

Proof. It suffices to show that, for every pair of coalgebras ⟨A, α⟩ and ⟨B, β⟩, \xymatrix{U(α × β) \ar[r] & A × B} is a regular mono. We sketch how to do that here, leaving details to the reader.

First, one shows that U creates epi-regular mono 2-source factorizations. That is, for each pair of homomorphisms,

f:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨A, α⟩},
g:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨B, β⟩},

there is a unique epi p:\xymatrix{⟨C, γ⟩ \ar@{->>}[r] & ⟨D, δ⟩} and pair

h:\xymatrix{⟨D, δ⟩ \ar[r] & ⟨A, α⟩},
k:\xymatrix{⟨D, δ⟩ \ar[r] & ⟨B, β⟩},

such that h ∘ p = f and k ∘ p = g and ⟨Uh, Uk⟩ is regular mono in E.

Say that a regular relation ⟨S, s_{1}, s_{2}⟩ on A and B is α, β-invariant if there is a structure map σ:\xymatrix{S \ar[r] & ΓS} such that s_{1} and s_{2} are homomorphisms. Let R be the join of all α, β-invariant relations S. Using the fact about epi-regular mono 2-source factorizations above, one can show that R is itself α, β-invariant, with unique structure map ρ:\xymatrix{R \ar[r] & ΓR}. Moreover, one can show that the coalgebra ⟨R, ρ⟩ is, in fact, the product of ⟨A, α⟩ and ⟨B, β⟩. Hence, U(α × β) is a regular relation over A and B. □

The categories RegRel(α, β) and RegRel(A, B) are both complete Heyting algebras, since they are simply categories of subobjects of α × β and A × B, respectively. The forgetful functor U_{α,β} is not, however, a Heyting algebra homomorphism in general, since it does not preserves meets (Example 2.5.21). By Theorem 2.2.6, we know that U_{α×β} preserves meets, but the functor

∃_{⟨Uπ_{1}, Uπ_{2}⟩}:\xymatrix{RegSub(U(α × β)) \ar[r] & RegSub(A × B)}

generally does not preserve meets. Assuming that Γ preserves regular relations, however, ∃_{⟨Uπ_{1}, Uπ_{2}⟩} does preserve meets, and hence we have the following corollary.

Corollary 2.5.26. If Γ preserves regular relations, then □ distributes over ∧. In other words, if Γ preserves regular relations, the meet (in E) of two bisimulations is again a bisimulation.

Proof. Let ⟨A, α⟩ and ⟨B, β⟩ be given, R and S be relations over A and B, and suppose Γ preserves regular relations. Then, by Theorem 2.5.25, U also preserves regular relations and, hence,

p = ⟨Uπ_{1}, Uπ_{2}⟩:[figure: U(α × β); A × B]

is a regular mono. Thus, ∃_{p} distributes over ∧ and so

□_{α,β}(R ∧ S) = ∃_{p}□_{α×β}p^{∗}
= ∃_{p}□_{α×β}(p^{∗}R ∧ p^{∗}S)
= ∃_{p}(□_{α×β}p^{∗}R ∧ □_{α×β}p^{∗}S)  (by Theorem 2.2.16)
= ∃_{p}□_{α×β}p^{∗}R ∧ ∃_{p}□_{α×β}p^{∗}S = □_{α,β}R ∧ □_{α,β}S.
□

104 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

As we saw in Theorem 2.5.8, assuming the axiom of choice, bisimulations are relations which can be augmented with structure maps, making them relations in E_{Γ}. The following corollary shows that, assuming Γ preserves pullbacks, the same result holds. Thus, under this (reasonably strong) assumption, the definition of bisimulation found in [JR97], etc., again coincides with our definition of bisimulation.

Corollary 2.5.27. If U preserves regular relations, a relation R on A and B is a bisimulation iff there is a (necessarily unique) structure map ρ:\xymatrix{R \ar[r] & ΓR} making ⟨R, ρ⟩ a relation on ⟨A, α⟩ and ⟨B, β⟩.

Proof. Let p = ⟨Uπ_{1}, Uπ_{2}⟩ and let R be a bisimulation, R = ∃_{p} ∘ U_{α×β}⟨T, τ⟩ for some ⟨T, τ⟩ ∈ RegRel(α, β). Since p is a regular mono, ∃_{p}T = T and so the result follows. □

2.5.3. The algebraic dual of bisimulations. A bisimulation is a relation between the carriers of two coalgebras which, loosely speaking, respects the structure maps of the coalgebras. In this way, a bisimulation is analogous to a pre-congruence. There is another structure on algebras which is related to the notion of a bisimulation — namely, the dual structure. For this, we explicitly dualize Definition 2.5.1 (regular relation).

Definition 2.5.28. Let A, B be objects in a category C with finite coproducts. A regular epi

p:\xymatrix{A + B \ar@{|->}[r] & C}

is called a regular co-relation on A and B.

Remark 2.5.29. A more general definition of regular co-relation can be found in [BW85], where one does not assume the category C has finite coproducts. See also Remark 2.5.2. We will not use this approach, but instead assume conditions sufficient to ensure that our category of algebras has coproducts.

Throughout the remainder, we assume that E is complete, exact, regularly cowell-powered and finitely cocomplete, that Γ preserves exact sequences and that the algebraic forgetful functor U is monadic. By Theorem 2.4.8, then, E^{Γ} has coproducts and by Theorem 1.4.11, E^{Γ} is exact. While we do not require exactness to dualize the preceding development of bisimulations, it does allow the dual theorems to be stated in familiar terms (i.e., in terms of equivalence relations instead of regular co-relations).

Let ⟨A, α⟩ and ⟨B, β⟩ be Γ-coalgebras. Let RegCoRel(A, B) be the category of regular corelations over A and B (in E), and RegCoRel(α, β) the category of regular corelations over ⟨A, α⟩ and ⟨B, β⟩. Then, there is a forgetful functor

U_{α,β}:\xymatrix{RegCoRel(α, β) \ar[r] & RegCoRel(A, B)}

2.6. COINDUCTION AND BISIMULATIONS 105

which takes a regular co-relation

p:\xymatrix{α + β \ar@{|->}[r] & ⟨C, γ⟩}

to the regular epi-mono factorization of Up ∘ [Uκ_{α}, Uκ_{β}] (where κ_{α} and κ_{β} are the co-projections of the coproduct). See Figure 21.

[figure: A + B; [Uκ_{α},Uκ_{β}]; U(α + β); Up; U_{α,β}⟨C, γ⟩; C]

Figure 21. The definition of U_{α,β}:\xymatrix{RegCoRel(α, β) \ar[r] & RegCoRel(A, B)}.

Because both E and E^{Γ} are exact, we have isomorphisms

RegCoRel(A, B) ≅ EqRel(A + B),
RegCoRel(α, β) ≅ Cong(α + β).

We state the effect of U_{α,β} in terms of congruences on α +β and equivalence relations on A + B. Let ⟨R, ρ⟩ be a congruence on α + β. Then U_{α,β}⟨R, ρ⟩ is given by the pullback of R along [Uκ_{α}, Uκ_{β}]. In other words, elements x and y of A+B are related by U_{α,β}⟨R, ρ⟩ if and only iff x and y are related by R as elements of α + β.

2.6. Coinduction and bisimulations

The principle of coinduction from Section 1.5.3 is often expressed in terms of bisimulations. We follow that tradition in this section by restating the results of Theorem 1.5.25 in terms of bisimulations. To begin, we define what it means for elements of two coalgebras to be bisimilar. Then, we prove the usual statement of coinduction, namely, any two bisimilar elements of the final coalgebra are equal. The material found here differs from the standard presentation (say, in [JR97]) inasmuch as the definition of bisimulation (and, hence, bisimilar) differ from the standard definitions. As before, if E satisfies the axiom of choice, the definitions agree.

Definition 2.6.1. Let ⟨A, α⟩ and ⟨B, β⟩ be Γ-coalgebras and let ⟨a, b⟩ ∈ A × B. We say that a and b are bisimilar, denoted a ∼_{α,β} b or just a ∼ b, if

⟨a, b⟩ ∈ □_{α,β}(A × B).

(Note that □_{α,β}(A × B) is just U_{α,β}(α × β).)

Two elements are bisimilar just in case there is a bisimulation relating them, as the following theorem shows.

106 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

Theorem 2.6.2. a ∼ b iff there is a bisimulation R such that ⟨a, b⟩ ∈ R. I.e., a ∼ b iff there is a coalgebraic relation ⟨R, ρ⟩ on ⟨A, α⟩ and ⟨B, β⟩ such that ⟨a, b⟩ ∈ U_{α,β}⟨R, ρ⟩.

Proof. If a ∼ b then ⟨a, b⟩ is an element of the bisimulation □_{α,β}(A × B). On the other hand, if ⟨a, b⟩ ∈ R, where R is a bisimulation, then

⟨a, b⟩ ∈ R = □_{α,β}R ≤ □_{α,β}A × B.
□

Recall from Section 1.5.3 that a coalgebra is simple if it has no proper quotients.

Theorem 2.6.3. If ⟨A, α⟩ is simple, then □_{α,α}(A × A) = Δ_{A}.

Proof. By Theorem 1.5.25, if ⟨A, α⟩ is simple, then Δ_{α} is the largest relation on ⟨A, α⟩. Hence, [(]_{α,α}A × A) = Δ_{α} and so (by Theorem 2.5.5)

□_{α,α}(A × A) = U_{α,α}Δ_{α} = Δ_{A}
□

Corollary 2.6.4. If ⟨A, α⟩ is simple then, for every element ⟨a, a′⟩ of A × A, a ∼ a′ iff a = a′.

Theorem 2.6.2 and Corollary 2.6.4 provide the proof principle of coinduction: To prove two elements of a simple coalgebra are equal, it suffices to show that there is a bisimulation relating them.

The notion of bisimilarity is intended to capture the informal notion of observational indistinguishability (see [JR97] for another presentation of this viewpoint). A bisimulation is a relation that is preserved by applications of the structure maps. Think of the structure map for a coalgebra as a number of destructor operations that allow one to take a data structure apart and look at the substructures. For instance, the structure map for an A ↦ Z × A coalgebra consists of two destructor functions: a head function, h_{α}, that gives the head of a stream, and a tail function, t_{α}, which returns the rest of the stream. We treat the elements of A as the internal state of the coalgebra, and so view them as unobservable, while the elements of Z are viewed as observable output. Hence, these destructors give a means of observing the behavior of the coalgebra A, by applying t_{α} some number of times, followed by h_{α}. This intuition regarding observable behavior can be made explicit for polynomial functors and similar inductively given classes of functors, but we do not do so here. See [Jac99] for an idea of how this is done, and see [Cîr00] for a more formal (and sophisticated) notion of a coalgebra observer.

With this informal notion of observations of a coalgebra, two elements of a coalgebra are bisimilar just in case they “look the same.” The principle of coinduction,

2.6. COINDUCTION AND BISIMULATIONS 107

in this perspective, says that two elements of a simple coalgebra that look the same are the same. In order to justify this informal interpretation of coinduction, we will look at a few examples.

Remark 2.6.5. The examples below involve coalgebras over Set. Consequently, we make use of the fact that, thanks to the axiom of choice, a relation R on A and B is a bisimulation iff there is a structure map ρ:\xymatrix{R \ar[r] & ΓR} such that ⟨R, ρ⟩ is a relation on ⟨A, α⟩ and ⟨B, β⟩. See Theorem 2.5.8.

Example 2.6.6. Consider the functor ΓA = Z×A above (see also Example 1.1.7). Let ⟨A, α⟩ and ⟨B, β⟩ be Γ-coalgebras, and a ∈ A and b ∈ B. Then a is bisimilar to b just in case

(13)  h_{α}(a) = h_{β}(b),
(14)  t_{α}(a) ∼ t_{β}(b).

Indeed, to prove that a and b satisfying (13) and (14) are bisimilar, we define a relation R on A and B by

cRd ↔ ∃n . t_{α}^{n}(a) = c ∧ t_{β}^{n}(b) = d.

Then, it is easy to confirm that R is a bisimulation.

Bisimilarity for the functor ΓA = Z × A + 1 is very similar. Let ⟨A, α⟩ and ⟨B, β⟩ be Γ-coalgebras (see Example 1.1.8). We can show that a ∼ b iff α(a) = ∗ and β(b) = ∗ or if α(a) ≠ ∗, β(b) ≠ ∗ and a, b satisfy (13) and (14).

Example 2.6.7. Let ℙ be a polynomial functor, and ⟨A, α⟩ and ⟨B, β⟩ be two ℙ-coalgebras (see Example 1.1.9). Then an element a ∈ A is bisimilar to an element b ∈ B just in case

(15)  label(a) = label(b),
(16)  br(a) = br(b),
(17)  child_{j}(a) ∼ child_{j}(b) for all j < br(a).

Example 2.6.8. Let AtProp be a collection of atomic propositions and consider the functor

ΓA = P(AtProp) × P(A).

A Γ-coalgebra is a Kripke model for the language L(AtProp) (see Example 1.1.10). Let 𝔄 = ⟨A, α⟩ and 𝔅 = ⟨B, β⟩ be two such coalgebras, and a ∈ A, b ∈ B. We have

108 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

a ∼ b iff

∀a′ ∈ π_{2} ∘ α(a) ∃b′ ∈ π_{2} ∘ β(b) . a′ ∼ b′,
∀b′ ∈ π_{2} ∘ β(b) ∃a′ ∈ π_{2} ∘ α(a) . a′ ∼ b′,
π_{2} ∘ α(a) = π_{2} ∘ β(b).

One can confirm, using these conditions, a ∼ b iff, for all ϕ ∈ L(AtProp),

a ⊧_{𝔄} ϕ iff b ⊧_{𝔅} ϕ.

See [BM96, Theorem 11.7] for the proof of this.

Example 2.6.9. Recall from Example 1.1.11 that coalgebras for the functor

ΓS = (P_{fin}S)^{I}

can be viewed as automata taking input from I. These are rather basic automata here, simply moving from one state to another, without giving any “output”, and so the notion of bisimilarity is trivial. Namely, given any two coalgebras ⟨A, α⟩and ⟨B, β⟩and any a ∈ A, b ∈ B, we have a ∼ b.

To dress these automata up a bit, we will add a set of outputs, O, and add a map taking each state to its output. In other words, we wish to consider coalgebras for the functor

ΔS = O × (P_{fin}S)^{I}.

One can show that, given a ∈ U⟨A, ⟨α_{o}, α_{s}⟩⟩ and b ∈ U⟨B, ⟨β_{o}, β_{s}⟩⟩ that a ∼ b just in case

• α_{o}(a) = β_{o}(b);

• for all i in I and all a′ such that \xymatrix{a \ar[r]^{i} & a′}, there is a b′ such that \xymatrix{b \ar[r]^{i} & b′};

• for all i in I and all b′ such that \xymatrix{b \ar[r]^{i} & b′}, there is an a′ such that \xymatrix{a \ar[r]^{i} & a}′.

We will discuss the relationship between bisimulations and maps into the final coalgebra in more detail in Section 3.9. For now, we state a simple fact: bisimilar elements are mapped to the same element of the final coalgebra.

Theorem 2.6.10. Let ⟨A, α⟩ and ⟨B, β⟩ be Γ coalgebras, and a ∈ A, b ∈ B be global points. Let

!_{α}:\xymatrix{⟨A, α⟩ \ar[r] & H1},
!_{β}:\xymatrix{⟨B, β⟩ \ar[r] & H1}

be the coalgebra homomorphisms into the final coalgebra. If the terminal object 1 in E is projective with respect to epis, then

a ∼ b implies !_{α}(a) =!_{β}(b).

If Γ preserves weak pullbacks, then the converse also holds.

2.7. n-SIMULATIONS 109

Proof. Let a ∼ b. Then ⟨a, b⟩ ∈ U_{α,β}(α × β), shown below.

[figure: 1; ⟨a, b⟩; c; U_{α,β}(α × β); U(α × β); p; A × B]

Because 1 is projective with respect to epis, there is an element c ∈ U(α × β) such that p(c) = ⟨a, b⟩. Now,

!_{α}(a) =!_{α} ∘ π_{A}(⟨a, b⟩)
=!_{α} ∘ π_{α}(c)
=!_{β} ∘ π_{β}(c) =!_{β}(b).

Under the assumption that Γ preserves weak pullbacks, then so does U [JPT^{+}98, Lemma 2.8]. Thus, the diagram below is a weak pullback.

\xymatrix{U(α × β) \ar[r] \ar[d] & A \ar[d]^{!_{α}} \\ B \ar[r]_{!_{β}} & UH1}

Hence, if !_{α} ∘ π_{A}(⟨a, b⟩) =!_{β} ∘ π_{B}(⟨a, b⟩), then ⟨a, b⟩ factors through U(α × β) and so a ∼ b. □

2.7. n-simulations

One can generalize bisimulations to include n-simulations. This allows a more uniform treatment of these distinguished relations in an internal logic in Section 4.1.2. We briefly present the definitions and main theorems here.

A regular nary relation@regular n-ary relation over A_{1}, …, A_{n} is a regular subobject of ∏ A_{i}.

For each finite family ⟨A_{1}, α_{1}⟩, …, ⟨A_{n}, α_{n}⟩ of coalgebras, we define a map

U_{α_{1},... ,α_{n}}:\xymatrix{SubCoalg(∏ α_{i}) \ar[r] & RegSub(∏ A_{i})},

by U_{α_{1},... ,α_{n}} = ∃_{⟨Uπ_{1},... ,Uπ_{n}⟩} ∘ U_{∏ α_{i}}. We define the category n-sim(α_{1}, …, α_{n}) to be the image of this functor.

The functor U_{α_{1},... ,α_{n}} has a right adjoint, [−]_{α_{1},... ,α_{n}}, defined by

[−]_{α_{1},... ,α_{n}} = [−]_{∏ α_{i}} ∘ ⟨Uπ_{1}, …, Uπ_{n}⟩^{∗}.

This gives rise to a comonad □_{α_{1},... ,α_{n}} on RegSub(∏ A_{i}), and a monad _{▽α_{1},... ,α_{n}} on SubCoalg(∏ α_{i}), that is, an interior operator and a closure operator, respectively. The □ operator takes a relation to the largest n-simulation contained in it, while the

110 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

▽ operator takes a coalgebraic relation to the largest relation with the same image (under U_{α_{1},... ,α_{n}}).

In Section 2.5.2, we showed that the bisimulation modal operator is normal if the endofunctor Γ preserves regular relations. The following theorems shows that the same assumption suffices to conclude that the n-simulation modal operate is also normal (for any n).

Theorem 2.7.1. If Γ preserves regular binary relations and regular monos, then Γ preserves regular n-ary relations.

Proof. By induction on n. The case for n = 1, 2 is by assumption. Suppose that Γ preserves regular n-ary relations. It suffices to show that, given a family {A_{i}}_{i<n+1}, Γ ∏ A_{i} is a regular subobject of ∏ ΓA_{i}. By inductive hypothesis, Γ ∏_{i<n} A_{i} is a regular subobject of ∏_{i<n} ΓA_{i}. Hence, we have

[figure: Γ(∏_{i<n} A_{i} × A_{n}); Γ ∏_{i<n} A_{i} × ΓA_{n}; ∏_{i<n} ΓA_{i} × ΓA_{n}] ,

completing the proof. □

Theorem 2.7.2. If Γ:\xymatrix{E \ar[r] & E} preserves regular relations and pullbacks along regular monos, then, for any finite family

⟨A_{1}, α_{1}⟩, …, ⟨A_{n}, α_{n}⟩,

□_{α_{1},... ,α_{n}} is a normal necessity operator (although it need not preserve ⊤ and so is typically not S4).

Proof. As before, it suffices to show that □ distributes over ∧. One uses the fact that U preserves regular n-ary relations and thus ⟨Uπ_{1}, …, Uπ_{n}⟩ is a regular mono. Hence, ∃_{⟨Uπ_{1},... ,Uπ_{n}⟩} distributes over ∧. By assumption, U preserves pullbacks along regular monos, and hence, intersections, and so, since

□_{α_{1},... ,α_{n}} = ∃_{⟨Uπ_{1},... ,Uπ_{n}⟩}U_{∏ α_{i}}[−]_{∏ α_{i}}⟨Uπ_{1}, …, Uπ_{n}⟩^{∗},

the result follows. □

The following theorem and corollary are obvious generalizations of Theorem 2.5.19 and Corollary 2.5.20. We omit the proof of these theorems, and prove a related theorem and corollary hereafter (Theorem 2.7.5 and its corollary).

Theorem 2.7.3. Let \{f_{i}:\xymatrix{⟨A_{i}, α_{i}⟩ \ar[r] & ⟨B_{i}, β_{i}⟩}\}_{1≤i≤n} be homomorphisms. Then

[−]_{α_{1},... ,α_{n}} ∘ (∏ Uf_{i})^{∗} = (∏ f_{i})^{∗}[−]_{β_{1},... ,β_{n}}.

Corollary 2.7.4. Under the same conditions as Theorem 2.7.3,

U_{β_{1},... ,β_{n}} ∘ ∃_{∏ f_{i}} = ∃_{∏ Uf_{i}} ∘ U_{α_{1},... ,α_{n}}.

2.7. n-SIMULATIONS 111

The same facts hold when we replace the products of maps in Theorem 2.7.3 and Corollary 2.7.4 with projections.

Theorem 2.7.5. Let ⟨A_{1}, α_{1}⟩, …, ⟨A_{n}, α_{n}⟩ be given. Then

[−]_{α_{1},... ,α_{n}} ∘ π_{i}^{∗} = π_{i}^{∗} ∘ [−]_{α_{i}}

(where π_{i} on the left hand side is the projection in E, while on the right hand side, it is the projection in E_{Γ}.

Proof. In Figure 22, the left hand face is a pullback by (the generalization of) Theorem 2.5.12, and the rear face is a pullback because H preserves pullbacks. The right hand face is a pullback by Theorem 2.2.11. To confirm that the front face is a pullback, and hence [π_{i}^{∗}R] = π_{i}^{∗}[R], it suffices to show that the bottom face commutes.

[figure: Hπ_{i}^{∗}R; HR; [π_{i}^{∗}R]; [R]; H ∏ A_{i}; HA; ∏ α_{i}; ⟨A_{i}, α_{i}⟩]

Figure 22. [−] commutes with pullback along a projection.

The map \xymatrix{⟨A, α⟩ \ar[r] & HA} is the adjoint transpose of the identity, i.e., η_{α}, and the map \xymatrix{∏ α_{i} \ar[r] & H ∏ A_{i}} is (up to the isomorphism H ∏ A_{i} ≅ ∏ HA_{i}) the unit ∏ η_{α_{i}}. Thus, we see that the bottom face commutes by naturality. □

Corollary 2.7.6. U_{α_{1},... ,α_{n}} commutes with ∃_{π_{i}}.

Remark 2.7.7. Theorem 2.7.5 and its corollary also apply when we replace π_{i} with a tuple of projections

⟨π_{i_{1}}, …, π_{i_{n}}⟩:\xymatrix{∏ α_{i} \ar[r] & ∏ α_{i_{j}}} .

Since, in this case, the [−] operator for the image is the n-simulation operator (and not merely the subcoalgebra operator), this is a non-trivial observation.

112 2. CONSTRUCTIONS ARISING FROM A (CO)MONAD

This last theorem will be useful in Chapter 4, where we introduce an internal version of the □ operators from this chapter. The theorem will be used in Theorem 4.2.3 to yield an axiom for □ in the internal logic.

Theorem 2.7.8. Let ⟨A_{i}, α_{i}⟩, ⟨B, β⟩ be given, and π_{B}:\xymatrix{B × ∏ A_{i} \ar[r] & ∏ A_{i}} be the evident projection (here, we’ve subscripted the projection with the object that we’re projecting out). Then □π_{B}^{∗} ≤ π_{B}^{∗}□.

Proof. Let π_{β}:\xymatrix{β × ∏ α_{i} \ar[r] & ∏ α_{i}} be the corresponding projection in E_{Γ}, and let

p:\xymatrix{U(β × ∏ α_{i}) \ar[r] & B × ∏ A_{i}},
q:\xymatrix{U ∏ α_{i} \ar[r] & ∏ A_{i}}

be the evident maps, so that π_{B} ∘ p = q ∘ Uπ_{β}. We omit the subscripts for □, U and [−] in the following calculation, but these should be clear from context.

∃_{π_{B}} ∘ □ ∘ π_{B}^{∗} = ∃_{π_{B}} ∘ ∃_{p} ∘ □ ∘ p^{∗} ∘ π_{B}^{∗}
= ∃_{q} ∘ ∃_{Uπ_{β}} ∘ □ ∘ (Uπ_{β})^{∗} ∘ q^{∗}
= ∃_{q} ∘ ∃_{Uπ_{β}} ∘ U ∘ π_{β}^{∗} ∘ [−] ∘ q^{∗}  (by Corollary 2.2.8)
= ∃_{q} ∘ U ∘ ∃_{π_{β}} ∘ π_{β}^{∗} ∘ [−] ∘ q^{∗}  (by Theorem 2.2.5)
≤ ∃_{q} ∘ U ∘ [−] ∘ q^{∗} = □.

Hence, by the adjunction ∃_{π_{B}} ⊣ π_{B}^{∗}, the result follows. □

CHAPTER 3 Birkhoff’s variety theorem

In this chapter, we give an extended example of the categorical approach to classical theorems in universal algebra. The Birkhoff variety theorem [Bir35] relates closure conditions on classes of universal algebras (for a fixed signature) to defining equations for the class. We begin by stating the classical theorem. Following this, we translate the relevant ideas to the categorical setting that has been developed in the preceding chapters.

We give two versions of the variety theorem: In the first, we ignore the features of categories of algebras and prove an abstract theorem that applies to many categories. This abstract theorem doesn’t discuss equational definability explicitly, since a category requires a certain amount of structure before the notion of equations makes sense. Instead, we state the abstract version of the variety theorem strictly in terms of orthogonality conditions.

We can then apply the abstract theorem to categories of algebras, where we do have a suitable notion of equation (assuming that the algebraic forgetful functor is monadic). This allows us to recover the classical theorem, assuming the traditional setting. We conclude our discussion of equations in categories of algebras with a presentation of Birkhoff’s deductive completeness theorem in terms of closure operators on equations over X.

Following this, we dualize the previous work to prove, first, an abstract covariety theorem, and then a covariety theorem for categories of coalgebras. Because the variety theorem was proved for categories of algebras over an abstract category, the real work for the covariety theorem has already been done — although one must still confirm that the dual setting (a co-Birkhoff category) is a reasonable setting. One still must interpret the terms of the dualized theorem, which yields definitions of coequations and covariety. The strengthening of the variety theorem to the classical result (where each variety is equationally definable over a single set of variables — see Section 3.4 on “uniformly Birkhoff categories”) does not directly dualize, however. Some work is required to capture the similar result for categories of coalgebras.

Following our presentation of the covariety theorems, we present the dual of the deductive completeness theorem, which states that a coequation φ is the minimal

114 3. BIRKHOFF’S VARIETY THEOREM

coequation satisfied by some class of coalgebras just in case φ is an endomorphisminvariant subcoalgebra. We conclude the chapter with a discussion of a distinguished class of covarieties, the behavioral covarieties. These covarieties were first studied in [GS98], where they were called “complete covarieties”. We present a similar account, while relating Gumm and Schröder’s work to Grigore Roşu in [Roş01], where the same class of covarieties are called “sinks”.

3.1. The classical theorem

We fix a signature Σ and consider classes of Σ-algebras. Birkhoff’s variety theorem says that a class V of Σ-algebras is closed under products, subalgebras and homomorphic quotients just in case it is equationally definable. In this section, we define these terms and state the theorem.

In order to present the theorem in its historical form, we will use the language of universal algebras (algebras for a signature of function symbols). In Section 3.2, we will restate the definitions in the terms of Γ-algebras and explore the role of equations in greater detail. Accordingly, in this section, we state the definitions and theorems in the notation of Example 1.1.5 (Σ-algebras). Thus, recall that a Σ-algebra is a pair,

S = ⟨S, \{f_{S}^{(n)} :\xymatrix{S^{n} \ar[r] & S}|f^{(n)} ∈ Σ\}⟩,

consisting of a set S together with interpretations for the function symbols of Σ. A subalgebra of S is a Σ-algebra,

T = ⟨T, \{f_{T}^{(n)} :\xymatrix{T^{n} \ar[r] & T}|f^{(n)} ∈ Σ\}⟩,

such that T ⊆ S and each f_{T}^{(n)} is the restriction of f_{S}^{(n)} to T. If

S_{i} = ⟨S_{i}, \{f_{S_{i}}^{(n)} :\xymatrix{S_{i}^{n} \ar[r] & S_{i}}|f^{(n)} ∈ Σ\}⟩

is a family of Σ-algebras, then the product ∏ S_{i} exists and has as carrier ∏ S_{i}. The interpretation of f^{n} on ∏ S_{i} is given by

∏ f_{S_{i}}^{(n)} :\xymatrix{(∏ S_{i})^{n} \ar[r] & ∏ S_{i}}

(via the isomorphism (∏ S_{i})^{n} ≅ ∏(S_{i})^{n}). In other words, the interpretation is given component-wise.

Definition 3.1.1. Let V be a class of Σ-algebras. We say that V is closed under subalgebras if, whenever S is in V and T is a subalgebra of S, then T is in V. If, whenever each S_{i} is in V, then ∏ S_{i} is in V, we say that V is closed under products. We say that V is closed under quotients if, whenever a homomorphism

p:\xymatrix{S \ar@{|->}[r] & T}

is a regular epi and S ∈ V, then T ∈ V.

Definition 3.1.2. Let V be a class of Σ-algebras. If V is closed under subalgebras, products and homomorphic quotients, then V is called a Birkhoff variety.

We now turn to equational definability. We use the fact that Σ-algebras have free algebras in order to define an equation. Given a set (of variables) X, the free algebra over X (denoted F X with carrier UF X) is the collection of Σ-terms over the variables in X (Section 2.1.2). Thus, we can view an equation τ_{1} = τ_{2} over X as a pair of elements of UF X.

Let

S = ⟨S, \{f_{S_{i}}^{(n)} :\xymatrix{S_{i}^{n} \ar[r] & S_{i}}|f^{(n)} ∈ Σ\}⟩

be a Σ-algebra. The property of freeness states that, for every assignment σ of the variables of X to S (i.e., for every Set map σ:\xymatrix{X \ar[r] & S}), there is a unique homomorphic extension

σ̃:\xymatrix{F X \ar[r] & S}.

An algebra S satisfies the equation τ_{1} = τ_{2} (denoted S ⊧ τ_{1} = τ_{2}) just in case, under every such assignment σ, we have

σ̃ ∘ τ_{1} = σ̃ ∘ τ_{2}.

Given a set E of equations over X, we write

S ⊧ E

just in case S ⊧ τ_{1} = τ_{2} for every equation τ_{1} = τ_{2} in E. We define

Mod(E) = {S | S ⊧ E}.

The set notation in this definition should not be taken literally. In general, Mod(E) is a proper class.

Definition 3.1.3. Let V be a class of Σ-algebras. We say that V is an equational variety just in case there is a set of variables X and a set E of equations over X such that

V = Mod(E).

Theorem (Birkhoff’s variety theorem). Let V be a class of Σ-algebras. Then V is a Birkhoff variety iff V is an equational variety.

3.2. A categorical approach

We now translate Birkhoff’s variety theorem to categorical terms. As we’ve seen, the category of algebras for a signature, Alg(Σ) is isomorphic to the category Set^{ℙ} for a related polynomial functor ℙ (see Example 1.1.5). In this section, we translate the remaining terms of Section 3.1 into categorical terms and prove an abstract version of the variety theorem, which holds in a wide variety of categories (and not just categories of algebras).

3.2.1. Birkhoff categories. We begin by describing some of the properties of Alg(Σ) that are relevant to Birkhoff’s theorem. In particular, we want to pay close attention to those properties that lead to natural definitions of Birkhoff variety and equational variety in abstract categories. We will call any category which has the requisite structure a Birkhoff category. We can then prove an abstract version of the variety theorem. It is just a little work to show that, for a wide variety of base categories and a wide variety of functors, the category E^{Γ} is a Birkhoff category. In particular, we will show that, for polynomials ℙ, the category Set^{ℙ} (and hence Alg(Σ)) is a Birkhoff category, and so the abstract Birkhoff theorem applies. This does not immediately lead to the classical theorem, however. Rather, the direct consequence of the abstract variety for categories of algebras is that every variety is defined by a class (not a set) of equations. In order to show that a set of equations suffices, we need to show that Set^{ℙ} is uniformly Birkhoff (see Section 3.4).

Recall that a category is regularly co-well-powered just in case each object has only set-many quotients (Definition A.3.1). We say that an object A is regular projective if it is projective with respect to regular epis, so that, for every regular epi \xymatrix{B \ar@{|->}[r] & C} and map \xymatrix{A \ar[r] & C}, there is a (not necessarily unique) map \xymatrix{A \ar[r] & B} making the diagram below commute.

\xymatrix{A \ar@{.>}[r] \ar[dr] & B \ar@{|->}[d] \\  & C}

A category has enough regular projectives just in case every object is a quotient of some regular projective.

Definition 3.2.1. A quasi-Birkhoff category is a category that is regularly cowell-powered, complete and has regular epi-mono factorizations. A Birkhoff category is a quasi-Birkhoff category with enough regular projectives.

The Birkhoff categories have the structure necessary for a notion of Birkhoff variety. We postpone the generalization of equational variety until we examine equational definability in E^{Γ} in more detail.

Definition 3.2.2. Let C be a quasi-Birkhoff category and V a full subcategory of C. Then V is a quasi-Birkhoff variety (or just quasi-variety)iff V is closed under products and subobjects. V is a Birkhoff variety if C is a Birkhoff category and V is a quasi-Birkhoff variety closed under quotients (codomains of regular epis).

Remark 3.2.3. Any quasi-variety is closed under isomorphisms, since it is closed under subobjects.

One may define these closure conditions in terms of fixed points for operators on subcategories of C. One defines the operator H:\xymatrix{Sub(C) \ar[r] & Sub(C)} to take a class V to

HV = V ∪ \{C ∈ C | ∃K ∈ V∃q:\xymatrix{K \ar@{|->}[r] & C} \}

(abusing set notation here). Similarly, one defines operators S and P taking V to the classes

SV = V ∪ {C ∈ C | ∃K ∈ V∃q:[figure: K; C]},
P V = {∏_{i∈I} C_{i} | C_{i} ∈ C, I ∈ Set}.

Then V is a quasi-Birkhoff variety iff V = SP V and a variety just in case V = HSP V. We don’t make use of these operators hereafter, but see [GS98] for a presentation along these lines.

3.2.2. Equations in E^{Γ}. In Section 3.1, we discussed equations for universal algebras. We now use that work to give an account of equations for Γ-algebras generally. Our goal is to find a categorical property that generalizes the notion of equational definability to a wider class of categories — including categories which are not monadic over some base category. As we will see in Section 3.2.5, equational definability is generalized by orthogonality to a regular epi with regular projective domain.

In order to interpret equations over X in E^{Γ}, we require that Γ is a varietor (i.e., the algebraic forgetful functor

U:\xymatrix{E^{Γ} \ar[r] & E}

is monadic). Also, for this section, we assume that E is a Birkhoff category that has all coequalizers. Thus, by Theorem 2.4.2, E^{Γ} has all coequalizers. This assumption isn’t necessary for the final proof of Birkhoff’s variety theorem, but is useful in understanding the role of equations in E^{Γ}.

Let X be a set of variables. Then an equation over X is a pair of elements of UF X, written τ_{1} = τ_{2}. Equivalently, an equation is a pair of maps

\xymatrix{1 \ar[r]^{τ_{1}} \ar[r]_{τ_{2}} & UF X} .

Similarly, a set of equations E is given by a pair of jointly monic maps

\xymatrix{E \ar[r]^{e_{1}} \ar[r]_{e_{2}} & UF X} .

118 3. BIRKHOFF’S VARIETY THEOREM

Recall the definition of satisfaction from Section 3.1. A ℙ-algebra ⟨A, α⟩ satisfies the equations in E just in case, for all σ:\xymatrix{X \ar[r] & A}, the extension σ̃:\xymatrix{F X \ar[r] & ⟨A, α⟩} equalizes e_{1} and e_{2}. That is,

⟨A, α⟩ ⊧ E iff for all σ:\xymatrix{X \ar[r] & A}, Uσ̃ ∘ e_{1} = Uσ̃ ∘ e_{2}.

Let ẽ_{1} and ẽ_{2} be the adjoint transposes of e_{1} and e_{2}, respectively. Let

q_{E}:\xymatrix{F X \ar@{|->}[r] & ⟨Q_{E}, ν_{E}⟩}

be the coequalizer of ẽ_{1} and ẽ_{2}, shown below^{1}.

\xymatrix{F E \ar[r]^{ẽ_{1}} \ar[r]_{ẽ_{2}} & F X \ar@{|->}[r]^{q_{E}} & ⟨Q_{E}, ν_{E}⟩}

We note that σ̃ equalizes ẽ_{1} and ẽ_{2} just in case Uσ̃ equalizes e_{1} and e_{2}. Thus, ⟨A, α⟩ ⊧ E just in case, for every homomorphism

σ̃:\xymatrix{F X \ar[r] & ⟨A, α⟩},

there is a unique homomorphism

\overline{σ}:\xymatrix{⟨Q_{E}, ν_{E}⟩ \ar[r] & ⟨A, α⟩}

such that the diagram below commutes.

\xymatrix{F X \ar[r]^{Uσ̃} \ar@{|->}[d]_{q_{E}} & ⟨A, α⟩ \\ ⟨Q_{E}, ν_{E}⟩ \ar[ur]_{\overline{σ}}}

We take this property as central to a generalization of equation satisfaction. We recall the definition of orthogonality, which can be found in [Bor94] and other introductory texts.

Definition 3.2.4. A map f:\xymatrix{A \ar[r] & B} is called orthogonal to an object X (written f ⊥ X) if, for every map a:\xymatrix{A \ar[r] & X}, there is a unique map b:\xymatrix{B \ar[r] & X} such that a = b∘f.

Thus, ⟨A, α⟩ ⊧ E iff q_{E} ⊥ ⟨A, α⟩.

This leads to the following definition of equational variety:

Definition 3.2.5. Let E^{Γ} be a quasi-Birkhoff category and let V be a full subcategory of E^{Γ}. We say that V is an equational variety if

V = {⟨A, α⟩ | q ⊥ ⟨A, α⟩}

for some regular epi q with domain F X (for some X ∈ E).

1We could instead consider the coequalizer of ⟨E⟩, the pre-congruence containing E (see Section 1.4.2) The coequalizer of ⟨E⟩ is isomorphic to the coequalizer of ẽ_{1} and ẽ_{2}, though we omit the proof.

3.2. A CATEGORICAL APPROACH 119

Equivalently, following the presentations of [AN81a, BH76, AR94], etc., one could say that an equational variety is just the injectivity class of some quotient \xymatrix{F X \ar@{|->}[r] & Q}. The author discovered these alternative approaches after developing the theory in terms of orthogonality, and we present that development here.

3.2.3. Orthogonality. Definition 3.2.5 indicates the basic approach that we take: orthogonality is a generalization of satisfaction of a set of equations. In this section, we introduce some notation for discussing orthogonality and state some basic results.

If S is a collection of arrows of C, we write S ⊥ C if f ⊥ C for all f ∈ S. Similarly, if V is a collection of objects (equivalently, a full subcategory) of C, we write f ⊥ V if f ⊥ C for each C ∈ V. We define the notation S ⊥ V in the obvious way.

Given a category C and a collection of maps S in C, S^{⊥} is the collection of all objects C of C such that S ⊥ C. Similarly, given a collection of objects V of C, V^{⊥} is the collection of all arrows f in C such that f ⊥ V.

In these terms, V is an equational variety just in case V = \{q:\xymatrix{F X \ar@{|->}[r] & •}\}^{⊥} for some regular epi q.

The class of all collections of maps of C forms a poset, Sub(C_{1}), taking inclusion as the ordering. Similarly, the class of all full subcategories of C forms a poset, Sub(C_{0}). Thus, the ⊥ operators are maps between posets. Since S ⊆ T implies S^{⊥} ⊇ T^{⊥}, and likewise for the ⊥ operator with domain Sub(C_{0}), we can view these operators as functors

\xymatrix{Sub(C_{1}) \ar[r] & (Sub(C_{0}))^{op} \ar[l]}

It is easy to see that, given a collection of maps S and a full subcategory V, S^{⊥} ⊆ V iff S ⊇ V^{⊥}. Thus, the two ⊥ functors form a Galois correspondence (see [Bor94, Volume 1, Example 3.1.6.m]) and so ⊥⊥ is a closure operation.

Given a collection of arrows, S, we say that S spans the collection of arrows S^{⊥⊥}. In particular, if S^{⊥} = V, then S spans V^{⊥}. Because the ⊥ functors form a Galois correspondence, S^{⊥} = S^{⊥⊥⊥}. Thus, if S^{⊥} = V, we have V = V^{⊥⊥}. In this case, we say that V is closed.

Remark 3.2.6. The subcategory S^{⊥} is denoted Inj(S) by some authors, to denote the collection of objects which are injective with respect to S.

3.2.4. An abstract version of Birkhoff’s theorem. In this section, we prove a quasi-variety theorem for abstract categories. This theorem is essentially found in [BH76] and is generalized in various articles by Andreéka and Németi, but was independently proven by the author before being referred to these articles^{2}.

2Thanks to Jiří Adámek and an anonymous reviewer for [Hug01] for these references.

120 3. BIRKHOFF’S VARIETY THEOREM

Theorem 3.2.7. Let C be a quasi-Birkhoff category and V a full subcategory of C. The following are equivalent.

(1) V is closed under products and subobjects (i.e., V is a quasi-variety).

(2) V is a regular epi-reflective subcategory of C. That is, a subcategory whose inclusion U^{V} :\xymatrix{V \ar[r] & C} has a left adjoint F^{V} such that each component of the unit η^{V} :\xymatrix{U^{V}F^{V} \ar[r] & 1_{C}} is a regular epi.

(3) V is closed. I.e., V = S^{⊥} for some collection S of regular epis.

Proof. We prove each implication in turn.

(1)⇒(2): We first show that the inclusion U^{V} has a left adjoint. Since V is closed under limits, it suffices, by the adjoint functor theorem ([Bor94, Volume 1,Theorem 3.3.3]), to show that for each C ∈ C, there is a set of objects Θ_{C} ⊆ V such that for each K ∈ V and each f:\xymatrix{C \ar[r] & K} in C, f factors through some K′ ∈ Θ_{C}.

Take Θ_{C} to be the collection of quotients of C in V. This is a set, since C is regularly co-well-powered. Given any f:\xymatrix{C \ar[r] & K} with K ∈ V, we take the regular epi factorization of f, shown below.

[figure: C; f; K; K′]

Then K′ is in V, since V is closed under subobjects. Thus, we may take K′ to be an object of Θ_{C}.

Because V is closed under subobjects, the reflection is a regular epireflection ([Bor94, Volume 1, Proposition 3.6.4]).

(2)⇒(3): We will show that (η^{V})^{⊥} = V. That V ⊆ (η^{V})^{⊥} is obvious from the characteristic property of η^{V} :\xymatrix{1 \ar@{=>}[r] & U^{V}F^{V}} . We will show the other inclusion. Accordingly, suppose that η^{V} ⊥ C. Then η_{C}^{V} ⊥ C in particular and thus, there is a map \overline{id}:\xymatrix{U^{V}F^{C}C \ar[r] & C} such that the diagram below commutes:

[figure: C; η_{C}^{V}; C; U^{V}F^{V}C; \overline{id}]

Since η_{C}^{V} is thus both regular epi and mono, it is an isomorphism. Since V is closed under isomorphisms (Remark 3.2.3), C ∈ V.

(3)⇒(1): Let S be a collection of regular epis and V = S^{⊥}. It is easy to see that V is closed under products. Suppose that K′ ∈ V and i:[figure: K; K′]. Let f:\xymatrix{A \ar@{|->}[r] & B} ∈ S^{⊥} and g:\xymatrix{A \ar[r] & K} be given, as in Figure 1. Then, since f ⊥ K′, there is a unique map \overline{ı ∘ g}:\xymatrix{B \ar[r] & K′} such that \overline{ı ∘ g} ∘ f = i ∘ g. Since f is regular and hence strong, there is a unique map \overline{g}, as shown, making the diagram commute.

[figure: A; g; f; K; i; B; \overline{g}; \overline{i∘g}; K′]

Figure 1. S^{⊥} is closed under subobjects.

□

Corollary 3.2.8. Let C be a quasi-Birkhoff category and V a quasi-variety of C. Then

(1) V = (η^{V})^{⊥}.

(2) For each C ∈ C, C ∈ V iff η_{C}^{V} ⊥ C, where η^{V} is the unit of the adjunction F^{V} ⊣ U^{V}.

(3) The counit ε^{V} :\xymatrix{F^{V}U^{V} \ar[r] & 1_{V}} is an isomorphism.

(4) The corresponding monad, T^{V} = U^{V}F^{V}, is idempotent.

(5) The monad T^{V} preserves regular epis.

Proof. We sketch each item in turn.

(1) See the proof of (2)⇒(3) in Theorem 3.2.7.

(2) If C ∈ V, then C ⊥ η_{C}^{V} by (1). On the other hand, if C ⊥ η_{C}^{V}, then C ≅ T^{V}C by the proof of (2)⇒(3) in Theorem 3.2.7.

(3) The functor U^{V} is full and faithful, so [Bor94, Proposition 3.4.1, Volume 1] applies.

(4) This follows from [Bor94, Volume 2, Theorem 4.2.4], and can also be seen directly in the proof of (2)⇒(3).

(5) Let q:\xymatrix{A \ar[r] & Q} be a regular epi. Since T^{V}q ∘ η_{A}^{V} = η_{Q}^{V} ∘ q and the right hand side is a regular epi, so is T^{V}q (see Figure 2).

\xymatrix{T^{V}A \ar[r] & T^{V}Q \\ A \ar@{|->}[u]^{η_{A}^{V}} \ar@{|->}[r]_{q} & Q \ar@{|->}[u]_{η_{Q}^{V}}}

Figure 2. T^{V} preserves regular epis.

□

Example 3.2.9. Set is quasi-Birkhoff. However, the only quasi-varieties of Set are trivial. Let V be a quasi-variety. If 2 ∈ V, then 2^{α} is in Set for every ordinal α. Since V is closed under subobjects, we have that V = Set. If 2 ∉ V, then V must consist of just 0 and 1.

Example 3.2.10. The category of monoids, Mon, is complete, regular and wellpowered. Hence, Mon is a quasi-Birkhoff category. Let V be the subcategory of Mon consisting of all those monoids satisfying

∀x ∈ M(x^{2} = e → x = e).

Then V is clearly closed under subalgebras and limits. Thus, by Theorem 3.2.7, V is a regular epi-reflective subcategory of Mon.

3.2.5. The generalized Birkhoff variety theorem. The following may be seen as a generalization of Birkhoff’s variety theorem. Recall from Section 3.2.2 that a class V of Γ-algebras satisfies a set E of equations over a set X of variables just in case V is orthogonal to a certain regular epi with domain F X. In the following theorem, we show that V is a Birkhoff variety iff V is orthogonal to a collection of regular epis with regular projective domains. The regular projective objects play the role of F X (which is regular projective if X is regular projective) in this theorem.

Once we have proven this theorem and shown that it applies to categories of algebras E^{Γ} (for appropriate base E and functor Γ), we have still not quite recovered the classical theorem. In particular, we will have shown, essentially, that any variety of algebras V is definable by a class of equations (i.e., V = S^{⊥} for a class of arrows S), rather than by a set of equations. This property is the distinction between Birkhoff categories and uniformly Birkhoff categories, which we discuss in Section 3.4.

Theorem 3.2.11. If C is a Birkhoff category, then a full subcategory V is a variety iff V^{⊥} is spanned by a collection of regular epis with regular projective domains.

Proof. Suppose that V is a variety. Then V is a regular epi-reflective subcategory of C. Let F^{V} ⊣ U^{V} with unit η^{V}, as in Theorem 3.2.7. For each C ∈ C, pick a regular epi p_{C}:\xymatrix{A_{C} \ar[r] & C}, with A_{C} regular projective, and let S be the collection of all

η_{A_{C}}^{V} :\xymatrix{A_{C} \ar@{|->}[r] & U^{V}F^{V}A_{C}} .

Then S ⊆ (η^{V}) and so S^{⊥} ⊇ (η^{V})^{⊥} = V. To see that V = S^{⊥}, suppose that S ⊥ C and we will show that C ∈ V. Since S ⊥ C, there is a map \overline{p_{C}} such that

3.2. A CATEGORICAL APPROACH 123

\overline{p_{C}} ∘ η_{A_{C}}^{V} = p_{C}.

\xymatrix{A_{C} \ar@{|->}[d]_{η_{A_{C}}^{V}} \ar@{|->}[r]^{p_{C}} & C \\ U^{V}F^{V}A_{C} \ar@{|->}[ur]_{\overline{p_{C}}}}

Since p_{C} is a regular epi, so is \overline{p_{C}}. Thus, C is a quotient of U^{V}F^{V}A_{C} and hence is in V.

Suppose conversely that V^{⊥} is spanned by a collection S of regular epis with regular projective domains. Then V is closed under subobjects and limits (Theorem 3.2.7), so it suffices to show that V is closed under quotients. Let K ∈ V and p:\xymatrix{K \ar@{|->}[r] & K′} be given. We wish to show that S ⊥ K′. Let f:\xymatrix{A \ar@{|->}[r] & B} ∈ S and g:\xymatrix{A \ar[r] & K′} be given.

\xymatrix{A \ar[r]^{g′} \ar@{|->}[d]_{f} \ar[dr]_{g} & K \ar@{|->}[d]^{p} \\ B \ar[r]_{p∘\overline{g}} & K′}

Since A is regular projective, there is a g′:\xymatrix{A \ar[r] & K} such that p ∘ g′ = g. Since f ⊥ K, there is a unique \overline{g}:\xymatrix{B \ar[r] & K} such that \overline{g} ∘ f = g′. Thus,

p ∘ \overline{g} ∘ f = p ∘ g′ = g.

Because f is epi, p ∘ \overline{g} is the unique map with this property. □

Example 3.2.12. Consider the full subcategory Ab of Mon consisting of abelian monoids. That is, a monoid M is in Ab just in case for every m, n in M,

m · n = n · m.

This subcategory is a variety of Mon. It is easy to see that, if M is abelian and N is the homomorphic quotient of M, then N is abelian.

Ab^{⊥} is spanned by a single regular epimorphism with regular projective domain. Let F 2 be the free monoid generated by two elements, a and b. Let ab, ba:\xymatrix{1 \ar[r] & UF 2} be the obvious constant maps. These correspond under adjoint transposition to maps

\xymatrix{F 1 \ar[r]^{\overline{ab}} \ar[r]_{\overline{ba}} & F 2.}

Take the coequalizer q: \xymatrix{F 2 \ar@{|->}[r] & Q} of these homomorphisms. Then a monoid M is evidently in Ab iff q ⊥ M.

Example 3.2.13. Consider again the full subcategory V of Mon consisting of monoids where no non-unit element is its own inverse (from Example 3.2.10). This

[figure: T^{V}/f; T^{V}K; T^{V}k_{1}; T^{V}k_{2}; T^{V}A; p; T^{V}q; T^{V}Q; \overline{g}; K; η_{K}^{V}; k_{1}; k_{2}; A; η_{A}^{V}; q; Q; η_{Q}^{V}; g]

Figure 3. T^{V} preserves coequalizers.

subcategory is not closed under quotients. For instance, the map

p:\xymatrix{ℕ \ar@{|->}[r] & 2}

taking even numbers to 0 and odd numbers to 1 is a regular epi in Mon, but 2 ∉ V.

In Corollary 3.2.8, we saw that, if V is a quasi-variety, then T^{V} preserves regular epis. We can strengthen that result if V is a variety.

Corollary 3.2.14. If V is a variety, then the monad T^{V} :\xymatrix{C \ar[r] & C} preserves coequalizers.

Proof. Let

\xymatrix{K \ar[r]^{k_{1}} \ar[r]_{k_{2}} & A \ar@{|->}[r]^{q} & Q}

be a coequalizer. Suppose that f:\xymatrix{T^{V}A \ar[r] & B} coequalizes T^{V}k_{1} and T^{V}k_{2}. Take the regular epi-mono factorization of f, f = i ∘ p (see Figure 3). Then

p ∘ η_{A}^{V} ∘ k_{1} = p ∘ T^{V}k_{1} ∘ η_{K}^{V}
= p ∘ T^{V}k_{2} ∘ η_{K}^{V}
= p ∘ η_{A}^{V} ∘ k_{2},

so there is a unique map g:\xymatrix{Q \ar[r] & B} such that p ∘ η_{A}^{V} = g ∘ q. Since T^{V}A/f ∈ V, the map g factors uniquely through T^{V}Q, say \overline{g} ∘ η_{Q}^{V} = g. This factorization gives the desired map

[figure: T^{V}Q; \overline{g}; T^{V}/f; i; B.]

Since \overline{g}∘T^{V}q = p and p is a regular epi, so is \overline{g}. By the uniqueness of regular epi-mono factorizations, i ∘ \overline{g} is the unique map such that i ∘ \overline{g} ∘ T^{V}q = f. □

3.3. CATEGORIES OF ALGEBRAS 125

3.3. Categories of algebras

In this section, we will show that Theorem 3.2.11 (the abstract variety theorem) is a generalization of the classical variety theorem. To this end, we must first show that categories of algebras E^{Γ} are Birkhoff categories, for suitable base categories E and endofunctors Γ. It will follow, then, that any Birkhoff variety V of E^{Γ} satisfies V = S^{⊥} for some collection S of regular epis with regular projective domains.

The classical theorem says that any variety is an equational variety for some set E of equations. If we apply Theorem 3.2.11 to categories E^{Γ}, we learn only that each variety is definable by some class of equations. To recover the classical theorem, some more work is needed. In Section 3.4.1, we will discuss further conditions on E and Γ that allow one to conclude that any Birkhoff variety is an equational variety.

The work in this section is similar to work found in [BH76] and extended by Andréyka and Németi. A similar approach is also found in [AR94].

3.3.1. Categories of algebras are Birkhoff categories. We will first look at some conditions that are sufficient to ensure that a category of algebras is a Birkhoff category, in the sense of Definition 3.2.1. Throughout this section, let E be an arbitrary category and let Γ be an endofunctor on E. As we will see, it is sufficient that E is quasi-Birkhoff and Γ preserves regular epis to conclude that E^{Γ} is quasi-Birkhoff.

Theorem 3.3.1. If E is quasi-Birkhoff and Γ preserves regular epis, then E^{Γ} is quasi-Birkhoff. The same claim holds for categories E^{𝕋} of algebras over a monad 𝕋 that preserves regular epis.

Proof. We need to show that E^{Γ} is regularly co-well-powered, complete and has regular epi-mono factorizations.

• E^{Γ} is complete by Theorem 1.2.4 (U creates limits).

• E^{Γ} has regular epi-mono factorizations by Theorem 1.2.13.

• E^{Γ} is regularly co-well-powered since E is regularly co-well-powered and U

preserves regular epis (Corollary 1.2.15). Since each of the above facts also holds for categories of algebras over a monad, so does this theorem. □

The additional requirement that ensures that E^{Γ} has enough regular projectives (so that E^{Γ} is a Birkhoff category) is natural enough. Given that E^{Γ} is quasi-Birkhoff, we need only the additional assumption that Γ is a varietor (that is, that U is monadic). This assumption is useful for our interpretation of equations and so is reasonable in this setting. However, recent work in [AP01] shows how to define equational varieties for categories of algebras without free algebras.

126 3. BIRKHOFF’S VARIETY THEOREM

Corollary 3.3.2. If E is Birkhoff, Γ preserves regular epis and U has a left adjoint, F, then E^{Γ} is Birkhoff. The same claim holds for categories E^{𝕋} of algebras for a regular-epi-preserving monad T.

Proof. Given ⟨C, γ⟩ in E^{Γ}, let p: \xymatrix{A \ar@{|->}[r] & C} be a regular projective covering of C. We will first show that F A is regular projective. Let f: \xymatrix{F A \ar[r] & ⟨D, δ⟩} and q:\xymatrix{⟨B, β⟩ \ar@{|->}[r] & ⟨D, δ⟩} be given (see Figure 4). Because A is regular projective, there

[figure: UF A; Uf; Uf^{#}; D; A; \overline{f}; η_{A}; B; Uq]

Figure 4. The free algebra over a regular projective object is regular projective.

is a map \overline{f} making the square commute. This ensures the existence of f^{#} making both triangles commute. Hence, F A is regular projective.

All that remains is to show that F A covers ⟨C, γ⟩. By the adjunction F ⊣ U, there is a unique map p^{#} :\xymatrix{F A \ar[r] & ⟨C, γ⟩} such that the diagram below commutes.

\xymatrix{UF A \ar@{|->}[dr]^{Up^{#}} \\ A \ar[u]_{η_{A}} \ar@{|->}[r]_{p} & C}

Because U reflects regular epis, p^{#} is a regular epi.

Since only the characteristic property of freeness was used in the above reasoning, and categories of algebras over a monad always have free algebras, the claim holds for E^{𝕋} as well. (Alternatively, prove the claim for categories E^{𝕋} and use the fact that, given the hypotheses, U is monadic, i.e., E^{Γ} ≡ E^{𝕋} for the monad 𝕋 induced by F ⊣ U.) □

Thus, if E is Birkhoff, Γ preserves regular epis and is a varietor, then Theorem 3.2.11 applies. Hence, a full subcategory V of E^{Γ} is a Birkhoff variety iff V is closed, and V^{⊥} is spanned by a collection of regular epis with regular projective domains. This is not quite sufficient to imply the classical variety theorem, however. For that, we need to show that there is a projective X such that

V is a Birkhoff variety iff V = \{q:\xymatrix{F X \ar@{|->}[r] & ⟨Q, ν⟩}\}^{⊥} for some regular epi q. In other words, we need to show that V is “definable” by a single regular epi q with regular projective domain, not a collection of such arrows. For this, we introduce the notion of “uniformly Birkhoff categories” in the next section.

3.4. UNIFORMLY BIRKHOFF CATEGORIES 127

We close this section with a proof that, if V is a variety over E^{𝕋}, then V is also monadic over E. Together with Corollary 3.2.14 (T^{V} preserves coequalizers), we see that V ≡ E^{𝕋′} for a regular-epi-preserving monad 𝕋′ and so is again a Birkhoff category. Hence, the variety theorem again applies, and subvarieties of V are equationally definable (by, perhaps, a proper class of equations).

Theorem 3.3.3. Let V be a variety of E^{𝕋}. Then V is monadic over E, via the evident forgetful functor.

Proof. We apply the special adjoint functor theorem (see [Bor94, Theorem 4.4.4,Volume 2]). Of course, U ∘U^{V} has a left adjoint and reflects isomorphisms since both U and U^{V} do. The functor U creates split coequalizers (since it is monadic) and U^{V} creates all coequalizers (an easy consequence of Corollary 3.2.14), the composite creates split coequalizers. □

3.4. Uniformly Birkhoff categories

We have shown that, if E is Birkhoff, Γ preserves regular epis and is a varietor, then E^{Γ} is Birkhoff. Thus, any variety V is defined by a collection of regular epis with regular projective domains. In terms of equations, this means that any variety V is defined by a class of equations over a class of variables. Birkhoff’s variety theorem [Bir35] says something stronger. Namely, that any variety V is defined by a set of equations over a countable set of variables.

Categorically, then, we must show that there is a regular projective X ∈ E such that, for any variety V, there is a regular epi p with domain X such that V = {p}^{⊥}. We state this condition in general terms in the following definition.

Definition 3.4.1. A Birkhoff category C is uniformly Birkhoff if there is a regular projective object X ∈ C such that for any variety V, V = {p}^{⊥} for some regular epi p with domain X. The object X is called the equational domain for C.

From Theorem 3.2.7, we know that any variety V satisfies

V = (η^{V})^{⊥}.

In a uniformly Birkhoff category, any variety satisfies a stronger condition: namely, that

V = \{η_{X}^{V} :\xymatrix{X \ar[r] & T^{V}X} \}^{⊥},

where X is the equational domain for C.

Theorem 3.4.2. Let C be uniformly Birkhoff and let X be the equational domain for C. Let V be a variety of C, with η^{V} the unit of the evident adjunction F^{V} ⊣ U^{V}. Then V = {η_{X}^{V}}^{⊥}.

128 3. BIRKHOFF’S VARIETY THEOREM

Proof. Let V be a variety of C and let p:\xymatrix{X \ar@{|->}[r] & Y} be given such that V = \{p\}^{⊥}. It suffices to show that, for all A ∈ C, if η_{X}^{V} ⊥ A, then p ⊥ A. This is clear, since η_{X}^{V} factors through p. □

The remainder of this section will be devoted to a discussion of conditions that ensure a category of algebras is uniformly Birkhoff. These conditions will be suggested by the original proof of the variety theorem. The conditions are also influenced by the work of [AR94], in which the theory of locally finitely presentable categories is developed. It appears, however, that a locally finitely presentable category isn’t sufficient for this goal. In one sense, we need a stronger condition: that regular projective objects are colimits of finitely presentable retracts. On the other hand, we don’t require that every object has a presentation. Instead, it suffices that certain regular projective objects have a retractable presentation in order to show that the category is uniformly Birkhoff.

We recall the following definitions from ibid.

Definition 3.4.3. An object K in C is finitely presentable if the functor

Hom(K, −):\xymatrix{C \ar[r] & Set}

preserves filtered colimits.

Definition 3.4.4. A category C is locally finitely presentable if it is cocomplete and there is a set A of finitely presentable objects of C such that every object is a filtered colimit of objects of A.

The remaining work is technical and abstruse. This section is self-contained — there are no later results in this thesis that require the definitions and theorems that follow. The casual reader may wish to skim what remains here.

Remark 3.4.5. Throughout this section, we use finitely presentable objects and prove facts about filtered colimits in C. This work can be generalized, so that the objects of interest are κ-presentable and the colimits are colimits of κ-filtered diagrams. We avoid the more general statements and proofs in order to present this work in a simpler form.

As we will see, a key step in showing that a category C is uniformly Birkhoff is showing that every variety of C is closed under filtered colimits. We first consider the case in which V = {η_{X}^{V}}^{⊥} where X is finitely presentable. In the classical setting, this corresponds to a variety of algebras which are defined by a set of equations over a finite set of variables. Such varieties are easily shown to be closed under filtered colimits. This fact will be used in Theorem 3.4.9, in which we prove that every variety (in a suitable category) is closed under filtered colimits.

Lemma 3.4.6. Let f:\xymatrix{X \ar@{->>}[r] & Q} be given with X finitely presentable. Then \{f\}^{⊥} is closed under filtered colimits.

Proof. Let A ∈ C and K:\xymatrix{𝔼 \ar[r] & C} be a filtered diagram such that A = colim K with colimiting cocone

k:\xymatrix{K \ar@{=>}[r] & A}.

Assume, further, that for each E ∈ 𝔼, f ⊥ KE. We will show that f ⊥ A, so that A ∈ {f}^{⊥}.

Let g:\xymatrix{X \ar[r] & A} be given. Since X is finitely presentable, there is an E ∈ 𝔼 and a map

\overline{g}:\xymatrix{X \ar[r] & KE}

such that g = k_{E} ∘ \overline{g}. Hence, there is a unique

g̃:\xymatrix{Q \ar[r] & KE}

such that \overline{g} = g̃∘ f and so g = k_{E} ∘ g̃∘ f (see Figure 5). Uniqueness follows from the

[figure: X; g; f; \overline{g}; A; Q; g̃; KE; k_{E}]

Figure 5. {f}^{⊥} is closed under filtered colimits.

fact that f is epi. □

We now turn our attention to a special case of a presentation by finitely presentable objects. In this case, we assume that an object is the filtered colimit of finitely presentable retracts, and so this is a stronger condition than that required by a locally presentable category. However, we will not require that every object has such a presentation (see Definition 3.4.8).

The notion of “retractably presentable regular projective” and Theorem 3.4.9 are due to Steve Awodey.

Definition 3.4.7. Let X ∈ C. We call a filtered diagram J:\xymatrix{𝔻 \ar[r] & C} a retractable presentation of C if J satisfies the following:

• colim J = X with cocone j:\xymatrix{J \ar@{=>}[r] & X};

• Each JD is finitely presentable;

• Each JD is a retract of X (i.e., for each j_{D}, there is a p_{D}:\xymatrix{X \ar@{|->}[r] & JD} such that p_{D} ∘ j_{D} = id_{JD}).

If there is a retractable presentation of X, then we say that X is retractably presentable.

Definition 3.4.8. A category C has enough retractably presentable regular projectives if each object of C is a quotient of a retractably presentable regular projective object.

It is easy to check that, in a Birkhoff category C with enough retractably presentable regular projectives, any variety is determined by regular epis with retractably presentable regular projective domains. In fact, if B is any class of regular projectives such that each object of C is covered by an object in B, then any variety is defined by regular epis with domains in B. Moreover, to confirm that an object A is in a variety V, it suffices to check that η_{X}^{V} ⊥ A for some X ∈ B covering A.

In a category with enough retractably presentable regular projectives, every variety V is closed under filtered colimits. This implies that the monad T^{V} preserves filtered colimits.

Theorem 3.4.9. Let C have enough retractably presentable regular projectives. Let V be a variety of C. Then V is closed under filtered colimits.

Proof. Let A ∈ C and K:\xymatrix{𝔼 \ar[r] & C} be a filtered diagram such that A = colim K with colimiting cocone

k:\xymatrix{K \ar@{=>}[r] & A}.

Assume, furthermore, that each KE ∈ V. We will show that A ∈ V.

Let X be a retractably presentable regular projective which covers A and let X = colim J with cocone j and retractions p, as in Definition 3.4.7. It suffices (by the proof of Theorem 3.2.11) to show that η_{X}^{V} ⊥ A to prove A ∈ V. Let ΘX be the kernel pair of η_{X}^{V} — so ΘX is the “set” of equations satisfied by T^{V}X.

For each D ∈ 𝔻, take the pullback ΘD as shown below.

[figure: ΘD; ΘX; JD × JD; j_{D}×j_{D}; X × X]

Because 𝔻 is filtered, ΘX is the colimit of the ΘD’s. Define a functor Q:\xymatrix{𝔻 \ar[r] & C} by taking QD to be the coequalizer of ΘD, as shown in Figure 6. Because colimits commute with coequalizers, T^{V}X is the colimit of Q.

We next show that

{η_{X}^{V}}^{⊥} ⊆ {q_{D} | D ∈ 𝔻}^{⊥}.

[figure: ΘX; X; p_{D}; η_{X}^{V}; T^{V}X; ΘD; ϑ_{D}; JD; q_{D}; j_{D}; QD; ν_{D}]

Figure 6. T^{V}X is the colimit of Q.

Let η_{X}^{V} ⊥ B and let f:\xymatrix{JD \ar[r] & B}. Let x_{1}, x_{2} (d_{1}, d_{2}, resp.) be the projections of ΘX (ΘD, resp.). Then,

f ∘ d_{1} = f ∘ p_{D} ∘ x_{1} ∘ ϑ_{D}
= f ∘ p_{D} ∘ x_{2} ∘ ϑ_{D}  (since η_{X}^{V} ⊥ B)
= f ∘ d_{2}

and so q_{D} ⊥ B.

Thus, since each η_{X}^{V} ⊥ KE by hypothesis, for each D ∈ 𝔻, we also have q_{D} ⊥ KE. Now, by definition, each JD is finitely presentable. Thus, by Lemma 3.4.6, A is orthogonal to each q_{D}. It is routine to check that, since colim Q = T^{V}X and each q_{D} ⊥ A, then also η_{X}^{V} ⊥ A. □

Theorem 3.4.10. Let C be a quasi-Birkhoff category and let V be a quasi-variety of C closed under filtered colimits (i.e., the inclusion \xymatrix{V \ar@{^{(}->}[r] & C} creates such colimits). Then the monad

T^{V} :\xymatrix{C \ar[r] & C}

preserves filtered colimits.

Proof. Let 𝔼 be filtered and let A be the colimit of K:\xymatrix{𝔼 \ar[r] & C}, with colimiting cocone k:\xymatrix{K \ar@{=>}[r] & A}. Let j:\xymatrix{T^{V}K \ar@{=>}[r] & B} be a colimiting cocone. We wish to show that B ≅ T^{V}A.

[figure: A; η_{A}^{V}; T^{V}A; m; KE; k_{E}; η_{KE}^{V}; T^{V}KE; j_{E}; B; n]

Because B ∈ V, η_{A}^{V} ⊥ B. Hence there is an m:\xymatrix{T^{V}A \ar[r] & B} such that j = m ∘ T^{V}k. Because j is colimiting, there is an n:\xymatrix{B \ar[r] & T^{V}A} such that n ∘ j = T^{V}k. It is routine to check that m and n are inverses. □

Let A = colim J:\xymatrix{𝔻 \ar[r] & C}, where 𝔻 is a filtered category and let V be a variety closed under filtered colimits. Then, in order to check whether an object C is orthogonal to

132 3. BIRKHOFF’S VARIETY THEOREM

η_{A}^{V}, it suffices to check that it is orthogonal to each η_{JD}^{V}. In the traditional setting, where C is a category of algebras and A = F X and each JE = F Y for some finite Y, this means the following: an algebra ⟨C, γ⟩ satisfies each of the equations (for V) over X just in case it satisfies each of the equations (for V) over a finite set of variables. We prove this claim in a general setting presently.

Corollary 3.4.11. Let C be quasi-Birkhoff and 𝔻 be filtered. Let J:\xymatrix{𝔻 \ar[r] & C} be given and X = colim J with colimiting cocone j:\xymatrix{J \ar@{=>}[r] & X}. Suppose, further, that V is closed under filtered colimits. Then

{η_{JD}^{V} | D ∈ 𝔻}^{⊥} ⊆ {η_{X}^{V}}^{⊥}.

Proof. Let \{η_{J}^{V}\} ⊥ A and f:\xymatrix{X \ar[r] & A} be given. Then, for each D ∈ 𝔻, there is a map f_{D}:\xymatrix{T^{V}D \ar[r] & A} such that f_{D} ∘ η_{JD}^{V} = f ∘ j_{D}. The f_{D}’s form a cocone over T^{V}J. Since the colimit of T^{V}J is T^{V}X, we have the factorization of f through η_{X}^{V}, as desired. □

Thus far, we have discussed a condition that ensures that every Birkhoff variety is closed under filtered colimits. While this is a step towards proving that a category is uniformly Birkhoff, there is still some work to be done. Specifically, given a Birkhoff category C with enough retractably presentable regular projectives, we must pick out a particular object X that will serve as an equational domain. The theorem below shows sufficient conditions for X to be an equational domain. These conditions are attained in Set, for instance, with X = ℕ.

The following lemma is the dual of Lemma 3.7.21. We prove it in Section 3.7.2.

Lemma 3.4.12. Let V be a variety in the Birkhoff category C and let A be a quotient of B. Then

{η_{B}^{V}}^{⊥} ⊆ {η_{A}^{V}}^{⊥}.

Theorem 3.4.13. Let C be Birkhoff and have enough retractably presentable regular projectives and let X satisfy the following:

• X is regular projective;

• The set of non-empty, finitely presentable objects is a retractable presentation

for X. Then C is uniformly Birkhoff and X is the equational domain for C.

Proof. Let B be the set of non-empty, finitely presentable objects, so that B is a retractable presentation of X.

Let V be a variety of C. Let A ∈ C and η_{X}^{V} ⊥ A. We will show that A ∈ V. It suffices to show that η_{Y}^{V} ⊥ A for a retractably presentable regular projective Y covering A. Let J:\xymatrix{𝔻 \ar[r] & C} be a retractable presentation for Y. Then, for each D ∈ 𝔻, JD is a quotient of X and so η_{JD}^{V} ⊥ A (Lemma 3.4.12). Thus, η_{Y}^{V} ⊥ A (Corollary 3.4.11). □

3.4.1. Uniformly Birkhoff categories of algebras. The preceding section demonstrated sufficient conditions for an abstract category to be uniformly Birkhoff. In this section, we show that, if E satisfies these conditions and Γ preserves regular epis and filtered colimits (more generally, κ-filtered colimits), then E^{Γ} is also uniformly Birkhoff. This will conclude the reconstruction of the classical Birkhoff variety theorem in a categorical setting.

In particular, the category Set satisfies the conditions of Theorem 3.4.13 (so Set is uniformly Birkhoff). Thus, if Γ:\xymatrix{Set \ar[r] & Set} preserves filtered colimits, then Set^{Γ} is uniformly Birkhoff. Moreover, the free algebra over a countable set is an equational domain for Set^{Γ}. In other words, if Γ preserves filtered colimits, then any variety of Set^{Γ} is definable by a set of equations over a countable set of variables (which is, of course, just the classical Birkhoff theorem as found in [Bir35]).

We begin by showing that if X is finitely presentable and Γ preserves filtered colimits, then the free algebra F X is finitely presentable. Hence, applying Lemma 3.4.6, we see that any V defined by a set of equations E over finitely presentable X is closed under filtered colimits.

Lemma 3.4.14. Let Γ:\xymatrix{E \ar[r] & E} preserve filtered colimits and be a varietor with F left adjoint to U:\xymatrix{E^{Γ} \ar[r] & E}. If X ∈ E is finitely presentable then F X is finitely presentable.

Proof. Let ⟨A, α⟩ = colim K:\xymatrix{𝔼 \ar[r] & E^{Γ}}, 𝔼 filtered, and f:\xymatrix{F X \ar[r] & ⟨A, α⟩}. Then

UA = colim UK

and so the adjoint transpose f̃:\xymatrix{X \ar[r] & A} of f factors through some UKE. Thus, f factors through KE. □

Lemma 3.4.14 ensures that E^{Γ} inherits the relevant structure (for Theorem 3.4.13) from E. In particular, one shows that if X is a retractably presentable regular projective, then so is F X (under the assumptions of Lemma 3.4.14). From this, it follows that E^{Γ} has enough retractably presentable regular projectives whenever E does. We show this in Theorem 3.4.15, which directly implies Birkhoff’s variety theorem for universal algebras. This completes the categorical approach to the 1935 theorem.

Theorem 3.4.15. Let E, X satisfy the conditions of Theorem 3.4.13. Let Γ be preserve regular epis and filtered colimits. Then E^{Γ} is uniformly Birkhoff and F X is an equational domain for E^{Γ}.

Proof. Let B be the category of non-empty, finitely presentable objects of E, so X = colim B. Then F X is the colimit of F B (left adjoints preserve limits), and for

134 3. BIRKHOFF’S VARIETY THEOREM

each B ∈ B, F B is finitely presentable. Furthermore, each F B is a quotient of F X, since F preserves coequalizers.

For each ⟨A, α⟩ ∈ E^{Γ}, there is a retractably presentable regular projective Y_{A} such that F Y_{A} covers ⟨A, α⟩. Furthermore, each F Y_{A} has a retractable presentation using the objects of F B. Now, F B is not the collection of all finitely presentable algebras. Nonetheless, a simple alteration of the proof of Theorem 3.4.13 using the above facts shows that F X is an equational domain (for our purposes, F B is a sufficient collection of finitely presentable algebras). □

Example 3.4.16. If Γ:\xymatrix{Set \ar[r] & Set} preserves filtered colimits (for instance, if Γ is a polynomial), then F ℕ is a presentational domain for Set^{Γ}. Consequently, F ℕ is an equational domain for Set^{Γ}. In other words, every variety in Set^{Γ} is defined by a set of equations over a countable set of variables.

We finish this section by showing that Theorem 3.4.17 does indeed yield the traditional statement of Birkhoff’s theorem. To do this, we first recall the definitions from Section 3.2.2

An equation over X is a pair of global elements

\xymatrix{1 \ar[r] \ar[r] & UF X}

of UF X and that a set of equations over X is given by a pair of maps

\xymatrix{E \ar[r]^{e_{1}} \ar[r]_{e_{2}} & UF X} .

An algebra ⟨A, α⟩ satisfies E just in case, for every homomorphism

σ̃:\xymatrix{F X \ar[r] & ⟨A, α⟩},

Uσ̃ coequalizes e_{1} and e_{2}. Equivalently, ⟨A, α⟩ ⊧ E just in case q ⊥ ⟨A, α⟩, where q is the coequalizer of

\xymatrix{F E \ar[r] \ar[r] & F X} .

With these definitions in mind, it is easy to see that Birkhoff’s variety theorem is a corollary to Theorem 3.4.15.

Theorem 3.4.17. Let E be a Birkhoff category and Γ preserve regular epis and is a varietor. Suppose, further, that the category E^{Γ} is uniformly Birkhoff, with equational domain F X. A full subcategory V of E^{Γ} is a variety iff there is a set E of equations over X such that

⟨A, α⟩ ∈ V iff ⟨A, α⟩ ⊧ E.

Proof. Let V be a variety and η^{V} the unit of the adjunction F^{V} ⊣ U^{V}. Let ΘX be the kernel pair of η^{V}. Then

⟨A, α⟩ ∈ V iff ⟨A, α⟩ ⊧ UΘX.

□

3.5. Deductive closure

We continue developing the results of Section 3.4.1. Consequently, throughout we assume that E is a Birkhoff category, Γ preserves regular epis and is a varietor. Also, we fix a regular projective X ∈ E. For another presentation of this material and the material of Section 3.8, see [Hug01].

Birkhoff’s variety theorem may be viewed as showing an equivalence between equational definability on the one hand and closure under the operators H, S and P from Section 3.2.1 on the other. When we say that a class V is equationally definable (over the fixed set X of “variables”), we mean that there is a set E of equations over X such that V consists of just those algebras which satisfy E. This suggests an operator

Sat_{X}:\xymatrix{Rel(UF X, UF X) \ar[r] & Sub(E^{Γ})},

taking a set E of equations to the variety

Sat_{X}(E) = {⟨A, α⟩ ∈ E^{Γ} | ⟨A, α⟩ ⊧ E}

(hereafter, we omit the subscript). In other words, if q is the coequalizer of the diagram

\xymatrix{F E \ar[r] \ar[r] & F X,}

then Sat(E) = {q}^{⊥}. In these terms, Theorem 3.4.17 says that, for any class V of algebras,

V = HSP V

just in case there is some E ≤ UF X × UF X such that

V = Sat(E).

One may ask whether there is an analogous result for sets of equations. That is, given a set E of equations, when does E consist of exactly those equations which hold in some variety V?

More precisely, we define an operator

Id_{X}:\xymatrix{Sub(E^{Γ}) \ar[r] & Rel(UF X, UF X)}

(hereafter, omitting the subscript) taking a class of algebras V to the set of equations

{e_{1} = e_{2} | V ⊧ e_{1} = e_{2}}.

In terms of the ⊥ operators from Section 3.2.3,

Id V = ⋃\{ker(f:\xymatrix{F X \ar[r] & •}) | f ∈ V^{⊥}\}.

136 3. BIRKHOFF’S VARIETY THEOREM

Notice that the operators Id and Sat form a Galois correspondence. That is, for all classes of algebras V and sets of equations E, we have

V ≤ Sat(E) iff Id(V) ≥ E.

Remark 3.5.1. The operators Sat and Id could be defined for any algebra ⟨A, α⟩, of course, and not just the free algebras F X. We focus on the free algebras here for their importance in the completeness and variety theorems.

We would like to find conditions on E that ensure E = Id(V) for some class V of algebras. Birkhoff’s completeness theorem [Bir35] provides that condition.

Classically, given a signature Σ, a set E of equations over X is deductively closedclosed!deductively – if it satisfies the following:

(i) For each x ∈ X, x = x ∈ E; (ii) If τ_{1} = τ_{2} ∈ E, then τ_{2} = τ_{1} ∈ E; (iii) If τ_{1} = τ_{2} ∈ E and τ_{2} = τ_{3} ∈ E, then τ_{1} = τ_{3} ∈ E; (iv) If f^{(n)} ∈ Σ and τ_{1} = υ_{1}, τ_{2} = υ_{2}, …, τ_{n} = υ_{n} are in E, then f^{(n)}(τ_{1}, τ_{2}, …, τ_{n}) =

f^{(n)}(υ_{1}, υ_{2}, …, υ_{n}) ∈ E.

(v) For any assignment of variables σ:\xymatrix{X \ar[r] & UF X}, if τ_{1} = τ_{2} ∈ E, then σ̃(τ_{1}) = σ̃(τ_{2}) ∈ E.

Theorem (Birkhoff’s completeness theorem). Let E be a set of equations. Then E = Id(V) for some class of algebras V iff E is deductively closed.

We can restate the definition of deductive closure in categorical terms (and, in particular, eliminate the reference to function symbols in (iv)). For this, we require a definition.

Definition 3.5.2. Let \xymatrix{E \ar[r] \ar[r] & UF X} be a set of equations over X. We say that E is endomorphism-stable (or just stable) if, for every homomorphism

σ:\xymatrix{F X \ar[r] & F X} ,

there is a (necessarily unique) map ψ:\xymatrix{E \ar[r] & E} such that the diagram below commutes.

\xymatrix{E \ar[d] \ar[d] \ar@{.>}[r]^{ψ} & E \ar[d] \ar[d] \\ UF X \ar[r]_{Uσ} & UF X}

More generally, if

\xymatrix{E \ar[r]^{e_{1}} \ar[r]_{e_{2}} & A}

is a relation over the carrier of a algebra ⟨A, α⟩, we say that E is stable if, for every Γ-endomorphism ϕ:\xymatrix{⟨A, α⟩ \ar[r] & ⟨A, α⟩}, there is a map ψ:\xymatrix{E \ar[r] & E} such that ϕ∘e_{1} = e_{1}∘ψ and ϕ ∘ e_{2} = e_{2} ∘ ψ.

3.5. DEDUCTIVE CLOSURE 137

Let E be a relation over UF X. Then E is closed!deductively –deductively closed just in case the following hold. (i′) ⟨η_{X}, η_{X}⟩ factors through E; (ii′) E is symmetric; (iii′) E is transitive; (iv′) E is (the carrier of) a pre-congruence; (v′) E is stable.

We first show a couple of easy theorems about the relationship between deductive completeness and stable congruences. The first theorem relates orthogonality to stability, and so ties up some of the previous work with this section. The theorem thereafter shows that stable congruences over F X just are the sets of deductively closed equations — an easy consequence. Following this, we show that, given an equationally defined variety V, the set of equations Id(V) is exactly the kernel of η_{F X}^{V}.

Theorem 3.5.3. Let

\xymatrix{E \ar[r]^{e_{1}} \ar[r]_{e_{2}} & UF X}

be a set of equations over regular projective X, and q:\xymatrix{F X \ar[r] & ⟨Q, ν⟩} the coequalizer of

\xymatrix{F E \ar[r] \ar[r] & F X.}

If E is stable then q ⊥ ⟨Q, ν⟩. Conversely, if E is the kernel pair of q and q ⊥ ⟨Q, ν⟩, then E is stable.

Proof. Suppose that E is stable and let f:\xymatrix{F X \ar[r] & ⟨Q, ν⟩} be given. Because F X is regular projective, there is a map σ:\xymatrix{F X \ar[r] & F X} such that f = q∘σ. Let ϕ:\xymatrix{E \ar[r] & E} be given as in Definition 3.5.2. Then, a simple diagram chase through Figure 7 confirms that q ∘ σ coequalizes ẽ_{1} and ẽ_{2}, yielding the desired map ψ, as shown.

[figure: F E; F ϕ; ẽ_{1}; ẽ_{2}; F X; f; σ; q; ⟨Q, ν⟩; ψ; F E; ẽ_{1}; ẽ_{2}; F X; q; ⟨Q, ν⟩]

Figure 7. E is stable iff q ⊥ ⟨Q, ν⟩.

Conversely, suppose that E is the kernel pair of q and q ⊥ ⟨Q, ν⟩. Let

σ:\xymatrix{F X \ar[r] & F X}

138 3. BIRKHOFF’S VARIETY THEOREM

be given. Since q ⊥ ⟨Q, ν⟩, there is a unique

ψ:\xymatrix{⟨Q, ν⟩ \ar[r] & ⟨Q, ν⟩}

such that q ∘σ = ψ ∘q. Hence, q coequalizes σ ∘e_{1} and σ ∘e_{2} and so, there is a unique map

ϕ:\xymatrix{E \ar[r] & E}

as desired. □

Theorem 3.5.4. A set of equations E is deductively closed iff E is a stable congruence.

Proof. E is a stable congruence if and only if, in addition to Conditions (ii’)

- (v’), E is reflexive (i.e., the diagonal arrow Δ_{UF X}:\xymatrix{UF X \ar[r] & UF X × UF X} factors through [figure: E; UF X × UF X]. If E is reflexive, then clearly ⟨η_{X}, η_{X}⟩ factors through E and so Condition (i’) is satisfied.

[figure: UF X; δ_{UF X}; UF X × UF X; X; η_{X}; E]

Figure 8. If E is deductively closed, then it is a stable congruence.

On the other hand, suppose that E is deductively closed. By (i’), ⟨η_{X}, η_{X}⟩ factors through E, as shown in Figure 8. By (iv’), there is a structure map ε:\xymatrix{E \ar[r] & ΓE} such that ⟨E, ε⟩ is a relation over F X in E^{Γ}. Consequently, there is a unique homomorphism \xymatrix{F X \ar[r] & ⟨E, ε⟩} making the lower triangle commute, as shown. It is easy to confirm that the upper triangle also commutes and thus that E is reflexive.. □

As one would expect, if V is defined by a set of equations over X, then η_{F X}^{V} is just the coequalizer of Id(V). This shows the connection between the work in previous sections and the current approach in terms of deductive completeness.

Lemma 3.5.5. For any variety V of the form V = Sat(E) for some set of equations E over X, Id(V) = ker η_{F X}^{V}.

Proof. Since η_{F X}^{V} ∈ V^{⊥} and Id V = ⋃\{ker(f:\xymatrix{F X \ar[r] & •}) | f ∈ V^{⊥}\}, we see ker η_{F X}^{V} ≤ Id(V). Conversely, since T^{V}F X ∈ V, it is orthogonal to each f ∈ V^{⊥}. Consequently, each ker f factors through ker η_{F X}^{V} and, hence, so does Id(V). □

Theorem 3.5.6 is the categorical version of Birkhoff’s deductive completeness theorem.

Theorem 3.5.6. Let Γ preserve exact sequences, so E^{Γ} is exact. Let

\xymatrix{E \ar[r]^{e_{1}} \ar[r]_{e_{2}} & UF X}

be a set of equations over X. Then E = Id(V) for some class V of algebras iff E is a stable congruence.

Proof. Let E = Id(V) for some class V of algebras. By the Galois correspondence Id ⊣ Sat, we know that E ≤ Id Sat(E). Since V ≤ Sat(E), we also have Id Sat(E) ≤ Id(V) = E. Thus, E = Id Sat(E). Since Sat(E) is a variety, we can make use of the work of the preceding sections. Let 𝕋^{E}:\xymatrix{E^{Γ} \ar[r] & E} be the associated monad, with unit η^{E}.

By Lemma 3.5.5, E = ker η_{F X}^{E}. Hence, in particular, E is a congruence. Let σ:\xymatrix{X \ar[r] & UF X} be given. Since 𝕋^{E}F X ∈ Sat(E), η_{F X}^{E} coequalizes the composite σ̃ ∘ e_{1} and σ̃ ∘ e_{2}. Because E is the kernel pair of η_{F X}^{E}, we have the factorization \xymatrix{E \ar[r] & E}, as desired. Hence, E is stable.

Let E be a stable congruence and let q:\xymatrix{F X \ar[r] & ⟨Q, ν⟩} be the coequalizer of

\xymatrix{F E \ar[r] \ar[r] & F X} .

Let V = q^{⊥} (i.e., V = Sat(E)). Because E is stable, q ⊥ ⟨Q, ν⟩, so ⟨Q, ν⟩ ∈ V. Hence, ⟨Q, ν⟩ ≅ T^{V}F X. Since E is a congruence, it is the kernel pair of its coequalizer. Thus, by Lemma 3.5.5, Id(V) = E. □

Remark 3.5.7. Theorem 3.5.6 applies more generally than stated. If E is a relation over A = U⟨A, α⟩ (not necessarily free), then E = Id(V) for some class V of algebras iff E is a stable congruence. In this more general case, Sat(E) is, of course, a quasi-variety rather than a variety.

Corollary 3.5.8. For any set E of equations over regular projective X,

Id(Sat(E)) = ker η_{F X}^{E},

where η^{E} is defined as in the proof of Theorem 3.5.6.

Theorem 3.5.9. Assume that E^{Γ} is uniformly Birkhoff, with F X an equational domain. Let Var be the collection of varieties of E^{Γ}, ordered by reverse inclusion and let Ded be the collection of stable congruences over F X (an equational domain), ordered by inclusion. Then Ded ≅ Var.

Proof. Var is the collection of fixed points of Sat ∘ Id, while Ded is the collection of fixed points of Id ∘ Sat. The functors Id and Sat are isomorphisms when restricted to Fix(Sat ∘ Id) and Fix(Id ∘ Sat), respectively. □

140 3. BIRKHOFF’S VARIETY THEOREM

The isomorphism between varieties and stable congruences is a result of the isomorphism between congruences and coequalizers in E^{Γ}. We stated Theorem 3.5.9 in terms of stable congruences (i.e., deductively closed sets of equations) in keeping with the historical motivation and with the traditional notion of “equationally defined class”. However, one has the same result, more or less, in an abstract uniformly Birkhoff category. We sketch the theorem here.

Let C be a uniformly Birkhoff category with equational domain X (i.e., for any variety V, V = \{η^{V}\}^{⊥}). Call a quotient q:\xymatrix{X \ar@{|->}[r] & Q} stable if q ⊥ Q. In other words, q is stable just in case Q ∈ \{q\}^{⊥}. If V = \{q\}^{⊥}, then, q:\xymatrix{X \ar[r] & Q} is stable just in case Q ≅ 𝕋^{V}X (and q ≅ η_{X}^{V}).

The quotients of X may be partially ordered by Q ≤ Q′ if there is a (necessarily regular epi) \xymatrix{Q \ar@{|->}[r] & Q′} in X/C. The resulting order StQ of stable quotients of X is isomorphic to the collection Var of varieties in C, ordered by reverse inclusion. The isomorphism takes a stable q to {q}^{⊥}, while the inverse takes a variety V to the unit η_{X}^{V}.

.

3.6. The coalgebraic dual of Birkhoff’s variety theorem

We now consider the dual of Birkhoff’s theorem in categories of coalgebras. To begin, we dualize the definitions of Birkhoff, variety, etc., to prove the dual of Theorem 3.2.11. Following this, we show how this theorem applies to categories of coalgebras.

The co-Birkhoff theorem has been a hot topic lately, beginning with Jan Rutten’s co-Birkhoff theorem for Set ([Rut96]). Peter Gumm and Tobias Schröder continued developing the co-Birkhoff theorem over Set in [GS98]. The following material essentially dualizes the work done in the previous sections, so coequation satisfaction is again an orthogonality condition (formally dual to equation satisfaction). It can be seen as an extension of the work in [BH76], further developed in the papers of Andréyka and Németi [AN83, Ném82, AN81a, AN81b, AN79a, AN79b, AN78], discovered by the author after this work was completed independently. The same approach was taken by Alexander Kurz in his dissertation [Kur00], again independently of the author.

3.6.1. The dual definitions. Here, we give the dual of the relevant definitions in Section 3.2.1. This is straightforward, but we will explicitly state the definitions here.

An arbitrary category is a quasi-co-Birkhoff category if it is regularly well-powered, cocomplete and has epi-regular mono factorizations. Recall that a category has

3.6. THE COALGEBRAIC DUAL OF BIRKHOFF’S VARIETY THEOREM 141

enough regular injectives if every object is a regular subobject of an regular injective object. If, in addition, the category has enough regular injectives, then it is a category!co-Birkhoff .

Example 3.6.1. Any co-complete topos E is co-Birkhoff. That it is regularly wellpowered and has epi-regular mono factorizations is clear. Because each object C ∈ E has a mono \xymatrix{C \ar[r] & PC} and PC is regular injective, E has enough regular injectives [LM92, Corollary IV.10.3].

Example 3.6.2. Top is a co-Birkhoff category. It is obvious that Top is regularly well-powered, since monos in Top are regular injective functions. Also, every space ⟨X, O⟩ is a regular subobject of an regular injective space. Namely, we can take the space X and adjoin a single point whose singleton is open. This new space is regular injective. That Top is cocomplete and has epi-regular mono factorizations is well-known (a regular mono in Top is an embedding).

In Theorem 3.6.7, we will show that, given the category E is co-Birkhoff and that Γ preserves regular monos, then the category E_{Γ} is also co-Birkhoff.

The dual of Birkhoff’s (quasi-)variety theorem will state an equivalence between subcategories satisfying certain closure conditions and class of objects that are orthogonal to some collection of arrows. The closure conditions are easily found: they are the dual of the defining properties of (quasi-)varieties. Consequently, we say that a full subcategory is a quasi-covariety if it is closed under codomains of epimorphisms and coproducts and it is a covariety if it is also closed under regular subobjects.

An object X is orthogonal to a map f:\xymatrix{A \ar[r] & B} (written X ⊥ f — sometimes this condition is stated as, f is co-orthogonal to X) if, for each b:\xymatrix{X \ar[r] & B}, b factors through f. In particular, if f is an equalizer for e_{1}, e_{2} :\xymatrix{B \ar[r] & C}, then X ⊥ f iff every map \xymatrix{X \ar[r] & B} equalizes e_{1} and e_{2}. If S is a class of arrows and V is a full subcategory, we define the notations X ⊥ S, V ⊥ f and V ⊥ S, as before. The class of arrows V_{⊥} consists of all maps f such that V ⊥ f and the full subcategory S_{⊥} consists of all those objects X such that X ⊥ S. These operators form a Galois correspondence.

3.6.2. The abstract dual to Birkhoff’s theorem. We can now dualize the theorems of Section 3.2.5, providing quasi-covariety and covariety theorems for abstract co-Birkhoff categories. These theorems will then be interpreted in categories of coalgebras E_{Γ} for co—Birkhoff E and covarietor Γ that preserves regular monos, leading to a definition of coequation for such categories.

142 3. BIRKHOFF’S VARIETY THEOREM

Recall that 𝔾 = ⟨G, ε, δ⟩ is a comonad just in case G is an endofunctor and ε (the counit) and δ (the comultiplication) are natural transformations

ε:\xymatrix{G \ar[r] & 1_{C}} ,

δ:\xymatrix{G \ar[r] & GG},

respectively, satisfying ε_{G} ∘ δ = id_{G} = Gε ∘ ε and δ_{G} ∘ δ = Gδ ∘ δ.

The following theorem is the dual of Theorem 3.2.7.

Theorem 3.6.3. Let C be a quasi-co-Birkhoff category and V a full subcategory of C. The following are equivalent.

(1) V is a quasi-covariety.

(2) The inclusion U^{V} :\xymatrix{V \ar[r] & C} has a right adjoint H^{V} such that each component of the counit ε^{V} :\xymatrix{1_{C} \ar[r] & U^{V}H^{V}} is a regular mono.

(3) V = S_{⊥} for some collection S of regular monos.

Example 3.6.4. Top has no interesting quasi-covarieties. Let V be a quasicovariety of topological spaces and suppose that there is a non-empty space A in V. Then, since the space 1 is the codomain of an epi out of A, 1 ∈ V. Hence, so is every discrete space (as a coproduct of 1) and hence every topological space (since injects into the discrete space with the same underlying set).

Unfortunately, we don’t have any good examples of covarieties or quasi-covarieties outside of categories of coalgebras yet.

Corollary 3.6.5. Let C be a quasi-co-Birkhoff category and V a quasi-covariety of C. Then

(1) The inclusion U^{V} :\xymatrix{V \ar[r] & C} has a right adjoint H^{V}.

(2) The unit η^{V} :\xymatrix{1_{V} \ar[r] & H^{V}U^{V}} is an isomorphism.

(3) For each C ∈ C, we have C ∈ V iff C ⊥ ε_{C}^{V}, where ε^{V} is the counit of the adjunction U^{V} ⊣ H^{V}.

(4) The corresponding comonad, 𝔾^{V} = ⟨U^{V}H^{V}, ε^{V}, δ^{V}⟩, is idempotent.

(5) The comonad 𝔾^{V} preserves regular monos.

Thus, if V is a quasi-variety of C, we have an adjunction,

\xymatrix{V \ar[rr]^{U^{V}} & ⊥ & C \ar[ll]^{H^{V}}},

where U^{V} is full and faithful and every component of the counit

ε^{V} :\xymatrix{U^{V}H^{V} \ar[r] & 1}

is a regular mono, while every component of the unit

η^{V} :\xymatrix{1 \ar[r] & H^{V}U^{V}}

3.6. THE COALGEBRAIC DUAL OF BIRKHOFF’S VARIETY THEOREM 143

is an isomorphism ([Bor94, Proposition 3.4.1, Volume 1]). Also, we have that any object C ∈ C is in V iff C ⊥ ε_{C}^{V}, in which case ε_{C}^{V} is an isomorphism. From this, it follows that the comonad 𝔾^{V} is idempotent. In addition, the comonad 𝔾^{V} preserves regular monos, by the dual of Corollary 3.2.8, Item (5).

Theorem 3.6.3 provides a quasi-variety theorem which we will interpret in terms of conditional coequations in Section 3.6.4. The following theorem is the formal dual of the abstract Birkhoff theorem, Theorem 3.2.11. This is the theorem which, when interpreted in categories E_{Γ}, yields the co-Birkhoff theorem for categories of coalgebras.

Theorem 3.6.6. If C is a co-Birkhoff category, then V is a covariety iff V = S_{⊥} for some collection S of regular monos with regular injective codomains.

3.6.3. Covarieties of coalgebras. The formal dualities of Sections 3.6.1 and 3.6.2 provide the basic background for the co-Birkhoff theorem, but our work is not complete. In this section, we will show that categories of coalgebras over co-Birkhoff categories are again co-Birkhoff, and also provide a definition of coequation and coequation satisfaction to provide an interpretation of the co-Birkhoff theorem in E_{Γ}.

That categories E_{Γ} are co-Birkhoff follows, as before, by duality (of Theorem 3.3.1).

Theorem 3.6.7. Let E be co-Birkhoff and Γ:\xymatrix{E \ar[r] & E} be a covarietor (so that U has a right adjoint H) that preserves regular monos. Then E_{Γ} is co-Birkhoff.

It is worth noting that, if E and Γ satisfy the conditions of Theorem 3.6.7, then each coalgebra ⟨A, α⟩ is a regular sub-coalgebra of HA, which is injective if A is. We will use this fact in interpreting the covariety theorem.

In what follows, we assume that E is co-Birkhoff and Γ preserves regular monos. Under these assumptions, we notice that U preserves and reflects epis, regular monos and colimits (by the dual to Corollary 1.2.15), so that U preserves structure relevant to covarieties.

The regular subcoalgebras of HC play a role in the co-Birkhoff theorem that is analogous to the quotients of F X in Birkhoff’s variety theorem. This analogy suggests the following definition.

Definition 3.6.8. A coequation over C is a regular subobject of UHC. That is, a coequation K is a(n equivalence class of) regular monos

[figure: K; UHC] .

We take a coequation here to be a regular subobject. This is not the literal dual of sets of equations in E^{Γ}. There, the set of equations E is taken as a binary relation on UF X. So, to dualize a set of equations, one would consider corelations on UHC. Since these are less familiar objects, we prefer to consider the regular subcoalgebras

144 3. BIRKHOFF’S VARIETY THEOREM

themselves, which are dual to the quotients of F X by the pre-congruence generated by E. For a discussion of corelations over coalgebras, see [Kur00].

There is also a sense in which the variety theorem is “really” about quotients and orthogonality classes (rather than relations), and this motivates our definition of coequations. Sets of equations arise in the classical setting, but as we saw in Section 3.2.4, the variety theorem can be proved in terms of quotients in a wide variety of categories in which one may not have a natural notion of “equational satisfaction” (apart from orthogonality to a regular epi with regular projective domain, of course).

Some authors (notably, Peter Gumm in [Gum01a]) distinguish between single coequations and sets of coequations, a distinction which we do not introduce. In order for this distinction to arise, one states coequation satisfaction in terms of avoidance of certain behaviors. We prefer the more straightforward definition given below (which is equivalent for categories of coalgebras over Set), partly because it stresses the coequation-as-predicate view which we exploit later.

Each coequation [figure: K; UHC] gives rise to a canonical subcoalgebra, of course, via the [−]_{HC} operator of Section 2.2.2. By Corollary 2.2.9, we know that any homomorphism f:\xymatrix{⟨A, α⟩ \ar[r] & HC} factors through [K]_{HC} just in case Uf factors through K. This fact, together with our work on equation satisfaction previously, suggests the following definition.

Definition 3.6.9. Let [figure: K; HC] be a coequation over C and i:[figure: [K]; HC] the evident inclusion. We say that a coalgebra ⟨A, α⟩ forces K (written ⟨A, α⟩ ⊩_{C} K, with the subscript sometimes omitted) just in case ⟨A, α⟩ ⊥ i.

In other words, ⟨A, α⟩ ⊩_{C} K just in case, for every map p:\xymatrix{A \ar[r] & C}, the adjoint transpose of p factors through K. Intuitively, this means that, no matter how one “colors” the elements of A (with colors chosen from C), each element of A is behaviorally indistinguishable (in the sense of Γ-coalgebras) from an element of K of the same color.

Remark 3.6.10. In some ways, the forcing terminology here does not fit well with the definition, since coequation forcing is really derived from the usual notion of predicate satisfaction (not forcing). Nonetheless, we use the forcing terminology in order to keep the distinction between equation satisfaction (orthogonality to a quotient) and coequation satisfaction (co-orthogonality to a subobject) clear.

Example 3.6.11. Again, let ΓA = X × A and suppose x ∈ X. Let C = 2, so HC is (2 × X)^{ω}. Let

σ, τ:\xymatrix{ω \ar[r] & 2 × X}

3.6. THE COALGEBRAIC DUAL OF BIRKHOFF’S VARIETY THEOREM 145

be defined by

σ(n) = ⟨0, x⟩
τ(n) = ⟨1, x⟩

for all n ∈ ω, and let K = {σ, τ}, so K is a coequation over C.

Consider the coalgebras ⟨A, α⟩ and ⟨B, β⟩, where A = {a} and α(a) = ⟨x, a⟩ and B = {b, c} and

β(b) = ⟨x, c⟩
β(c) = ⟨x, b⟩

Then it is easy to see that ⟨A, α⟩ ⊩ K, while ⟨B, β⟩ ⊮ K. Moreover, one can show that ⟨C, γ⟩ ⊩ K just in case, for each c ∈ C, γ(c) = ⟨x, c⟩.

This example should support the view that coequational satisfaction says something about the internal structure of the coalgebra. Bisimilarity tells one about the behavior of a coalgebra — what sorts of output the structure maps can generate. In Section 3.9, we will see that coequation satisfaction is a finer way to distinguish between coalgebras than bisimilarity classes. Example 3.6.11 suggests that coequation satisfaction gives some ability to distinguish the internal composition of distinct coalgebras.

We now have a natural definition for coequational variety. A coequational variety is the class of all coalgebras which satisfy some collection of coequations. That is, V is a coequational covariety iff there is a collection S of regular monics with cofree codomains such that V = S_{⊥}. With the new terminology, the following theorem is an easy consequence of Theorem 3.6.7.

Theorem 3.6.12. Let E be co-Birkhoff and Γ:\xymatrix{E \ar[r] & E} preserve regular monos. Suppose also that U:\xymatrix{E_{Γ} \ar[r] & E} is comonadic (i.e., Γ is a covarietor) and let V be a full subcategory of E_{Γ}. Then V is a Birkhoff covariety iff V is a coequational covariety.

In Theorem 3.6.7, we showed that any covariety is the co-perp of some collection of regular monos with regular injective codomains. Here, we simply note that each object is a regular subobject of HC for some regular injective C. The dual of this was shown in the proof of Corollary 3.3.2.

Example 3.6.13. In [GS98], it is shown that the category Top^{open} of topological spaces and open maps is a covariety of Set_{F} (where F is the filter functor).

Example 3.6.14. Fix a set Z and let Γ:\xymatrix{Set \ar[r] & Set} be the functor

ΓA = Z × A,

146 3. BIRKHOFF’S VARIETY THEOREM

so that any Γ-coalgebra ⟨A, α⟩ can be viewed as a collection of streams over Z (see Example 1.1.7).

The cofree coalgebra Hℕ is the final ℕ×Z ×− coalgebra — i.e., Hℕ = (ℕ×Z)^{ω}. Given an element σ ∈ Hℕ, we can define

Col(σ) = {π_{1} ∘ σ(i) | i < ω}

(equivalently, Col(σ) = {ε_{ℕ} ∘ t^{i}(σ) | i < ω}, where t is the tail destructor). In other words, Col(σ) is the set of all colors that occur in the stream σ. Define a coequation φ over ℕ by

φ = {σ | card(Col(σ)) < ℵ_{0}},

(where card(X) is the cardinality of X) so σ ∈ φ just in case only finitely many colors occur in σ.

One can check that, for any Γ-coalgebra ⟨A, α⟩, we have ⟨A, α⟩ ⊩ φ just in case, for all a ∈ A, there is n ≥ 0, m > 0 such that

t^{n}(a) = t^{n+m}(a),

(where α = ⟨h, t⟩). In other words, ⟨A, α⟩ ⊩ φ iff each stream in A has only a finite number of “states”.

Example 3.6.15. Fix a set I and let Γ:\xymatrix{Set \ar[r] & Set} be the functor

ΓS = (P_{fin}S)^{I}.

In Example 1.1.11, we learned that Γ-coalgebras ⟨S, σ⟩may be regarded as nondeterministic automata, where the elements of S are the states of the automata. We say that, on input i ∈ I, there is a transition \xymatrix{s \ar[r]^{i} & s′} just in case s′ ∈ σ(s)(i).

The deterministic automata are those automata ⟨S, σ⟩ such that, for each s ∈ S and each i ∈ I, there is at most one s′ such that \xymatrix{s \ar[r]^{i} & s′}. Let Det denote the class of deterministic automata, so Det ⊆ Set_{Γ}. Then it is easy to see that Det is a covariety in Set_{Γ}.

In fact, one can show that there is a coequation K over 2 colors that defines Det. Namely, define K ⊆ UH2 by

K = {x ∈ UH2 | ∀i ∈ I ∀y, z ∈ δ(x)(i) . ε_{2}(y) = ε_{2}(z)},

where δ:[figure: UH2; ΓUH2] is the structure map for H2. Then, it is easy to show that

⟨A, α⟩ ⊩ K iff ⟨A, α⟩ ∈ Det .

Example 3.6.16. In this example, we will use an coalgebraic specification syntax for object oriented programming languages adopted from Bart Jacobs (see [Jac99, RTJ01], for instance). In Section 2.1.5, we discussed a simple specification in which we gave the signature of certain methods, thus determining a category Set_{Γ} of models of the class. In this specification, we extend the previous example to include such

3.6. THE COALGEBRAIC DUAL OF BIRKHOFF’S VARIETY THEOREM 147

assertions, thus restricting the coalgebras in which we are interested to a subclass of Set_{Γ}. In fact, these assertions determine a covariety of Set_{Γ} (and so, in fact, the models form a category of coalgebras for a comonad).

Typically, in coalgebraic specifications, one allows assertions about the “observable” behavior of methods, so that the class of coalgebras which serve as models for the specifications is closed under bisimulations. We extend the usual class of assertions to allow for equations between states of the coalgebras, in order to fully utilize the expressive power of coequations, ignoring the usual conceptual reason for restricting attention to observable behavior.

We consider the class DecCounter introduced in Section 2.1.5, although we view it as a basic class (rather than a class which inherits from Counter). We add to the previous specification two assertions, as shown here.

begin DecCounter

operations

inc:\xymatrix{X \ar[r] & X}
val:\xymatrix{X \ar[r] & ℕ}
dec:\xymatrix{X \ar[r] & X + 1}

assertions ∀x. val(inc(x)) = val(x) + 1

∀x. dec(inc(x)) ∼ x
∀x. dec(x) = ∗ iff val(x) = 0

end DecCounter

Here, ∼ indicates the bisimilarity relation. Thus, the class of models of DecCounter is intended to be the class of − × ℕ × (− + 1)-coalgebras ⟨A, α⟩such that, for every a ∈ A,

v_{α} ∘ i_{α}(a) = v_{α}(a) + 1,
d_{α} ∘ i_{α}(a) ∼ a,
d_{α}(a) = ∗ iff v_{α}(a) = 0

where α = ⟨i_{α}, v_{α}, d_{α}⟩. Note that d_{α} ∘i_{α}(a) ∼ a just in case !∘d_{α} ∘i_{α}(a) =!(a), where ! is the unique homomorphism from ⟨A, α⟩ to the final − × ℕ × (− + 1)-coalgebra.

It is easy to see that the class of models of DecCounter is a variety for a coequation K over 1 color (i.e., a subset of the final coalgebra, H1). In fact, this is a corollary to the discussion of behavioral covarieties in Section 3.9, but we explicitly give the coequation here. Indeed, let ⟨i_{σ}, v_{σ}, d_{σ}⟩:[figure: UH1; UH1 × N × (UH1 + 1)] be the structure map for the final coalgebra and define sets

K_{1} = {x ∈ UH1 | v_{σ} ∘ i_{σ}(x) = v_{σ}(x) + 1}
K_{2} = {x ∈ UH1 | d_{σ} ∘ i_{σ}(x) = x}
K_{3} = {x ∈ UH1 | d_{σ}(x) = ∗ iff v_{σ}(x) = 0}

148 3. BIRKHOFF’S VARIETY THEOREM

Let K = K_{1} ∩ K_{2} ∩ K_{3}. Let ⟨A, α⟩ be given, α = ⟨i_{α}, v_{α}, d_{α}⟩. Then, for any a ∈ A,

v_{α} ∘ i_{α}(a) == v_{σ} ∘ i_{σ}∘!(a) and
v_{α} = v_{σ}∘!(a) + 1,

so ⟨A, α⟩ ⊩ K_{1} just in case ⟨A, α⟩ satisfies the first assertion. Similarly, one checks that ⟨A, α⟩ forces K_{2}, K_{3} resp., just in case ⟨A, α⟩ satisfies the second, third resp., assertion.

If, on the other hand, we want the result of applying dec ∘ inc to return an object to the same state, rather than to a “merely” indistinguishable state^{3}, then we may replace the second assertion with the related assertion

∀x. dec(inc(x)) = x.

In this case, a coequation over one color does not suffice, again for reasons that we present in Section 3.9. However, there is a related coequation over two colors that defines the class of models for this specification. Namely, we define again three sets as follows:

K′_{1} = {x ∈ UH2 | v_{σ} ∘ i_{σ}(x) = v_{σ}(x) + 1}
K′_{2} = {x ∈ UH2 | ε_{2} ∘ d_{σ} ∘ i_{σ}(x) = ε_{2} ∘ x}
K′_{3} = {x ∈ UH2 | d_{σ}(x) = ∗ iff v_{σ}(x) = 0}

(We implicitly require that the equation in the definition of set K′_{2} is well-typed, so that d_{σ} ∘ i_{σ}(x) ∈ UH2.) We define K′ ⊆ UH2 to be the intersection of K′_{1}, K′_{2} and K′_{3}. We assert that ⟨A, α⟩ ⊩ K′ just in case K′ satisfies the requisite assertions. In particular, ⟨A, α⟩ ⊩ K′_{2} just in case, for every a ∈ A,

d_{α} ∘ i_{α}(a) = a. (18)

Indeed, suppose that, for every a, Equation (18) holds, and let p:\xymatrix{⟨A, α⟩ \ar[r] & H2} be given. Then, for every a ∈ A,

ε_{2} ∘ d_{σ} ∘ i_{σ} ∘ p(a) = ε_{2} ∘ p ∘ d_{α} ∘ i_{α}(a) = ε_{2} ∘ p(a),

and so p(a) ∈ K′_{2}.

On the other hand, suppose that there is an a ∈ A such that Equation (18) does not hold. If d_{α} ∘ i_{α}(a) = ∗, then it is easy to show that (for any p:\xymatrix{⟨A, α⟩ \ar[r] & H2}),

p(a) ∉ K′_{2},

and so ⟨A, α⟩ ⊮ K′. Suppose, then, that d_{α} ∘ i_{α}(a) ∈ A. We may define a coloring p̃:\xymatrix{A \ar[r] & 2} such that

p̃(d_{α} ∘ i_{α}(a)) ≠ p̃(a).

3Again, we do not justify this desire here, although one has the idea that the strengthened assertion regarding equality of states is related to assertions describing final methods.

3.6. THE COALGEBRAIC DUAL OF BIRKHOFF’S VARIETY THEOREM 149

Let p:\xymatrix{⟨A, α⟩ \ar[r] & H2} be the adjoint transpose of p̃. Then

ε_{2} ∘ d_{σ} ∘ i_{σ} ∘ p(a) = p̃(d_{α} ∘ i_{α}(a)) ≠ p̃(a) = ε_{2}(a),

and so again ⟨A, α⟩ ⊮ K′. Consequently, if ⟨A, α⟩ ⊩ K′, then every a ∈ A satisfies Equation (18).

3.6.4. Quasi-covarieties of coalgebras. We interpreted the covariety theorem in categories of coalgebras by introducing a notion of coequations. In this section, we revisit the quasi-covariety theorem (Theorem 3.6.3) and interpret it in terms of conditional coequations. Conditional coequations arise as an obvious generalization of coequations, by relaxing the condition that the codomain of the regular mono is cofree. We hope to motivate the use of the term “conditional” by showing that the natural forcing definition for these regular subobjects is equivalent to a conditional forcing of a “proper” coequation.

A similar presentation of conditional coequations (in terms of modal rules) can be found in [Kur00, Kur99]). The material of this section covers much of the same ground as Andréyka and Németi covered for the dual (algebraic) theorems in [Ném82, AN81a, AN81b, AN79b]. This material was developed independently prior to the author’s discovery of the related research.

A coequation over C is just a regular subobject of the cofree coalgebra UHC. More generally, we could consider regular subobjects of the carriers of arbitrary coalgebras. This suggests the following definition, although we postpone justifying the use of the term “conditional”.

Definition 3.6.17. A coequation!conditional – (over ⟨A, α⟩) is just a regular subobject

[figure: K; A]

of A = U⟨A, α⟩. We sometimes subscript a conditional coequation by α to indicate its codomain.

Recall that [K] is the largest subcoalgebra of ⟨A, α⟩ whose carrier is contained in K. We say that ⟨B, β⟩ ⊩_{α} K just in case ⟨B, β⟩ ⊥ i, where

i:[figure: [K]; ⟨A, α⟩]

is the inclusion.

Hence, a coequation K over C is just the same as a conditional coequation over HC, and so the conditions ⟨B, β⟩ ⊩_{C} K and ⟨B, β⟩ ⊩_{HC} K are really just the same statement. Nonetheless, we hope no confusion arises from the notational differences between coequations and conditional coequations.

In terms of conditional coequations, Theorem 3.6.3 yields the following theorem.

150 3. BIRKHOFF’S VARIETY THEOREM

Theorem 3.6.18. Let E be quasi-co-Birkhoff and Γ preserve regular monos. Then, for any class V of Γ-coalgebras, V is a quasi-covariety iff there is a collection S of conditional coequations such that

⟨B, β⟩ ∈ V iff ∀K_{α} ∈ S . ⟨B, β⟩ ⊩_{α} K

Example 3.6.19. Let 𝔾 = ⟨G, ε, δ⟩ be a comonad over E, and assume that G preserves regular monos. Then, the category E_{𝔾} of coalgebras for the comonad is a variety in the category E_{G} of coalgebras for the endofunctor. Indeed, it is easy to check that E_{𝔾} is closed under epis, regular subcoalgebras and coproducts.

If G is not a covarietor^{4}, then Theorem 3.6.12 does not apply — so, we cannot guarantee a collection of coequations defining E_{𝔾}. However, we may apply Theorem 3.6.18 in this case, to conclude that there is a collection S of conditional coequations defining the covariety E_{𝔾}.

Indeed, it is not hard to explicitly give a collection S which suffices. For each ⟨A, α⟩ ∈ E_{G}, let Φ_{α} be the equalizer shown below.

[figure: Φ_{α}; A; ε_{A}∘α; _{id_{A}}; A]

That is, Φ_{α} is just the equalizer of the counit diagram from Definition 2.1.2. Similarly, let Ψ_{α} be the equalizer of the co-distributivity diagram, shown below.

[figure: Ψ_{α}; A; δ_{A}∘α; Gα∘α; G^{2}A]

Let S be the collection (abusing set notation)

{Φ_{α} ∧ Ψ_{α} | ⟨A, α⟩ ∈ E_{G}}.

Then it is easy to show that, for any ⟨B, β⟩ ∈ E_{G},

⟨B, β⟩ ∈ E_{𝔾} iff ⟨B, β⟩ ⊩ S.

In the remainder of this section, we will focus on a special class of quasi-covarieties: those that are defined by a single conditional coequation. Our purpose is to show that the so-called conditional coequations really do reflect a notion of conditional forcing. Namely, given a conditional coequation i:[figure: K; U⟨A, α⟩], we may view A as a coequation as well — namely a coequation over the object A of colors (or, if A is not projective, then a coequation over some projective of which A is a regular subobject).

U:\xymatrix{E_{G} \ar[r] & E}

U:\xymatrix{E_{𝔾} \ar[r] & E}

4Note: The fact that G is the functor part of a comonad does not seem sufficient to infer that has a right adjoint — although the related forgetful functor certainly does have a right adjoint.

3.6. THE COALGEBRAIC DUAL OF BIRKHOFF’S VARIETY THEOREM 151

We will show that a coalgebra ⟨B, β⟩forces K just in case ⟨B, β⟩ ⊩ A ⇒ K (although we still owe a definition of this latter condition).

Given a pair of coequations K, L over a common object of colors, C, we call K ⇒ L an ⇒-coequation. We say that a coalgebra ⟨A, α⟩ forces K ⇒ L (written ⟨A, α⟩ ⊩_{C} K ⇒ L) just in case, for every homomorphism p:\xymatrix{⟨A, α⟩ \ar[r] & HC}, if Up factors through K, then Up factors through L. In other words, ⟨A, α⟩ ⊩_{C} K ⇒ L if, whenever p:\xymatrix{⟨A, α⟩ \ar[r] & HC} and Im p ≤ [K], then Im p ≤ [L].

Remark 3.6.20. The condition that

⟨A, α⟩ ⊩ K ⇒ L

is not the same as

⟨A, α⟩ ⊩ K → L

, where K → L is defined in terms of the Heyting algebra structure of RegSub(UHC). In fact, one can show that, for any K, L, ⟨A, α⟩, if ⟨A, α⟩ ⊩ K → L, then ⟨A, α⟩ ⊩ K ⇒ L, but the converse does not hold.

For example, let ΓX = X × X. Let

⟨ε_{2}, l, r⟩:[figure: UH2; 2 × UH2 × UH2]

be the structure map for H2. Define coequations K, L over 2 by

K = {σ ∈ UH2 | σ = l(σ)}
L = {σ ∈ UH2 | σ = r(σ)}

Let A = \{a, b\} and α = ⟨l_{α}, r_{α}⟩:\xymatrix{A \ar[r] & A × A} be defined by

α(a) = ⟨b, b⟩,
α(b) = ⟨b, a⟩.

We will first show that ⟨A, α⟩ ⊩ K ⇒ L. Let

p:\xymatrix{A \ar[r] & 2}

be given such that Im p̃ ≤ K, where p̃ is the adjoint transpose of p. Then, since p̃(a) ∈ K, it follows that p̃(a) = p̃(b). Hence, Im p̃ ≤ L.

However, it is not the case that ⟨A, α⟩ ⊩ K → L. Let p(a) = 0 and p(b) = 1. Then, p(b) ∈ K but p(b) ∉ L. Hence,

Im p̃∧ K ≰ L

and so Im p̃ ≰ K → L.

We wish to show that conditional coequations (in the sense of Definition 3.6.17) coincide with ⇒-coequations. More precisely, given any conditional coequation M

152 3. BIRKHOFF’S VARIETY THEOREM

over ⟨A, α⟩, there is an ⇒-coequation K → L over C, for an appropriate projective object C, such that

⟨B, β⟩ ⊩_{α} M iff ⟨B, β⟩ ⊩_{C} K ⇒ L.

Also, given any ⇒-coequation K ⇒ L, there is an ⟨A, α⟩ and M ≤ A such that the same equivalence holds. This fact motivates the terminology “conditional coequation”, since each conditional coequation can be expressed as a coequation of the form K ⇒ L.

Theorem 3.6.21. Let E be a Birkhoff category, Γ a varietor the preserves regular monos. Let ⟨A, α⟩ ∈ E_{Γ} and C an injective object such that A ≤ C. Then, for any conditional coequation M over ⟨A, α⟩, there is an ⇒-coequation K ⇒ L over C such that

⟨B, β⟩ ⊩_{α} M iff ⟨B, β⟩ ⊩_{C} K ⇒ L. (19)

Conversely, if E has binary intersections, for any ⇒-coequation K ⇒ L over C, there is a ⟨A, α⟩, with A ≤ C and a conditional coequation M over ⟨A, α⟩ such that (19) holds.

Proof. Let m:[figure: M; A], where A = U⟨A, α⟩ and C injective with i:[figure: A; C]. We claim that ⟨B, β⟩ ⊩_{α} M just in case ⟨B, β⟩ ⊩_{C} A ⇒ M.

Indeed, suppose that ⟨B, β⟩ ⊩ M, so that every homomorphism \xymatrix{⟨B, β⟩ \ar[r] & ⟨A, α⟩} factors through M. Let f:\xymatrix{⟨B, β⟩ \ar[r] & HC} be given and suppose that f factors through A (as in Figure 9), f = i ∘ g for some g:\xymatrix{B \ar[r] & A}. Then, by Corollary 1.2.10, g is also a homomorphism and so g factors through m. Hence, ⟨B, β⟩ ⊩ A ⇒ M.

[figure: UHC; B; f; g; k; A; i; M; m]

Figure 9. ⟨B, β⟩ ⊩_{α} M iff ⟨B, β⟩ ⊩_{C} A ⇒ M

Conversely, suppose that ⟨B, β⟩ ⊩ A ⇒ M and let g:\xymatrix{⟨B, β⟩ \ar[r] & ⟨A, α⟩} be given. Then i ∘ g factors through A and hence factors through M, i ∘ g = i ∘ m ∘ k. Since i is monic, we see that g factors through M.

On the other hand, let K, L ≤ UHC. Let [K]_{HC} = ⟨A, α⟩ (so ⟨A, α⟩ is the largest subcoalgebra of HC contained in K). We claim that ⟨B, β⟩ ⊩_{α} L ∩ A just in case ⟨B, β⟩ ⊩_{C} K ⇒ L.

3.7. UNIFORMLY CO-BIRKHOFF CATEGORIES 153

Suppose that ⟨B, β⟩ ⊩_{α} L ∩ A. Let f:\xymatrix{⟨B, β⟩ \ar[r] & HC} be given and suppose that Im Uf ≤ K. Then, by Corollary 2.2.9, Im f ≤ [K] = ⟨A, α⟩ and so Im Uf ≤ L ∩ A ≤ L. Hence, ⟨B, β⟩ ⊩_{C} K ⇒ L.

Suppose now that ⟨B, β⟩ ⊩_{C} K ⇒ L, and let g:\xymatrix{⟨B, β⟩ \ar[r] & ⟨A, α⟩} be given. Since A ≤ K, the map g factors through L and hence through A ∩ L. Thus,

⟨B, β⟩ ⊩_{α} A ∩ L.
□

3.7. Uniformly co-Birkhoff categories

In Section 3.4, we considered those categories in which every variety V is of the form V = \{p:\xymatrix{A \ar@{|->}[r] & •}\}_{⊥} for some regular epi p, regular projective A. In the case of categories of algebras, we could take A to be free over some projective object X “of variables”. Thus, if E^{Γ} is uniformly Birkhoff, then there is some X such that every variety is definable by a set of equations over X. In the classical setting of Set^{ℙ}, where ℙ is a polynomial functor, we could take X to be any infinite set, in accordance with the 1935 Birkhoff variety theorem.

We wish to consider the analogous conditions for categories of coalgebras and their covarieties. Namely, what conditions suffice to conclude that there is an regular injective C such that every covariety V of E_{Γ} is definable by a coequation over C? In more detail, we want conditions that ensure that, for every V, there is a [figure: K; UHC] such that

V = {⟨A, α⟩ ∈ E_{Γ} | ⟨A, α⟩ ⊩_{C} K}.

As we shall see in Section 3.8, K can always be taken to be the carrier of a subcoalgebra. Thus, the question is when V = {i:[figure: •; HC] }_{⊥} for some regular mono Γ-homomorphism i.

Definition 3.7.1. A co-Birkhoff category C is uniformly co-Birkhoff just in case there is an regular injective C ∈ C such that, for every variety V, there is a regular mono i:[figure: K; C] such that V = {i}_{⊥}. In this case, we call C a coequational codomain.

3.7.1. Conjunctly irreducible coalgebras and conjunct sums. Here, we prove an analogue to Birkhoff’s subdirect representation theorem ([Bir44]). The socalled conjunct representation theorem was first proved by Gumm and Schröder for categories of coalgebras over Set (see [Gum01b, Gum98, Gum99]). We generalize their work here. We begin by stating the relevant definitions for the classical theorem as well as the theorem itself, which we take from [Grä68]. For the classical theorem, we work in Set^{ℙ} for a polynomial functor ℙ.

154 3. BIRKHOFF’S VARIETY THEOREM

Call an algebra ⟨A, α⟩subdirectly irreducible just in case, whenever {Θ_{i}}_{i∈I} is a family of congruences on ⟨A, α⟩with ⋀ Θ_{i} = Δ_{α}, the diagonal on ⟨A, α⟩, then one of the Θ_{i} equals Δ_{α}.

Theorem 3.7.2 (Subdirect representation). For any ⟨A, α⟩ in Set^{ℙ}, there is a family {⟨A_{i}, α_{i}⟩}_{i∈I} such that each ⟨A_{i}, α_{i}⟩ is a quotient of ⟨A, α⟩ and

⟨A, α⟩ ≤ ∏⟨A_{i}, α_{i}⟩.

The material that follows is a good example of the limitations of formal dualities. The proof of the conjunct representability theorem given here does not follow from a simple dualization of the proof of the subdirect representability theorem. The classical theorem relies on finding, for each a ≠ b in an algebra ⟨A, α⟩, a congruence R_{a,b} such that ¬R_{a,b}(a, b) and taking the product of the A/R_{a,b} for pairs of distinct a, b. This approach does not easily dualize to yield the coalgebraic theorem, and so a different approach is used. Nonetheless, an analogous result is obtained — the conclusion of the theorem is dual to the subdirect representation theorem, but the assumptions required and the methods used are not dual.

Throughout this section, we assume that E has epi-regular mono factorizations, finite limits and all coproducts and that Γ preserves regular monos.

The following definition is dual to subdirect products in the classical theorem.

Definition 3.7.3. Let A ∈ C. A conjunct covering of A is a collection of regular monos

{ [figure: C_{i}; c_{i}; A] | i ∈ I}

such that the map

\xymatrix{∐_{i∈I} C_{i} \ar[r]^{[c_{i}]_{i∈I}} & A}

is a regular epi.

The requirement that \xymatrix{∐ C_{i} \ar[r] & A} is a regular epi, instead of just epi, is necessary only so that conjunct covers are stable under pullbacks. In what follows, we may replace regular epis with epis if we also require that all epis are stable under pullback, rather than just requiring that C is a regular category.

Next, we dualize the notions of subdirect irreducibility and representability.

Definition 3.7.4. We say that an object A ∈ C is conjunctly irreducible iff, whenever we have a non-empty conjunct covering of A,

\xymatrix{∐_{i∈I} C_{i} \ar@{|->}[r]^{[c_{i}]_{i∈I}} & A} ,

then one of the c_{i}’s is an epi (and hence an isomorphism).

3.7. UNIFORMLY CO-BIRKHOFF CATEGORIES 155

Definition 3.7.5. We say that a conjunct covering

{c_{i}:[figure: C_{i}; A]}_{i∈I}

of A is a conjunct representation of A if each C_{i} is conjunctly irreducible. We say that C is conjunctly presentable if each object A ∈ C has a conjunct representation.

An object A is, by definition, conjunctly irreducible just in case, for every family {C_{i}}_{i∈I} of regular subobjects of A, if ∐ C_{i} covers A, then one of the C_{i} covers A. The following theorem shows that whenever A is conjunctly irreducible, then, for any family \{C_{i}\}_{i∈I} which covers A, one of the \xymatrix{C_{i} \ar[r] & A} is epi.

Theorem 3.7.6. Let C be a category with epi-regular mono factorizations. An object A ∈ C is conjunctly irreducible iff for every collection of maps (not necessarily monic)

\{ \xymatrix{C_{i} \ar[r]^{c_{i}} & A} | i ∈ I\}

such that the induced map

\xymatrix{∐_{i∈I} C_{i} \ar[r]^{[c_{i}]_{i∈I}} & A}

is a regular epi, there is some i ∈ I such that c_{i} is epi.

Proof. Suppose that A is conjunctly irreducible. For each i, take the epi-regular mono factorization, as shown below.

[figure: C_{i}; c_{i}; p_{i}; A; D_{i}; d_{i}]

Then, it is easy to see that the d_{i}’s form a regular cover of A, and so there is some i such that d_{i} is an epi. Hence, c_{i} is also an epi. □

For the remainder of this section, we will be interested in categories in which coproducts commute with pullback, a generalization of distributive categories. Such categories are called extensive. We present the definition here and state without proof a theorem (found as Theorem 5.5.8 in [Tay99]) giving an equivalent definition of extensive. See also [Coc93] for a discussion of extensive categories, a subject we return to in Section 4.1, where we show that E_{Γ} is extensive, given that E is extensive and Γ preserves regular monos and pullbacks along regular monos.

Definition 3.7.7. A category with finite coproducts is extensive if, in the diagram in Figure 10, the squares are pullbacks just in case the top row is a coproduct diagram.

Any extensive category with finite limits is distributive.

\xymatrix{X \ar[d] \ar[r] & Z \ar[d] & Y \ar[l] \ar[d] \\ A \ar[r]_{κ_{A}} & A + B & B \ar[l]^{κ_{B}}}

Figure 10. In an extensive category, the squares are pullbacks iff Z = X + Y.

Theorem 3.7.8. Let C have all pullbacks. C is extensive just in case • C has a strict initial object, i.e., any map \xymatrix{• \ar[r] & 0} is an isomorphism;

• coproducts are disjoint, i.e., the diagram below is always a pullback;

[figure: 0; A; B; A + B]

• coproducts are stable under pullback, i.e., if the squares in Figure 10 are pullbacks, then Z ≅ X + Y.

In particular, then, every topos is extensive.

We use the property that coproducts commute with pullbacks to ensure that the pullback of a conjunct covering is again a conjunct covering. This, in turn, will ensure that a coalgebra is conjunctly irreducible just in case it is generated by a conjunctly irreducible subobject.

Theorem 3.7.9. Assume C is a regular, extensive category. Let f:\xymatrix{A \ar[r] & B} be given and let

{ [figure: C_{i}; c_{i}; B] | i ∈ I}

be a conjunct covering of B. Then pulling each C_{i} back along f yields a conjunct covering of A. In other words, pullbacks preserve conjunct coverings.

Proof. For each i, take the pullback

[figure: D_{i}; d_{i}; A; f; C_{i}; c_{i}; B] (20)

Pullbacks preserve regular monos, so all that remains is to show that the map from the coproduct of the D_{i}’s is also a regular epi. But, since pullbacks commute with coproducts, the following square is a pullback.

[figure: ∐_{i} D_{i}; [d_{i}]; A; f; ∐_{i} C_{i}; [c_{i}]; B]

By regularity, the top arrow is a regular epi. □

Theorem 3.7.10. Let C be regular and extensive. Let A be conjunctly irreducible and suppose f:\xymatrix{A \ar@{->>}[r] & B} is an epi. Then B is conjunctly irreducible.

Proof. Let

{ [figure: C_{i}; c_{i}; B] | i ∈ I}

be a regular covering of B and take the pullbacks as in the proof of Theorem 3.7.9. Since A is conjunctly irreducible, there is an i such that D_{i} ≅ A. Because of the commutativity of the pullback square (20), c_{i} is an epi and hence is an isomorphism.

□

Definition 3.7.11. Let ⟨A, α⟩ be a Γ-coalgebra and S a regular subobject of A. We say that S generates ⟨A, α⟩ if no proper regular subcoalgebra of ⟨A, α⟩ contains S.

Recall that in Section 2.3, we showed that whenever Γ preserves non-empty intersections, the subcoalgebra forgetful functor U_{α}:\xymatrix{SubCoalg ⟨A, α⟩ \ar[r] & RegSub A} has a left adjoint, ⟨⟩_{α}:\xymatrix{RegSub(A) \ar[r] & SubCoalg ⟨A, α⟩}. In this case, it is easy to see that S generates ⟨A, α⟩ just in case ⟨S⟩_{α} = ⟨A, α⟩.

Theorem 3.7.12. Let E be a regular, extensive category. Suppose further that E is conjunctly presentable. Let ⟨A, α⟩ be a Γ-coalgebra. Then ⟨A, α⟩ is conjunctly irreducible (in E_{Γ}) iff there is some regular subobject S of A such that S is conjunctly irreducible (in E) and S generates ⟨A, α⟩.

Proof. Suppose that there is some conjunctly irreducible S which generates ⟨A, α⟩ and let

{ [figure: ⟨C_{i}, γ_{i}⟩; c_{i}; ⟨A, α⟩] | i ∈ I}

be a conjunct covering of ⟨A, α⟩. Then

{ [figure: C_{i}; c_{i}; A] | i ∈ I}

is a conjunct covering of A in E (since U preserves regular monos and regular epis). Consequently, when we pull it back to S, as shown below, we have a conjunct covering of S.

[figure: ∐_{i} C′_{i}; S; ∐_{i} C_{i}; A]

Hence, for some i, C′_{i} is isomorphic to S, and so we have S ≤ C_{i} and so, since S generates ⟨A, α⟩, ⟨A, α⟩ ≅ ⟨C_{i}, γ_{i}⟩.

For the converse, assume that, for every conjunctly irreducible C in A, there is a proper regular subcoalgebra ⟨D, δ⟩ containing C. Pick a conjunct representation of A,

{ [figure: C_{i}; c_{i}; A] | i ∈ I}.

For each C_{i}, pick a proper regular subcoalgebra ⟨D_{i}, δ_{i}⟩ of ⟨A, α⟩ that contains C_{i}. Then the ⟨D_{i}, δ_{i}⟩’s form a conjunct cover of ⟨A, α⟩ and none of the ⟨D_{i}, δ_{i}⟩’s are isomorphic to ⟨A, α⟩. Consequently, ⟨A, α⟩ is not conjunctly irreducible. □

Hence, if Γ preserves non-empty intersections, so that we have ⟨⟩ ⊣ U, the category E_{Γ} is conjunctly presentable if E is. This is because every coalgebra ⟨A, α⟩can be conjunctly covered by ⟨C_{i}⟩, where {C_{i}}_{i∈I} is a conjunct representation of A.

Theorem 3.7.13. Let E be regular, extensive and conjunctly presentable and let Γ preserve non-empty intersections. Then E_{Γ} is conjunctly presentable.

Proof. Let ⟨A, α⟩ be a Γ-coalgebra and let

{c_{i}:[figure: C_{i}; A]}

be a conjunct representation of A (in E). Then, by Theorem 3.7.12, each ⟨C_{i}⟩_{α} is conjunctly irreducible. Because the diagram below commutes (in E), and because U creates colimits, the ⟨C_{i}⟩’s form a conjunct representation of ⟨A, α⟩.

[figure: ∐ U⟨C_{i}⟩; A; _{∐ C_{i}}]

□

In the remainder of this section, we give sufficient conditions to ensure that the base category E is conjunctly presentable. As a corollary to this, Set is a conjunctly presentable, but that fact is easy enough that one would prove it directly. We offer this discussion to indicate that other categories are also presentable — although the assumption we use (that E is well-pointed) is a strong assumption. In a sense, we show here that sufficiently “Set-like” categories are conjunctly presentable.

3.7. UNIFORMLY CO-BIRKHOFF CATEGORIES 159

Definition 3.7.14. Let C be a cocomplete category. A set {U_{i}}_{i∈I} of objects of C is a (regular, resp.) generating family if, for every C ∈ C, there is a J ⊂ I such that there is (regular, resp.) epi

\xymatrix{∐_{i∈J} U_{i} \ar@{->>}[r] & C}.

It is immediate that, if E has a regular generating family of conjunctly irreducible objects, then E is conjunctly presentable. It is almost as obvious that, if E has a regular generating family in which each object is conjunctly presentable, then E is conjunctly presentable, as the following theorem shows.

Theorem 3.7.15. Let E have a set {U_{i}}_{i∈I} of regular generators and assume that each U_{i} has a conjunct representation. Then E is conjunctly presentable.

Proof. Let S_{i} be the set of conjunctly irreducible objects in the conjunct representation of U_{i}. Then ⋃_{i∈I} S_{i} is a regular generating family of conjunctly irreducible objects. □

The following definition is stated in terms of toposes with all colimits just for consistency with the definition of generating families above. Both definitions are more general than we have stated here, but we are at present interested only in generating families in cocomplete categories, as it is in these categories that the concept is closely related to conjunct coverings.

Definition 3.7.16. A topos E with all colimits (equivalently, limits) is wellpointed if 0 ≠ 1 and 1 is a (regular) generator for E (i.e., {1} is a generating family).

See any good topos theory book for a discussion of well-pointed toposes, including [LM92, BW85] or [Bor94, Volume III]. In what follows, we use the fact that, in a topos, every epi is regular.

Claim 3.7.17. In a well-pointed topos, any A ≠ 0 has a global point.

Proof. If A ≠ 0, then the classifying maps for 0 ≤ A and A ≤ A are distinct. Hence, there must be a map \xymatrix{1 \ar[r] & A} which distinguishes them. □

Theorem 3.7.18. Let E be a well-pointed topos with all colimits and suppose that E is regular. Then E is conjunctly presentable.

Proof. We first show that 1 is conjunctly irreducible. Let

{c_{i}:[figure: C_{i}; 1]}

be a conjunct covering. Then ∐ C_{i} ≠ 0 and so, for some i, C_{i} ≠ 0. Hence, C_{i} has a global point x. Since the composite

[figure: 1; x; C; c_{i}; 1]

is the identity, c_{i} is an isomorphism.

Since every object is covered by a coproduct of 1’s, the result follows. □

As a final aside, we point out that in a well-pointed topos with all colimits, the only conjunctly irreducible objects are 0 and 1.

Corollary 3.7.19. An object C in a well-pointed topos with all colimits is conjunctly irreducible iff C ≅ 1 or C ≅ 0.

Proof. Clearly, 0 and 1 are irreducible. Let C be given, and suppose C is conjunctly irreducible. Suppose also that C is not initial. Then C can be written as a non-empty coproduct of 1’s. Hence, since C is assumed irreducible, C must be isomorphic to 1. □

3.7.2. Bounded functors. Throughout this section, we assume that E is co-Birkhoff and that Γ is a covarietor that preserves regular monos. We use some of the terminology of the preceding section in order to define the relevant terms here — in particular, in order to define bounded functor. It should be noted that Jiri Adámek recently showed that bounded Set functors are just the accessible functors ([AP01]), although we do not exploit this discovery in what follows.

Definition 3.7.20. Let E be conjunctly presentable and let Γ:\xymatrix{E \ar[r] & E}. We say that Γ is a bounded by C ∈ E just in case for each Γ-coalgebra ⟨A, α⟩, there is a conjunct representation

{c_{i}:[figure: C_{i}; A]}_{i∈I}

of A such that, for each i, there is a regular subcoalgebra

⟨D_{i}, δ_{i}⟩ ≤ ⟨A, α⟩

such that C_{i} ≤ D_{i} ≤ C.

The lemma below is the dual of Lemma 3.4.12.

Lemma 3.7.21. Let V be a covariety in the co-Birkhoff category C and let A be a regular subobject of B. Then

{ε_{B}^{V}}_{⊥} ⊆ {ε_{A}^{V}}_{⊥}.

Proof. Let C ⊥ ε_{B}^{V} and let f:\xymatrix{C \ar[r] & A} be given. Let

[figure: A; B; E]

be an equalizer diagram. Because G^{V} preserves equalizer diagrams (the dual of Corollary 3.2.14), the bottom row in Figure 11 is an equalizer. The vertical arrows are counits for the comonad ⟨G^{V}, ε^{V}, δ^{V}⟩. Because C ⊥ ε_{B}^{V}, we have a map \xymatrix{C \ar[r] & G^{V}B},

[figure: C; f; A; B; E; G^{V}A; G^{V}B; G^{V}E]

Figure 11. If A ≤ B then {ε_{B}^{V}}_{⊥} ⊆ {ε_{A}^{V}}_{⊥}.

as shown. By naturality, the diagram

[figure: C; G^{V}B; G^{V}E]

commutes, yielding the factorization of f through G^{V}A, as shown. □

The next theorem is another example of a “dual” theorem which is not proved “by duality”. The algebraic analogue to Theorem 3.7.22 is Theorem 3.4.15, in which we showed that, if E is Birkhoff with enough retractably presentable regular projectives and a regular projective X satisfying certain properties and Γ preserves filtered colimits and regular epis, then E^{Γ} is uniformly Birkhoff. These assumptions do not dualize in a reasonable way (since the dual of the conditions on X, say, involves dualizing finitely presentable objects, and the result of that is unfamiliar and apparently uncommon). Hence, we offer a separate proof of the uniformly co-Birkhoff theorem here, one which is apparently simpler than the algebraic version, but again does not dualize in an obvious way.

The reader should note that in the following theorem, we do not suppose that E is uniformly co-Birkhoff. Again, this is a different approach to reach a result analogous to that of Theorem 3.4.15.

Theorem 3.7.22. Let E be conjunctly presentable. If Γ:\xymatrix{E \ar[r] & E} is bounded by C, then E_{Γ} is uniformly co-Birkhoff.

Proof. Let D be a regular injective object of E such that C ≤ D (E has enough regular injectives). Clearly Γ is bounded by D. We already know V ⊆ {ε_{HD}^{V}}_{⊥}. We will prove the other inclusion, in order to conclude that HD is a coequational codomain.

Let ⟨A, α⟩ ⊥ ε_{HD}^{V} and let

{c_{i}:[figure: C_{i}; A]}

be a conjunct representation of A. For each i, choose a regular subcoalgebra ⟨D_{i}, δ_{i}⟩ of A such that C_{i} ≤ D_{i} ≤ D. Because {ε_{HD}^{V}}_{⊥} is closed under regular subobjects, we see that ⟨D_{i}, δ_{i}⟩ ⊥ ε_{HD}^{V} for each ⟨D_{i}, δ_{i}⟩.

162 3. BIRKHOFF’S VARIETY THEOREM

Each Uη_{δ_{i}} is a regular mono (since ε_{U} ∘ Uη = 1), and U reflects regular monos. Hence, since U and H also preserve regular monos, we see that

⟨D_{i}, δ_{i}⟩ ≤ HD_{i} ≤ HD.

We apply Lemma 3.7.21 to conclude that each ⟨D_{i}, δ_{i}⟩ ⊥ ε_{δ_{i}}^{V}. Hence, each ⟨D_{i}, δ_{i}⟩ ∈ V (Corollary 3.6.5), and so ∐ ⟨D_{i}, δ_{i}⟩ ∈ V. Because U creates coproducts and reflects epis,

\xymatrix{∐ ⟨D_{i}, δ_{i}⟩ \ar@{->>}[r] & ⟨A, α⟩}

is an epi, and so ⟨A, α⟩ ∈ V. □

3.8. Invariant coequations

In Section 3.5, we presented Birkhoff’s deductive completeness theorem in terms of closure operators on sets of equations, that is, subsets of UF X × UF X. In this section, we present the dual theorem, which we call the invariance theorem. As we will see, the dual of deductive closure leads to two S4 necessity operators for coequations. The first operator is just the subcoalgebra operator □ from Section 2.2.2. The second operator, ⊠, was first introduced in [Hug01], in which this material is also covered. It takes a coequation to the largest endomorphism-invariant sub-coequation.

Throughout this section, we assume that E is a co-Birkhoff category and Γ is a regular-mono-preserving covarietor, so that the coalgebraic covariety theorem applies.

The deductive completeness theorem says that a set E of equations is the equational theory for some class V of algebras just in case E is deductively closed. Previously, we introduced a closure operator

Id_{X}:\xymatrix{Sub(E^{Γ}) \ar[r] & Rel(UF X, UF X)},

taking a class V to the largest set of equations over X which V satisfies. This operator forms a Galois correspondence with the operator

Sat_{X}:\xymatrix{Rel(UF X, UF X) \ar[r] & Sub(E^{Γ})},

taking a set of equations to the variety it defines. Dually, we may define operators, for each injective C,

CoId_{C}:\xymatrix{Sub(E_{Γ}) \ar[r] & RegSub(UHC)},
Frc_{C}:\xymatrix{RegSub(UHC) \ar[r] & Sub(E_{Γ})},

in the obvious way. Namely, if V is a class of coalgebras, and K ≤ UHC, then (abusing set notation in the second definition)

CoId(V) = ⋀{L ≤ UHC | V ⊩ L},
Frc(K) = {⟨A, α⟩ | ⟨A, α⟩ ⊩ K}.

Again, of course, we have a pair of adjoint functors, CoId ⊣ Frc. Note, however, that both of these functors are covariant. That is,

CoId(V) ≤ K iff V ≤ Frc(K).

In ibid, the coequation CoId(V) is called a generating coequation , since it gives a measure of the “coequational commitment” of the class V. In particular, whenever V ⊩ K, then CoId(V) ≤ K.

Our goal, then, is to find conditions on K ≤ UHC such that K = CoId(V) for some class V of coalgebras. As before, the conditions should be “syntactic” terms, without reference to the coalgebras which force K. We begin by introducing the notion of endomorphism-invariance.

The notion of an endomorphism-invariant coequation arises as the dual to a stable set of equations, that is, a set of equations closed under substitutions of terms for variables. More accurately, endomorphism-invariant coequations are dual to stable quotients, and the invariance operator plays the role of closure under substitution.

Definition 3.8.1. A coequation K over C is endomorphism-invariant just in case, for every homomorphism

p:\xymatrix{HC \ar[r] & HC} ,

the image of K under p is contained in K, i.e.,

∃_{p}K ≤ K.

Sometimes, we write endo-invariant, or possibly just invariant, for endomorphisminvariant. However, the reader should be aware that other authors say that a subobject K of U⟨A, α⟩ is invariant (or “α-invariant”) just in case K is the carrier of a subcoalgebra of ⟨A, α⟩. Indeed, we use a similar terminology (“α, β-invariant”) in the proof of Theorem 2.5.25. This is a different concept than endomorphism-invariant.

An endomorphism \xymatrix{HC \ar[r] & HC} is equivalent to a “re-painting” of the elements of UHC, again drawing colors from C. A coequation K is endo-invariant if, under every such re-painting, the elements of K are behaviorally (including color) indistinguishable from elements that were already in K before the re-painting.

Remark 3.8.2. The definitions of endomorphism-invariant, CoId and Frc could be stated for arbitrary coalgebras, rather than just cofree coalgebras. We ignore the generality here in favor of focusing on the problem at hand, but see [Hug01].

Remark 3.8.3. Coequations over 1 are always endomorphism invariant, and so ⊠_{1} is just the identity.

164 3. BIRKHOFF’S VARIETY THEOREM

Let Inv(C) denote the full subcategory of RegSub(UHC) consisting of the invariant coequations over C and let

I_{C}:\xymatrix{Inv(C) \ar[r] & RegSub(UHC)}

be the inclusion functor.

Theorem 3.8.4. I_{C} has a right adjoint.

Proof. Let K ≤ UHC and define

𝔓_{K} = \{L ≤ UHC | ∀p:\xymatrix{HC \ar[r] & HC} (∃_{p}L ≤ K)\}.

We define a functor J_{C}:\xymatrix{RegSub(UHC) \ar[r] & RegSub(UHC)} by

J_{C}(K) = ⋁_{L∈𝔓_{K}} L,

omitting the subscripts on I and J when convenient.

We first show that JK is invariant. Let

r:\xymatrix{HC \ar[r] & HC}

be given. In order to show that ∃_{r}JK ≤ JK, it suffices to show that ∃_{r}JK ∈ 𝔓_{K}, i.e., for every homomorphism p:\xymatrix{HC \ar[r] & HC} , we have ∃_{p}(∃_{r}JK) ≤ K. A quick calculation shows

∃_{p}∃_{r}JK = ∃_{p∘r} ⋁_{L∈𝔓_{K}} L = ⋁_{L∈𝔓_{K}} ∃_{p∘r}L ≤ K.

Next, we show that I ⊣ J. Let L be invariant. If L ≤ K, then, for every endomorphism p,

∃_{p}L ≤ L ≤ K,

so L ∈ 𝔓_{K} and hence L ≤ JK. On the other hand, if L ≤ JK, then

L ≤ JK ≤ K.
□

The adjoint pair I_{C} ⊣ J_{C} yields a comonad ⊠_{C} = I_{C}J_{C}. We will prove that ⊠_{C} is an S4 necessity operator, just as we showed in Theorem 2.2.16 that □ is an S4 operator. First, some examples calculating ⊠K for a coequation K.

Example 3.8.5. Let ΓS = (P_{fin}S)^{I}, as in Example 3.6.15. Recall that the class of deterministic automata Det forms a covariety of Set_{Γ}, where the defining coequation K over 2 is given by

K = {x ∈ UH2 | ∀i ∈ I ∀y, z ∈ σ(x)(i) . ε_{2}(y) = ε_{2}(z)}.

It is easy to show that

⊠K = {x ∈ UH2 | ∀i ∈ I ∀y, z ∈ σ(x)(i) . y = z},

or, more simply,

⊠K = {x ∈ UH2 | ∀i ∈ I . card(σ(x)(i)) < 2}.

Example 3.8.6. Recall the functor ΓA = Z × A and the coequation φ over ℕ defined by

φ = {σ | card(Col(σ)) < ℵ_{0}},

from Example 3.6.14. For each σ ∈ UHℕ, let

St(σ) = {t^{n}(σ) | n ∈ ω},

where ⟨ε_{ℕ}, h, t⟩:[figure: UHℕ; ℕ × Z × UHℕ] is the structure map for Hℕ. Then

⊠φ = {σ | card(St(σ)) < ℵ_{0}}.

In other words, σ ∈ ⊠φ just in case the coalgebra [σ] ≤ Hℕ generated by σ, as in Section 2.3, forces φ.

Theorem 3.8.7. ⊠ is an S4 necessity operator.

Proof. Again, since ⊠ is a comonad, it suffices to show that ⊠ preserves finite limits. It is obvious that ⊤ is invariant (so ⊤ ≤ ⊠⊤). We now show that

⊠K ∧ ⊠L ≤ ⊠(K ∧ L).

Let p:\xymatrix{HC \ar[r] & HC} be given (where K, L are coequations over C). Then

∃_{p}(⊠K ∧ ⊠L) ≤ ∃_{p} ⊠ K ≤ K

and, similarly, ∃_{p}(⊠K ∧ ⊠L) ≤ L. Hence, ∃_{p}(⊠K ∧ ⊠L) ≤ K ∧ L. Since p was an arbitrary endomorphism, ⊠K ∧ ⊠L ≤ ⊠(K ∧ L). □

Remark 3.8.8. Unlike □, the operator ⊠ does not commute with pullbacks along homomorphisms. Let Γ:\xymatrix{Set \ar[r] & Set} be the identity functor. We will consider a coequation K over 2 colors, that is, a subset of UH2 = 2^{ω}, the set of streams over 2. Specifically, let

K = \{\underline{0}, \underline{1}\},

where \underline{0} and \underline{1} are the constant streams. Note that K is invariant.

Let p:\xymatrix{H3 \ar[r] & H2} be the homomorphism induced by the coloring \overline{p}:\xymatrix{3 \ar[r] & 2}, where

\overline{p}(0) = 0,  \overline{p}(1) = 0,  \overline{p}(2) = 1

(i.e., p = H(\overline{p})). Then p^{∗}K is the set

\{σ ∈ 3^{ω} | ∀n σ(n) < 2\} ∪ \{\underline{2}\}.

It is easy to check that

⊠p^{∗}K = \{\underline{0}, \underline{1}, \underline{2}\} ≠ p^{∗}(⊠K) = p^{∗}K.

166 3. BIRKHOFF’S VARIETY THEOREM

In terms of substitutions, then, it is not the case that, for every homomorphism

f:\xymatrix{⟨B, β⟩ \ar[r] & ⟨A, α⟩},

(⊠K)[f(y)/x] = ⊠(K[f(y)/x]).

Next, we show that, for any coequation K over C, □K and ⊠K define the same covarieties as K. Dually, then, we are proving that, given a set of equations E, the varieties defined by taking the least congruence containing E and by closing E under substitutions are the same as the variety that E defines.

Theorem 3.8.9. Let C be given, K a coequation over C.

CoId(K) = CoId(⊠K).

Proof. Since ⊠K ≤ K, clearly CoId(⊠K) ≤ CoId(K). For the other inclusion, suppose that ⟨B, β⟩ ⊩ K. Let

p:\xymatrix{⟨B, β⟩ \ar[r] & HC}

be given. To show that Im(p) ≤ ⊠K, we will show that, for every endomorphism

r:\xymatrix{HC \ar[r] & HC} ,

∃_{r} Im(p) ≤ K. But, ∃_{r} Im(p) = Im(r ∘ p) ≤ K, since ⟨B, β⟩ ⊩ K. □

Theorem 3.8.10. Let C be given and K a coequation over C.

CoId(K) = CoId(□K).

Proof. Again, trivially, CoId(□K) ≤ CoId(K). Let ⟨B, β⟩ ⊩ K and let

p:\xymatrix{⟨B, β⟩ \ar[r] & HC}

be given. Then U Im(p) = Im(Up) ≤ K and so, by the adjunction U ⊣ [−], Im(p) ≤ [K]. Thus,

Im(Up) = U Im(p) ≤ U[K] = □K.
□

Recall the [−] functor from Section 2.2.1, which takes a regular subobject of A = U⟨A, α⟩ to the largest subcoalgebra contained in A. Hence, if K is a coequation over C, then [K]_{HC} is a subcoalgebra of HC. Since it is a coalgebra, in particular, one may ask whether the coalgebra [K] forces the coequation K. In general, this is not the case. However, if K is invariant, then [K] ⊩ K, as the following lemma shows.

Lemma 3.8.11. Let K be a coequation over injective C. Then [⊠K] ⊩ K.

3.8. INVARIANT COEQUATIONS 167

Proof. Let p:\xymatrix{[⊠K] \ar[r] & HC} be given. Because HC is regular injective, p extends to a homomorphism \xymatrix{HC \ar[r] & HC}, as shown in Figure 12. Hence, because

□ ⊠ K < ⊠K

and ⊠K is invariant, there is a unique map \xymatrix{□ ⊠ K \ar[r] & ⊠ K} making the square and thus the lower triangle commute, as desired. □

[figure: UHC; UHC; □ ⊠ K; p; ⊠K] Figure 12. [⊠K] ⊩ K.

The final lemma shows the relationship between □ and ⊠. One has the idea that □ and ⊠ “ought” to commute, but at this point we have not found a general proof of that claim. See, however, Theorem 3.8.14 for a proof that ⊠ commutes with □ when Γ preserves non-empty intersections.

Lemma 3.8.12. For any injective C,

□⊠ ≤ ⊠□.

Proof. By definition of ⊠, it suffices to show that, for every endomorphism

p:\xymatrix{HC \ar[r] & HC}, ∃_{p}□ ⊠ K ≤ □K. We know that, for every p, ∃_{p}□ ⊠ K ≤ ∃_{p} ⊠ K ≤ K.

Thus, since U commutes with ∃_{p},

U∃_{p}[⊠K]_{HC} = ∃_{p}U[⊠K]_{HC} ≤ K,

and so ∃_{p}[⊠K]_{HC} ≤ [K]_{HC}. Thus,

∃_{p}□ ⊠ K = U∃_{p}[⊠K]_{HC} ≤ U[K]_{HC} = □K.
□

These lemmas allow a simple proof of the invariance theorem.

Theorem 3.8.13 (Invariance theorem). Let C be injective, K ≤ UHC. Then K = CoId(V) for some class V of coalgebras just in case K = □ ⊠ K.

Proof. Let K = □ ⊠ K and define

V = {⟨B, β⟩ | ⟨B, β⟩ ⊩ K}.

168 3. BIRKHOFF’S VARIETY THEOREM

Then, clearly, V ⊩ K. We will show that, if V ⊩ L, then K ≤ L. From Lemma 3.8.12, we see that

K = □ ⊠ K = □ ⊠ ⊠K ≤ ⊠□ ⊠ K = K

so K = ⊠K. From Lemma 3.8.11, we know that [⊠K] = [K] is in V. Consequently,

[K] ⊩ L and hence

K = ∃_{id}□ ⊠ K ≤ L.
□

As we said previously, one suspects that □ ought to commute with ⊠. Instead, we have shown (by Lemma 3.8.12) the weaker claim that □⊠ ≤ ⊠□. We have neither a proof that, in general, □⊠ = ⊠□ nor a counterexample. However, the following theorem gives some progress to the goal. It shows that, if the forgetful functor

U_{HC}:\xymatrix{SubCoalg HC \ar[r] & RegSub(UHC)}

has a left adjoint, as discussed in Section 2.3.

Theorem 3.8.14. If U_{HC} has a left adjoint, ⟨⟩_{HC}, then ⊠□ = □⊠.

Proof. To show that ⊠□ ≤ □⊠, it is sufficient (by the adjunction U⟨⟩ ⊣ □) to show that U⟨⟩ ⊠ □ ≤ ⊠.

Let K ≤ UHC. We will show that, for every homomorphism p: \xymatrix{HC \ar[r] & HC}, ∃_{p}U⟨⟩ ⊠ □K ≤ K and conclude (by definition of ⊠) that U⟨⟩ ⊠ □K ≤ ⊠K. By Theorem 2.2.17 (□ commutes with pullback along homomorphisms), it suffices to show that

⊠□K ≤ □p^{∗}K = p^{∗}□K,

or, equivalently, ∃_{p} ⊠ □K ≤ □K. This is immediate from the definition of ⊠. □

3.9. Behavioral covarieties and monochromatic coequations

In typical applications of coalgebras in computer science, one is concerned with behavior “up to bisimulation”. That is, if two coalgebras behave the same (according to bisimulation equivalence), then we do not distinguish the two, regardless of differences in “internal structure”. Thus, one is often concerned with covarieties which are closed under total bisimulations. In this section, we discuss such covarieties, which were first studied in [GS98]. For another description of the same class of covarieties, see [Roş01]. The material covered here is also found in [AH00].

Definition 3.9.1. A total relation is a relation for which each projection is epi.

Definition 3.9.2. A behavioral covariety is a covariety which is closed under total bisimulations. That is, a covariety V such that, whenever ⟨A, α⟩ ∈ V and there is a total bisimulation relating ⟨A, α⟩ to ⟨B, β⟩, then ⟨B, β⟩ is also in V.

3.9. BEHAVIORAL COVARIETIES AND MONOCHROMATIC COEQUATIONS 169

We differ from Gumm on terminology here, as he refers to covarieties closed under total bisimulations as complete covarieties.

The following theorem ensures that total bisimulations are the images of total relations in E_{Γ}.

Theorem 3.9.3. If ⟨S, σ⟩ is a relation on ⟨A, α⟩ and ⟨B, β⟩. Then U_{α,β}⟨S, σ⟩ is a total bisimulation iff ⟨S, σ⟩ is a total relation.

Proof. Let R = U_{α,β}⟨S, σ⟩, with epi projections r_{1} and r_{2} and let p:\xymatrix{S \ar@{->>}[r] & R} be the epi part of the epi-regular mono factorization, ⟨Us_{1}, Us_{2}⟩ = ⟨r_{1}, r_{2}⟩ ∘ p. Then Us_{1} = r_{1} ∘ p and Us_{2} = r_{2} ∘ p, so Us_{1}, Us_{2} are epis iff r_{1}, r_{2} are epis, respectively. By Theorem 1.2.13, U preserves and reflects epis. □

Gumm shows that behavioral covarieties over Set are definable as coequations over 1. We generalize that result to this setting and show some further equivalences. In particular, the following theorem shows that the behavioral covarieties are exactly the covarieties which are sinks, in the terminology of [Roş01].

Theorem 3.9.4. Let V be a covariety of E_{Γ}. The following are equivalent.

(1) V is closed under total bisimulations.

(2) V is closed under domains of epis.

(3) V is closed under domains of arbitrary homomorphisms.

(4) V is definable by a coequation over one color (i.e.,

V = {i:[figure: •; H1]}_{⊥}

for some regular mono i).

Proof. We prove 1⇒2 ⇒3 ⇒1 and 3 ⇔4.

1 ⇒ 2: The graph of epis are total bisimulations.

2 ⇒ 3: Let f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} be given, ⟨B, β⟩ ∈ V, and take the epi-regular mono factorization, f = i ∘ p. The domain of i is in V as a regular subcoalgebra of ⟨B, β⟩. Hence ⟨A, α⟩ ∈ V.

3 ⇒ 1: Let ⟨A, α⟩ and ⟨B, β⟩ be given and let ⟨R, ρ⟩ be a total bisimulation on ⟨A, α⟩ and ⟨B, β⟩. Suppose, further, that ⟨A, α⟩ ∈ V. Then, ⟨R, ρ⟩ ∈ V, since it is the domain of the projection

\xymatrix{⟨R, ρ⟩ \ar[r] & ⟨A, α⟩}.

Since V is closed under codomains of epi homomorphisms, ⟨B, β⟩ ∈ V. 3 ⇒ 4: Since V ⊆ {ε_{H1}^{V}}_{⊥}, it suffices to show the other inclusion. Let ⟨A, α⟩ be given and suppose that ⟨A, α⟩ ⊥ ε_{H1}^{V}. Then !:\xymatrix{⟨A, α⟩ \ar[r] & H1} factors through ε_{H1}^{V}, and so ⟨A, α⟩ is the domain of an arrow into U^{V}H^{V}H1, which is in V.

170 3. BIRKHOFF’S VARIETY THEOREM

4 ⇒ 3: Let V = {i}_{⊥}, where i is a regular mono into H1. Let

p:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩}

be given and suppose ⟨B, β⟩ ∈ V. Then !_{β}:\xymatrix{⟨B, β⟩ \ar[r] & H1} factors through i, say, !_{β} = i ∘ f. Consequently, !_{α} = i ∘ f ∘ p. Since !_{α} is the only map from

⟨A, α⟩ to H1, it follows that ⟨A, α⟩ ⊥ i.
□

Remark 3.9.5. In the proof of 3 ⇒ 1, we see that if ⟨A, α⟩ in V and ⟨R, ρ⟩ is a bisimulation on ⟨A, α⟩ and ⟨B, β⟩ such that

\xymatrix{⟨R, ρ⟩ \ar[r] & ⟨B, β⟩}

is epi, then ⟨B, β⟩ ∈ V. We do not require that both projections are epis.

Example 3.9.6. Very often, the initial Γ-algebra can be realized as a regular subcoalgebra of the final Γ-coalgebra, via the comparison map of Section 1.5.4 (see [Adá01, Bar93] for development of this topic). In these cases, the initial algebra can also be viewed as a coequation φ over 1 color.

This provides a useful coequation in the standard examples, allowing one to distinguish between coalgebras consisting of well-founded trees, say, and those which also contain non-well-founded trees.

It is instructive to compare Theorem 3.9.4 to its dual, which says that a variety of algebras is closed under codomains of monos iff it is definable by a set of equations with no variables. See Section 3.9.3 for details.

3.9.1. A covariety closure operation. We can also consider a covariety closure operation, taking a covariety to the least behavioral covariety containing it. Specifically, we define an operator

\xymatrix{CoVar(E_{𝔾}) \ar[r] & CoVar(E_{𝔾})}

taking a covariety V to the collection \overline{V}, where ⟨A, α⟩ ∈ \overline{V} iff there is some map f: \xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} with ⟨B, β⟩ ∈ V, thus closing V under domains of arbitrary homomorphisms.

It is easy to show that this closure produces another covariety. Hence,

Theorem 3.9.7. If V is a covariety, then \overline{V} is a behavioral covariety.

The next theorem states in coequational terms how to obtain \overline{V}. We know that V is defined by a collection of coequations, in the sense that V is exactly the class of coalgebras co-orthogonal to a collection of regular monos with cofree codomains. In fact, we can say more about the collection of regular monos — namely, that the regular monos are the components of the counit of a regular mono co-reflection (Corollary 3.2.8). We show that this counit also gives a defining coequation for \overline{V}. Of course, since \overline{V} is a behavioral covariety, the only component one needs to consider is that of the final coalgebra.

Theorem 3.9.8. Let V be a variety and ε^{V} :\xymatrix{U^{V}H^{V} \ar[r] & 1_{E_{𝔾}}} be the counit of the associated adjunction

\xymatrix{V \ar[rr]^{U^{V}} & ⊥ & E_{𝔾} \ar[ll]^{H^{V}}}

Then \overline{V} = \{ε_{H1}^{V}\}_{⊥}.

Proof. Let ⟨A, α⟩ ∈ \overline{V}. Then there is an f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩} such that ⟨B, β⟩ ∈ V. Since ⟨B, β⟩ ∈ V, clearly ⟨B, β⟩ ⊥ ε_{H1}^{V}. Consequently, ⟨A, α⟩ ⊥ ε_{H1}^{V}.

On the other hand, if ⟨A, α⟩ ⊥ ε_{H1}^{V}, then the factorization of \xymatrix{⟨A, α⟩ \ar[r] & H1} through ε_{H1}^{V} is a homomorphism into a coalgebra in V. Hence ⟨A, α⟩ ∈ \overline{V}. □

Note that behavioral covarieties are defined by a single coequation, regardless of any boundedness conditions on Γ.

3.9.2. An example of a non-behavioral covariety. We have given a couple of examples of non-behavioral covarieties previously, including Examples 3.6.11, 3.6.14, 3.6.15 and 3.6.16. We provide an example here that arises from a comparison of categories of streams.

Consider the functors ℕ × − and 1 + ℕ × − on the category Set. As usual, we think of coalgebras for these functors as collections of streams over ℕ (see [JR97], for instance). In particular, a coalgebra for ℕ × − can be thought of as a collection of infinite streams, closed under the tail destructor. A coalgebra for 1 + ℕ × − can be understood as a collection of finite or infinite streams over ℕ, again closed under the tail destructor (when defined).

It is clear that the category Set_{ℕ×−} is a full subcategory of Set_{1+ℕ×−}. What is less obvious is that one can regard Set_{1+ℕ×−} as a full subcategory of Set_{ℕ×−}, and it is this perspective on which we will focus. Define a functor \xymatrix{Set_{1+ℕ×−} \ar[r] & Set_{ℕ×−}} as follows. If ⟨A, α⟩ is a 1 + ℕ × − coalgebra, then I(⟨A, α⟩) = ⟨A, α⟩′ will be a ℕ × − coalgebra. Specifically, let α′ be defined by

α′(a) = \begin{cases}⟨0, a⟩ & if α(a) = ∗ \\ ⟨h_{α}(a) + 1, t_{α}(a)⟩ & else \end{cases}

(where h_{α}(a) = π_{1} ∘ α(a) and t_{α} = π_{2} ∘ α(a) when α(a) ∈ ℕ × A). Intuitively, I takes infinite lists to the list one gets by applying successor in each position. For finite lists, I again applies successor in each position and then tacks on 0’s at the end. However, the 0’s are tacked on in a particular manner — once we hit 0 in the list, the “state” never changes. We stay at the same element of A and continue outputting 0’s. This

172 3. BIRKHOFF’S VARIETY THEOREM

description should lend plausibility to the claim that V is not behavioral, which we will later prove. The property that a coalgebra stabilizes at a particular state is not a property closed under total bisimulation.

It is routine to check that this defines a functor and, furthermore, that it is full, faithful and regular injective on objects. Let V be the image of Set_{1+ℕ×−}. One could check directly that V is a covariety, but we prefer to explicitly give a defining coequation (over 2 colors) instead. In keeping with the coloring metaphor, we denote the elements of 2 by red and blue.

Let ⟨h, t⟩ be the structure map on H2 and define φ ≤ UH2 by

φ = {σ ∈ UH2 | h(σ) = 0 → ε_{2}(σ) = ε_{2} ∘ t(σ)}.

We will show that V = Frc(φ).

Suppose that a ∈ A and h_{α}(a) = 0, but t_{α}(a) ≠ a (i.e., assume ⟨A, α⟩ ∉ V). Then, we define a coloring p on A by

p(b) = \begin{cases}red & if a = b \\ blue & else \end{cases}

Then, let p̃ be the adjoint transpose of p. We see that

h(p̃(a)) = h_{α}(a) = 0,

but ε_{2}(p̃(a)) = red and

ε(t(p̃(a))) = ε(p̃(t(a))) = p(t(a)) = blue .

Hence, p̃(a) ∉ φ, and so ⟨A, α⟩ ⊮ φ.

On the other hand, suppose that ⟨A, α⟩ ∈ V and let p:\xymatrix{A \ar[r] & 2} be given. Let a ∈ A and we will show that p̃(a) ∈ φ. Accordingly, assume that h(p̃(a)) = 0. Then, h_{α}(a) = 0 and so t_{α}(a) = a. Consequently, ε_{2}(p̃(a)) = ε_{2}(tp̃(a)) and so p̃(a) ∈ φ. Since this holds for any a ∈ A, we see that p̃ factors through φ and so ⟨A, α⟩ ⊩ φ.

Remark 3.9.9. While this coequation defines the covariety V, it is worth noting that φ is not itself an element of the covariety. Instead, there is a proper regular subcoalgebra of φ which is in the covariety and which also defines V, namely U ⊠ [φ], where ⊠ is the modal operator from Section 3.8 which takes a coequation to its largest invariant subcoalgebra. This coequation is given by

U ⊠ [φ] = {σ ∈ UH2 | ∀nht^{n}(σ) = 0 → t^{n+1}(σ) = t^{n}(σ)}.

3.9.3. The dual to behavioral covarieties. In this section, we relate the discussion of behavioral covarieties to categories of algebras. Throughout this section, we assume that E is a Birkhoff category and Γ preserves regular epis and is a varietor, so that U:\xymatrix{E^{Γ} \ar[r] & E} is monadic.

Definition 3.9.10. Let V be a full subcategory of E^{Γ}. We say that V is an elementary variety if V = \{p\}^{⊥} for some regular epi p:\xymatrix{F 0 \ar@{|->}[r] & •}.

Clearly, if V is an elementary variety, then it is a variety.

In the traditional setting, then, a variety is elementary just in case it is definable by a set of variable-free equations. Of course, if the signature has no constants, then this means that the only elementary variety is trivial.

Definition 3.9.11. We say that two Γ-algebras ⟨A, α⟩ and ⟨B, β⟩ are constructibly equivalent just in case ⟨0⟩_{α} ≅ ⟨0⟩_{β} (i.e., just in case the least subalgebra of ⟨A, α⟩ is isomorphic to the least subalgebra of ⟨B, β⟩).

We call this constructible equivalence because it requires that the “constructible” parts of ⟨A, α⟩ and ⟨B, β⟩ are isomorphic. That is, it requires that those elements of ⟨A, α⟩ and ⟨B, β⟩ which can be specified by a variable-free term (i.e., by terms in F 0) satisfy the same equations. This description hints at the relation between constructible equations and elementary varieties. We make the relation explicit in the following theorem.

Theorem 3.9.12. Let V be a variety of E^{Γ}. The following are equivalent.

(1) V is closed under constructible equivalences.

(2) V is closed under codomains of monos.

(3) V is closed under codomains of arbitrary homomorphisms.

(4) V is elementary.

Proof. This theorem is the dual of Theorem 3.9.4. However, we have not dualized closure under total bisimulations directly, since corelations are not familiar objects of study. Instead, we’ve replaced that condition with the closure under constructible equivalence. We provide the relevant steps.

1 ⇒ 2: Let [figure: ⟨A, α⟩; ⟨B, β⟩] be given. Then, by Theorem 1.3.7, ⟨0⟩_{α} is given as the factorization of !_{α}, as shown below.

[figure: F 0; !_{α}; ⟨A, α⟩; ⟨B, β⟩; _{⟨0⟩_{α}}]

By the uniqueness of regular epi-mono factorizations, ⟨0⟩_{α} ≅ ⟨0⟩_{β}, so ⟨A, α⟩ and ⟨B, β⟩ are constructibly equivalent.

4 ⇒ 1: Let

V = \{p:\xymatrix{F 0 \ar@{|->}[r] & ⟨Q, ν⟩}\}^{⊥}

174 3. BIRKHOFF’S VARIETY THEOREM

and let ⟨A, α⟩ and ⟨B, β⟩ be constructibly equivalent, with ⟨A, α⟩ ∈ V. Then, !_{α} factors through p, as shown in the diagram below.

[figure: F 0; p; ⟨0⟩_{α}; ⟨A, α⟩; ⟨Q, ν⟩]

Because p is regular (and hence, strong), we have the factorization of

\xymatrix{⟨Q, ν⟩ \ar[r] & ⟨A, α⟩}

through ⟨0⟩_{α} ≅ ⟨0⟩_{β}, as shown. This gives a factorization of !_{β} through η_{F 0}^{V}, as desired.

□

CHAPTER 4 The internal logic of E_{𝔾}

It is well-known that, if E is a topos and a comonad 𝔾:\xymatrix{E \ar[r] & E} is left exact, the category of coalgebras E_{𝔾} is also a topos [BW85, Theorem 6.4.1]. Furthermore, Johnstone, et al, strengthened this result in [JPT^{+}98] by showing that, if 𝔾 preserves pullbacks (but not necessarily all finite limits), then E_{𝔾} is again a topos. One corollary to these theorems is that there is a natural logic for at least certain categories of coalgebras, the “internal logic” associated with a topos.

In this chapter, we weaken the conditions on E and 𝔾, so that E_{𝔾} is not necessarily a topos, while retaining sufficient structure so that we can define an internal logic for E_{𝔾}. In particular, in this section, we show that if E is a locally complete logos, with regular epi-regular mono factorizations and coproducts, and 𝔾 nearly preserves pullbacks, then E_{𝔾} is a locally complete logos. Consequently, we can define a logic L(E_{𝔾}) which can be interpreted in E_{𝔾}. We discuss the internal logic of a an arbitrary locally complete logos in Section 4.1.2.

Since, by assumption, the base category E is also a locally complete logos, there is an internal logic, L(E), for it as well. We introduce types for the carriers of coalgebras and a modal operator for the largest subcoalgebra construction in Section 4.2. We also introduce a translation of formulas from L(E_{𝔾}) to L(E) which preserves and reflects valid sequents.

We conclude the chapter by relating the Kripke-Joyal semantics for L(E) to the definition of coequation forcing given in Chapter 3, and offering a definition of pointwise forcing of coequations which we relate to the comonad associated with a coequation.

Throughout this chapter, we develop the theory for categories of coalgebras for a comonad, rather than coalgebras for an endofunctor. We do this so that the internal logic we develop can be applied to the covarieties from Chapter 3. In fact, the presence of a right adjoint to the forgetful functor plays little role otherwise.

4.1. Preliminary results

We begin with a result found in [GHS01]. One could develop the internal logic of E_{𝔾} without requiring that the category is extensive, although this would preclude our definitions for coproduct types. We want to exploit coproducts in E_{𝔾} by introducing

176 4. THE INTERNAL LOGIC OF E_{𝔾}

the appropriate types and terms in L(E_{𝔾}), and so we begin with a proof that, if 𝔾 preserves pullbacks along regular monos, E_{𝔾} inherits extensiveness from the base category E. A similar result can be found in [JPT^{+}98, Lemma 3.8].

Theorem 4.1.1. If E is extensive, with epi-regular mono factorizations, and 𝔾 preserves regular monos and non-empty pullbacks along regular monos, then E_{𝔾} is extensive.

Proof. Let the commutative diagram in Figure 1 be given. Since co-projections

[figure: ⟨X, χ⟩; ⟨Z, ζ⟩; ⟨Y, υ⟩; ⟨A, α⟩; κ_{α}; ⟨A, α⟩ + ⟨B, β⟩; ⟨B, β⟩; κ_{β}]

Figure 1. E_{𝔾} is extensive.

in extensive categories are regular monos [Tay99, Lemma 5.5.7] and U reflects regular monos, the co-projections κ_{α} and κ_{β} are also regular monos.

Hence, U creates pullbacks along co-projections. Since U also creates coproducts, the result follows. □

Until now, we have been satisfied with epi-regular mono factorizations without assuming that these factorizations are stable under pullback. To develop a reasonable internal logic, one wants this stability condition. Without stable factorizations, we would lose basic structural features in the language, including that existentials and joins commute with substitutions.

One way to ensure stable factorizations is to ensure that our epi-regular mono factorizations involve epis which are stable under pullbacks. This is the approach we take here, exploiting results from [JPT^{+}98], in which they show that, if 𝔾 nearly preserves pullbacks, then E_{𝔾} inherits regularity from E.

Definition 4.1.2. A functor F: \xymatrix{C \ar[r] & D} nearly preserves pullbacks if, for each pullback A ×_{C} B, F (A ×_{C} B) covers F A ×_{F C} F B, i.e., the canonical isomorphism

\xymatrix{F (A ×_{C} B) \ar[r] & F A ×_{F C} F B}

is a regular epi.

In ibid, they show that, if F nearly preserves pullbacks, then it preserves pullbacks along monos and hence it preserves monos. Using this, they prove that, if the comonad 𝔾 nearly preserves pullbacks and E is regular, then E_{𝔾} is regular ([JPT^{+}98,

4.1. PRELIMINARY RESULTS 177

Lemma 3.9]). We adapt that result to our setting, in which regular monos are of special interest. Hence, we will assume that the category E has regular epi-regular mono factorizations. First, we note that this implies that every mono is regular (and every epi is regular, too). While this seems a somewhat strong restriction, it is true in any topos.

Lemma 4.1.3. In a category E with regular epi-regular mono factorizations, every mono (epi,resp.) is regular.

Proof. Let i:[figure: A; B] be given and take the regular epi-regular mono factorizations i = j ∘ p. Since p is both regular epi and mono, it is an isomorphism. Dualize to conclude that every epi is regular, too. □

Theorem 4.1.4. If E is regular, with regular epi-regular mono factorizations (equivalently, E regular and every mono regular) and 𝔾 nearly preserves pullbacks, then E_{𝔾} is regular, with regular epi-regular mono factorizations created by U.

Proof. Essentially that from [JPT^{+}98]. There, they assume that U preserves monos. Here, we use the fact that 𝔾 preserves monos and every mono is regular to conclude that 𝔾 preserves regular monos. Thus, we may apply Corollary 1.2.15 to conclude that U preserves regular monos. The rest of the proof goes as in ibid. □

Corollary 4.1.5. Under the assumptions of Theorem 4.1.4, every mono in E_{𝔾} is regular and hence U preserves and reflects monos.

We adopt the material that follows from [Tay99]. See also [FS90].

A logos is a category in which one may interpret first order logic. We sketch how this is done in Section 4.1.2. In the remainder of this section, we show that if E is a “locally complete” logos (a logos with arbitrary, stable unions), and 𝔾 nearly preserves pullbacks, then E_{𝔾} is also a locally complete logos.

Definition 4.1.6. A regular category in which finite unions of subobjects exist and are stable under pullbacks and each subobject pullback functor

f^{∗}:\xymatrix{Sub(B) \ar[r] & Sub(A)}

has a right adjoint is called a logos.

Definition 4.1.7. A regular category in which arbitrary unions of subobjects exist and are stable under pullbacks is called a locally complete logos.

From [Tay99, Definition 5.8.1] and [Tay99, Theorem 3.6.9]:

Theorem 4.1.8. In a locally complete logos, for each f:\xymatrix{A \ar[r] & B}, the subobject pullback functor

f^{∗}:\xymatrix{Sub(B) \ar[r] & Sub(A)}

178 4. THE INTERNAL LOGIC OF E_{𝔾}

has a right adjoint (i.e., a locally complete logos is, in particular, a logos).

The following theorem is the main theorem justifying the rest of the chapter. We show that E_{𝔾} is a locally complete logos, assuming that E is (together with some other assumptions). This allows the definition of a first-order internal logic for E_{𝔾}. Since, by assumption, E is also a locally complete logos, it, too, has a natural internal logic. We exploit these two logics in Section 4.2.

Theorem 4.1.9. Let E be regular, with regular epi-regular mono factorizations and 𝔾 nearly preserve pullbacks (and, hence, 𝔾 preserves monos), and suppose further that E is a locally complete logos with all coproducts. Then E_{𝔾} is also a locally complete logos.

Proof. The forgetful functor creates unions and pullbacks along monos. Thus, if \{⟨A_{i}, α_{i}⟩\}_{i∈I} is a family of subcoalgebras of ⟨B, β⟩ and f:\xymatrix{⟨C, γ⟩ \ar[r] & ⟨B, β⟩} is a 𝔾-homomorphism, then

Uf^{∗} ⋃⟨A_{i}, α_{i}⟩ = f^{∗} ⋃ A_{i} = ⋃ f^{∗}A_{i} = U ⋃ f^{∗}⟨A_{i}, α_{i}⟩,

and so f^{∗} ⋃⟨A_{i}, α_{i}⟩ = ⋃ f^{∗}⟨A_{i}, α_{i}⟩. □

We can give an explicit definition of the functor ∀_{f} in terms of [−], U and the functor ∀_{Uf} in E. Since we need this characterization in Theorem 4.2.5, we include it here.

Theorem 4.1.10. For any homomorphism f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩},

∀_{f} = [−]_{β} ∘ ∀_{Uf} ∘ U_{α}.

Proof. Because f^{∗}∀_{f} ≤ 1 and [−] commutes with pullbacks of homomorphisms (Corollary 2.2.8), we have, for every ⟨C, γ⟩ ≤ ⟨A, α⟩,

f^{∗}[∀_{f}C]_{β} = [f^{∗}∀_{f}C]_{α} ≤ [C]_{α} = ⟨C, γ⟩.

Hence, [∀_{f}C]_{β} ≤ ∀_{f}⟨C, γ⟩.

Conversely,

f^{∗}U_{β}∀_{f}⟨C, γ⟩ = U_{α}f^{∗}∀_{f}⟨C, γ⟩ ≤ U_{α}⟨C, γ⟩ = C,

and so ∀_{f}⟨C, γ⟩ ≤ [∀_{f}C]_{β}. □

We summarize the results of Theorems 2.2.5, 2.2.5 and 2.2.6 in the following corollary.

Corollary 4.1.11. The forgetful functor U_{α}:\xymatrix{RegSub(⟨A, α⟩) \ar[r] & RegSub(A)} preserves ∧, ∨, ∃, ⊥ and ⊤ (but not ∀, → or ¬). That is, for any subcoalgebras ⟨P, ρ⟩, ⟨Q, ν⟩ ≤ ⟨A, α⟩, we have

(1) U_{α}(⟨P, ρ⟩ ∧ ⟨Q, ν⟩) = P ∧ Q

4.1. PRELIMINARY RESULTS 179

(2) U_{α}(⟨P, ρ⟩ ∨ ⟨Q, ν⟩) = P ∨ Q

(3) For every homomorphism f:\xymatrix{⟨A, α⟩ \ar[r] & ⟨B, β⟩}, ∃_{f}⟨P, ρ⟩ = ∃_{Uf}P.

(4) U_{α}⟨A, α⟩ = A and U_{α}⟨0, !⟩ = 0.

In other words, U_{α} “almost” preserves geometric logic (see [LM92, Chapter X]). The situation is complicated by the fact that U_{α} does not, in general, preserve finite limits. Thus, it doesn’t preserve the interpretation of contexts Γ = x_{1} : T_{1}, …, x_{n}: T_{n}, which complicates the translation of formulas in the internal logic of E_{𝔾} into formulas in the internal logic of E. Also, it doesn’t preserve equalizers, so equations in E_{𝔾} are not translated to equations in E. We will see how to avoid these difficulties in Section 4.2, where we define a translation of formulas from L(E_{𝔾}) to related formulas in L(E).

4.1.1. A weak regular subobject classifier. In this section, we show that if E has a weak regular subobject classifier, then so does E_{𝔾}. This section is selfcontained, in the sense that we do not exploit the weak regular subobject classifier when we develop the internal logic. Throughout, we assume that E is almost coregular and 𝔾 preserves regular monos.

Definition 4.1.12. Let Ω ∈ E and true:\xymatrix{1 \ar[r] & Ω} be given. We say that Ω (or the pair ⟨Ω, true⟩) is a weak regular subobject classifier if, for every regular mono [figure: P; A], there is a (not necessarily unique) \xymatrix{A \ar[r] & Ω} such that the diagram below is a pullback.

[figure: P; 1; true; A; Ω]

Theorem 4.1.13. Let Ω in E be a weak regular subobject classifier. Then HΩ is a weak regular subobject classifier in E_{𝔾}.

Proof. Let ⟨P, ρ⟩ ≤ ⟨A, α⟩. We will show that there is a homomorphism \xymatrix{⟨A, α⟩ \ar[r] & HΩ} such that the front face of Figure 2 is a pullback.

Let r:\xymatrix{A \ar[r] & Ω} be a classifying map for p in E and let r̃:\xymatrix{⟨A, α⟩ \ar[r] & HΩ} be the adjoint transpose of r, as in Figure 2. A quick diagram chase confirms that the front face of the prism commutes.

Suppose that g:\xymatrix{⟨B, β⟩ \ar[r] & ⟨A, α⟩} satisfies r̃∘ g = Htrue∘!. Then

r ∘ Ug = ε_{Ω} ∘ U(r̃∘ g) = ε_{Ω} ∘ UHtrue ∘ U! = true∘!,

and so Im(g) ≤ P. Corollary 1.2.10 ensures that the factorization of g through P is a homomorphism. □

Corollary 4.1.14. Suppose E is regular and every mono of E is regular. Further suppose that 𝔾 nearly preserves pullbacks. Then E_{𝔾} has a weak subobject classifier.

180 4. THE INTERNAL LOGIC OF E_{𝔾}

[figure: 1; P; UH1; ε_{1}; UHtrue; Ω; A; Ur̃; r; UHΩ; ε_{Ω}]

Figure 2. HΩ is a weak regular subobject classifier

Proof. Apply Corollary 4.1.5. □

The presence of a regular subobject classifier (not weak) in E is not sufficient to ensure that E_{𝔾} has a regular subobject classifier in general. To see this, consider a homomorphism r̃:\xymatrix{⟨A, α⟩ \ar[r] & HΩ}, and let r:\xymatrix{A \ar[r] & Ω} with P the subobject of A characterized by r, as in Figure 2. Then P is the pullback of UHtrue along Ur̃. It is easy to check that □_{α}P is the pullback of Htrue along r̃. Thus, for any homomorphisms

p:\xymatrix{⟨A, α⟩ \ar[r] & HΩ},
q:\xymatrix{⟨A, α⟩ \ar[r] & HΩ},

we see that p and q classify the same subcoalgebra just in case □P = □Q, where ε_{Ω} ∘ p classifies P and ε_{Ω} ∘ q classifies Q.

This observation does give a canonical choice for a characteristic map for a subcoalgebra. Given ⟨P, ρ⟩ ≤ ⟨A, α⟩, as in Theorem 4.1.13, let r̃ be the transpose of the (unique) characteristic map of P in E. Then, r̃ is minimal in the sense that, if s is any other characteristic map for ⟨P, ρ⟩, then (the object classified by) ε_{Ω} ∘ Ur̃ is smaller than (the object classified by) ε_{Ω} ∘ Us.

4.1.2. The internal logic of a logos. Given a locally complete logos C, one can define a first order language L(C) which can be interpreted in C. The first order intuitionistic logic is sound under this interpretation. Applying this result to the current setting, this leads to two first order languages. On the one hand, the base category E is, by assumption, a locally complete logos and thus we may define a language L(E) and an interpretation of the language in the category E. On the other hand, E_{𝔾} is also a locally complete logos and so we may define a language L(E_{𝔾}) over E_{𝔾}. In Section 4.2, we will translate formulas in the language L(E_{𝔾}) to formulas in L(E)

4.1. PRELIMINARY RESULTS 181

In this section, we will show how one defines a first order language L(C) for any distributive, locally complete logos C with coproducts (for the coproduct types below). This construction applies to the categories E and E_{𝔾}, yielding the languages L(E) and L(E_{𝔾}).

See any of [But98, Bor94, LM92, Tay99, LS86] for presentations of the internal logic of a category.

The language L(C) is a typed first order language. We write x: T to indicate that x is a variable of type T (we assume a countable set of variables). A context Γ is a finite list of such declarations. We write Γ, x: T to indicate the context Γ with a new declaration for x. Whenever we write this, we assume that x does not already occur in Γ. We write Γ | t: T to indicate that, in context Γ, the term t is of type T. This notation presumes that the free variables of t appear in Γ. We write Γ | φ to indicate that φ is a well-formed formula in context Γ.

For each object C ∈ C, we define a type C in L(C). For each pair of types S and T, we define types S × T and S + T. The types are interpreted as objects in C in the obvious way. I.e., ⟦C⟧ = C, ⟦S × T ⟧ = ⟦S⟧ × ⟦T ⟧, etc. The type formation rules and interpretation of types are summarized in Table 1.

Type formation rule Interpretation
C  C
S × T  ⟦S⟧ × ⟦T ⟧
S + T  ⟦S⟧ + ⟦T ⟧
1  1

Table 1. The inductive definition of types.

A context inherits its interpretation from the terms, so that

⟦x_{1} : T_{1}, x_{2} : T_{2}, …, x_{n}: T_{n}⟧ = ⟦T_{1}⟧ × ⟦T_{2}⟧ × … × ⟦T_{n}⟧.

The empty context is, of course, interpreted as 1, the final object of C. We want to treat the contexts as unordered, so that we don’t differentiate between the contexts

Γ = x: S, y: T and Δ = y: T, x: S.

We may do this by assuming an ordering on the types, so that there is a canonical representative for each equivalence class of contexts (and so that a context is interpreted as its representative is). None of this is crucial in what follows, but it simplifies the presentation.

A term t: T in context Γ is interpreted as a function

⟦Γ | t: T ⟧ = ⟦t⟧:\xymatrix{⟦Γ⟧ \ar[r] & ⟦T ⟧.}

182 4. THE INTERNAL LOGIC OF E_{𝔾}

We omit the types and write ⟦Γ | t⟧, or just ⟦t⟧, when convenient. For each type T, and each variable x, we have the term formation rule

Γ, x: T | x: T .

We interpret variables as the projection

\xymatrix{⟦Γ⟧ × ⟦T ⟧ \ar[r]^{π_{T}} & ⟦T ⟧}.

For each arrow f:\xymatrix{⟦S⟧ \ar[r] & ⟦T ⟧}, we have also a term formation rule

Γ, x: S | fx: T ,

and an interpretation

⟦Γ, x | fx⟧ = f ∘ ⟦Γ, x | x⟧:\xymatrix{⟦Γ⟧ × ⟦S⟧ \ar[r] & ⟦T ⟧}.

In addition to variables and terms for each function symbol, we include the following term formation rules in Table 2. In what follows, we let t[s/x] denote the result of substituting the term s for the variable x in term t, where this operation is defined inductively as usual. Similarly, φ[s/x] denotes the substitution of s for x in the formula φ, where this is defined as usual.

Term formation rule  Interpretation
Γ, x: T | x: T  π_{T} :\xymatrix{⟦Γ⟧ × ⟦T ⟧ \ar[r] & ⟦T ⟧}
Γ, x: S | fx: T  f ∘ ⟦x⟧
Γ | ∗: 1  !_{⟦Γ⟧}:\xymatrix{⟦Γ⟧ \ar[r] & ⟦1⟧}
Γ, x: S, y: T | (x, y): S × T  ⟨⟦x⟧, ⟦y⟧⟩
Γ, x: S × T | π_{1}x: S  π_{1} ∘ ⟦x⟧
Γ, x: S × T | π_{2}x: T  π_{2} ∘ ⟦x⟧
Γ, x: S | inl x: S + T  κ_{1} ∘ ⟦x⟧
Γ, y: T | inr y: S + T  κ_{1} ∘ ⟦x⟧

\frac{Γ, x: S | s: U Γ, y: T | t: U}{Γ, z: S + T | case z of x ⇒ s, y ⇒ t: U}

[⟦s⟧, ⟦t⟧]
\frac{Γ, x: S | t: T  Γ | s: S}{Γ | t[s/x]: T}  ⟦t⟧ ∘ ⟨id_{⟦Γ⟧}, ⟦s⟧⟩

Table 2. Term formation rules for L(C).

Remark 4.1.15. In the interpretation of the case statement in Table 2, we implicitly use the isomorphism

⟦Γ⟧ × ⟦S + T ⟧ ≅ (⟦Γ⟧ × ⟦S⟧) + (⟦Γ⟧ × ⟦T ⟧).

Remark 4.1.16. It is easy to verify that, if Γ | t: T, then Γ, Δ | t: T. Furthermore,

⟦Γ, Δ | t⟧ = ⟦Γ | t⟧ ∘ π_{⟦Γ⟧}.

4.1. PRELIMINARY RESULTS 183

A formula φ in context Γ is interpreted as a subobject of ⟦Γ⟧. We give the inductive definition of the class of formulas of L(C) together with their interpretations in Table 3.

Formula formation rule Interpretation
x: T | φ_{P} (x)  [figure: P; ⟦T ⟧]
x: T, y: T | x = y  Δ_{T}
Γ | ⊤  [figure: ⟦T ⟧; id; ⟦T ⟧]
Γ | ⊥  [figure: 0; ⟦T ⟧]
\frac{Γ | φ Γ | ψ}{Γ | φ ∧ ψ}  ⟦φ⟧ ∧ ⟦ψ⟧
\frac{Γ | φ Γ | ψ}{Γ | φ → ψ}  ⟦φ⟧ → ⟦ψ⟧
\frac{Γ, x: T | φ}{Γ | ∃_{x: T} φ}  ∃_{π_{⟦Γ⟧}}⟦φ⟧
\frac{Γ, x: T | φ}{Γ | ∀_{x: T} φ}  ∀_{π_{⟦Γ⟧}}⟦φ⟧
\frac{Γ, x: T | φ Γ | t: T}{Γ | φ[t/x]} ⟨id_{⟦Γ⟧}, ⟦t⟧⟩^{∗}⟦φ⟧
\frac{Γ | φ}{Γ, Δ | φ}  (π_{⟦Γ⟧})^{∗}⟦φ⟧

Table 3. Formula formation and interpretation

The following theorem is standard. We omit the proof.

Theorem 4.1.17. For any x: S | t: T and any formula x: S | φ,

⟦y: T | ∃_{x: S}(t(x) = y ∧ φ(x))⟧ = ∃_{⟦t⟧}⟦φ⟧,
⟦y: T | ∀_{x: S}(t(x) = y → φ(x))⟧ = ∀_{⟦t⟧}⟦φ⟧.

We use a Gentzen-style proof system, although we allow only a single formula as the antecedent of the sequent. A sequent comes in context, where the context applies to both the antecedent and consequent. Thus, a sequent

Γ | φ ⊢ ψ

is understood as the assertion that Γ | φ entails Γ | ψ.

Accordingly, a sequent Γ | φ ⊢ ψ is valid (written ⊧ Γ | φ ⊢ ψ) just in case ⟦Γ | φ⟧ ≤ ⟦Γ | ψ⟧ (as subobjects of ⟦Γ⟧).

The following are sound rules of inference for L(E). We just write the sequent for axioms, and we write

\frac{Γ | φ ⊢ ψ}{Δ | ϑ ⊢ χ}

184 4. THE INTERNAL LOGIC OF E_{𝔾}

to indicate a rule that, from φ ⊢ ψ, one can infer ϑ ⊢ χ. We denote equivalences with a double underline, so that

\begin{matrix}Γ | φ ⊢ ψ \\ Δ | ϑ ⊢ χ \end{matrix}

means that from φ ⊢ ψ, one can infer ϑ ⊢ χ and also from ϑ ⊢ χ, one can infer φ ⊢ ψ. Structural rules:

(Str1) Γ | φ ⊢ φ

(Str2) \frac{Γ | φ ⊢ ψ  Γ | ψ ⊢ ϑ}{Γ | φ ⊢ ϑ}
(Str3) \frac{Γ, x: T | φ ⊢ ψ Γ | t: T}{Γ | φ[t/x] ⊢ ψ[t/x]}

Logical rules:

(Log1) Γ | φ ⊢ ⊤

(Log2) \begin{matrix}Γ | φ ⊢ ψ Γ | φ ⊢ ϑ \\ Γ | φ ⊢ ψ ∧ ϑ \end{matrix}
(Log3) \begin{matrix}Γ | φ ⊢ ψ Γ | ϑ ⊢ ψ \\ Γ | φ ∨ ϑ ⊢ ψ \end{matrix}
(Log4) \begin{matrix}Γ | φ ⊢ ψ → ϑ \\ Γ | φ ∧ ψ ⊢ ϑ \end{matrix}
(Log5) \begin{matrix}Γ | φ ⊢ ∀_{x: T} ψ \\ Γ, x: T | φ ⊢ ψ \end{matrix}
(Log6) \begin{matrix}Γ | ∃_{x: T} φ ⊢ ψ \\ Γ, x: T | φ ⊢ ψ \end{matrix}

Equality:

(Eq1) Γ | ⊤ ⊢ x = x (Eq2) Γ | x_{1} = x_{2} ⊢ x_{2} = x_{1} (Eq3) Γ | x_{1} = x_{2} ∧ x_{2} = x_{3} ⊢ x_{1} = x_{3} (Eq4) Γ | x_{1} = x_{2} ⊢ t(x_{1}) = t(x_{2}) (Eq5) For each atomic formula φ_{P}, Γ | x_{1} = x_{2} ∧ φ_{P} (x_{1}) ⊢ φ_{P} (x_{2})

Pairing:

(Pr1) Γ, x: 1 | ⊤ ⊢ x = ∗ (Pr2) Γ | x_{1} = y_{1} ∧ x_{2} = y_{2} ⊢ (x_{1}, x_{2}) = (y_{1}, y_{2}) (Pr3) Γ, z: S × T | ⊤ ⊢ z = (π_{1}z, π_{2}z) (Pr4) Γ, x: Sy: T | ⊤ ⊢ π_{1}(x, y) = x ∧ π_{2}(x, y) = y

4.1. PRELIMINARY RESULTS 185

As usual, one introduces tupling and projections π_{i}^{n} for arbitrary finite products and shows that rules (Pr3) and (Pr4) generalize to theorems

Γ, z: T_{1} × … × T_{n} | ⊤ ⊢ z = ⟨π_{1}^{n}z, …, π_{n}^{n}z⟩
Γ, x_{1} : T_{1}, …, x_{n}: T_{n} | ⊤ ⊢ π_{i}^{n}⟨x_{1}, …, x_{n}⟩ = x_{i}

Co-pairing: (CoPr1) Γ, z: S | ⊤ ⊢ (case inl z of x ⇒ s, y ⇒ t) = s[z/x] (CoPr2) Γ, z: T | ⊤ ⊢ (case inr z of x ⇒ s, y ⇒ t) = t[z/y] (CoPr3) Γ, z: S + T | ⊤ ⊢ (case z of x ⇒ inl x, y ⇒ inr y) = z

4.1.3. An example using the internal logic. In this section, we use the internal logic to offer an alternate approach to some of the results in Section 3.9. In Theorem 3.9.4, we showed that, ⟨A, α⟩ and ⟨B, β⟩ are related by a coalgebraic relation ⟨R, ρ⟩ such that the projection r_{α}:\xymatrix{⟨R, ρ⟩ \ar[r] & ⟨A, α⟩} is epi just in case ⟨A, α⟩ forces any coequations over 1 that ⟨B, β⟩ forces. Now, there is a relation ⟨R, ρ⟩ whose projection to ⟨A, α⟩ is epi if and only if the projection

π_{1} :\xymatrix{⟨A, α⟩ × ⟨B, β⟩ \ar[r] & ⟨A, α⟩}

is epi. Also,

{φ ≤ H1 | ⟨B, β⟩ ⊩ φ} ⊆ {φ ≤ H1 | ⟨A, α⟩ ⊩ φ}

just in case Im(!_{α}) ≤ Im(!_{β}). Thus, we could restate this part of Theorem 3.9.4 as follows.

Theorem 4.1.18. The projection π_{1} :\xymatrix{⟨A, α⟩ × ⟨B, β⟩ \ar[r] & ⟨A, α⟩} is epi just in case Im(!_{α}) ≤ Im(!_{β}).

It is easy to show (see [LS86]) that, in any locally complete logos, a map f:\xymatrix{A \ar[r] & B} is epi just in case

⊧ y: B | ⊤ ⊢ ∃_{x: A}fx = y.

Similarly, it is immediate from the definition of the semantics that Im(!_{A}) ≤ Im(!_{B}) just in case

⊧ ∃_{x: A}⊤ ⊢ ∃_{y: B}⊤.

So, we can regard this fact more generally as a fact about locally complete logoses^{1} (rather than a fact about categories of coalgebras). Stated in the internal logic, Theorem 4.1.18 can be expressed as follows.

Theorem 4.1.19. x: S | ⊤ ⊢ ∃_{z: S×T} (π_{1}z = x) just in case ∃_{x: S}⊤ ⊢ ∃_{y: T} ⊤.

1We can actually weaken the requirements on the category, since the proofs don’t involve universal quantification. A prelogos (see [Tay99]) should suffice.

186 4. THE INTERNAL LOGIC OF E_{𝔾}

Proof. From x: S, z: S × T | ∃_{y: T} ⊤ ⊢ ∃_{y: T} ⊤, we infer

x: S, y: T, z: S × T | ⊤ ⊢ ∃_{y: T} ⊤.

Since any formula proves ⊤, by the cut rule (i.e., (Str2)) we have

x: S, y: T, z: S × T | (π_{1}z = x) ⊢ ∃_{y: T} ⊤.

Substituting π_{2}z for y (which does not appear free in the sequent), we infer

x: S, z: S × T | (π_{1}z = x) ⊢ ∃_{y: T} ⊤,

and hence x: S | ∃_{z: S×T} (π_{1}z = x) ⊢ ∃_{y: T} ⊤. Now, assuming

x: S | ⊤ ⊢ ∃_{z: S×T} (π_{1}z = x),

we see x: S | ⊤ ⊢ ∃_{y: T} ⊤ and hence ∃_{x: S}⊤ ⊢ ∃_{y: T} ⊤.

For the other direction, we use the axiom

x: S, y: T, z: S × T | z = ⟨x, y⟩ ∧ π_{1}⟨x, y⟩ = x ⊢ (π_{1}z = x) (Eq5)

and the theorem x: S, y: T, z: S × T | (π_{1}z = x) ⊢ ∃_{z: S×T} (π_{1}z = x) to infer

x: S, y: T, z: S × T | z = ⟨x, y⟩ ∧ π_{1}⟨x, y⟩ = x ⊢ ∃_{z: S×T} (π_{1}z = x)

and thus

x: S, y: T | ⟨x, y⟩ = ⟨x, y⟩ ∧ π_{1}⟨x, y⟩ = x ⊢ ∃_{z: S×T} (π_{1}z = x).

Since ⊤ proves the antecedent, an application of cut yields

x: S, y: T | ⊤ ⊢ ∃_{z: S×T} (π_{1}z = x)

and hence x: S | ∃_{y: T} ⊤ ⊢ ∃_{z: S×T} (π_{1}z = x). Under the assumption that ∃_{x: S}⊤ ⊢ ∃_{y: T} ⊤, we see that x: S | ⊤ ⊢ ∃_{y: T} ⊤ and so another application of cut completes the proof. □

4.2. Transfer principles

Throughout this section, we assume that E is an extensive, well-powered, locally complete logos with regular epi-regular mono factorizations and all coproducts. We also assume that 𝔾 nearly preserves pullbacks, so that the category E_{𝔾} is also an extensive, locally complete logos with all coproducts.

Given a locally complete logos E, Section 4.1.2 constructs a first order logic that can be naturally interpreted in E. More generally, given a first order language L, an interpretation of L in a locally complete logos E consists of an assignment ⟦−⟧ which

• assigns to each type T an object ⟦T ⟧ of E;

• assigns to each term Γ | t: T an arrow ⟦t⟧:\xymatrix{⟦Γ⟧ \ar[r] & ⟦T ⟧};

• assigns to each formula Γ | φ a regular subobject ⟦φ⟧ of ⟦Γ⟧ (= ⟦T_{1}⟧ × … × ⟦T_{n}⟧).

4.2. TRANSFER PRINCIPLES 187

4.2.1. Translation of types. We augment the language L(E) by adding types ⌜T ⌝ for each type T in L(E_{𝔾}). The interpretation of ⌜T ⌝ is given by

⟦⌜T ⌝⟧ = U⟦T ⟧.

Thus, we have the following interpretations. Notice that by introducing new types for

Translation type Interpretation
⌜α:\xymatrix{A \ar[r] & GA}⌝  A
⌜S × T ⌝  U(⟦S⟧ × ⟦T ⟧)
⌜S + T ⌝  U⟦S⟧ + U⟦T ⟧
⌜1⌝  UH1

Table 4. The interpretation of translated types.

each type T in L(E_{𝔾}), we can distinguish between coalgebras with the same carrier. That is, if

α:\xymatrix{A \ar[r] & 𝔾A},
α′:\xymatrix{A \ar[r] & 𝔾A}

are distinct structure maps for A, then we have two types ⌜α⌝ and ⌜α′⌝ in L(E), both of which are interpreted as A.

The translation of a context Γ = x_{1} : T_{1}, …, x_{n}: T_{n} is given by

⌜Γ⌝ = z: ⌜T_{1} × … × T_{n}⌝.

We add the variable z of type ⌜T_{1} × … × T_{n}⌝ because the forgetful functor U does not, in general, preserve products. This translation is motivated by the observation that, given x_{1} : T_{1}, …, x_{n}: T_{n} | t: T, then we have

z: T_{1} × … × T_{n} | t[π_{1}z/x_{1}] … [π_{n}z/x_{n}]: T ,

and that this term is provably equivalent to the original t (in the sense that, if we substitute ⟨x_{1}, …, x_{n}⟩ for z, then the result is equal to the original term t).

For readability, we abuse notation and denote the translated product

⌜T_{1} × … × T_{n}⌝ ( = U(⌜T_{1}⌝ × … × ⌜T_{n}⌝))

by ⌜Γ⌝, where the meaning of ⌜Γ⌝ should be clear from context. Thus, we write

⌜Γ⌝ = z: ⌜Γ⌝,

where the translation on the left is the translation of the context and the translation on the right is the translation of the associated product.

188 4. THE INTERNAL LOGIC OF E_{𝔾}

4.2.2. Translation of terms. For each homomorphism f in E_{𝔾}, we define ⌜f⌝ = Uf. We refer to Table 5 for the translation of terms. We write ⌜t⌝ for the translation of a term t. So, for instance,

⌜Γ, x: T | fx⌝ = z: ⌜Γ, T ⌝ | ⌜f ∘ π_{S}⌝z,

where the ⌜−⌝ on the right hand side refers to the function symbol for U(f ∘ π_{i}) in L(E). For each term-in-context Γ | t: T of L(E_{𝔾}), there is a corresponding translation ⌜Γ⌝ | ⌜t⌝: ⌜T ⌝.

Term formation rule  Translation
Γ, x: T | x: T  z: ⌜Γ, T ⌝ | ⌜π_{T} ⌝z: ⌜T ⌝
Γ, x: S | fx: T  z: ⌜Γ, S⌝ | ⌜f ∘ π_{S}⌝z: ⌜T ⌝
Γ | ∗: 1  z: ⌜Γ⌝ | ⌜!⌝: ⌜1⌝
\frac{Γ | s: S  Γ | t: T}{Γ | ⟨s, t⟩: S × T}  z: ⌜Γ⌝ | ⌜⟦⟨s, t⟩⟧⌝z: ⌜S × T ⌝
Γ, x: S × T | π_{2}x: T  z: ⌜Γ, S, T ⌝ | ⌜π_{2} ∘ π_{S×T} ⌝z: ⌜T ⌝
Γ, x: S | inl x: S + T  z: ⌜Γ, S⌝ | inl⌜π_{S}⌝z: ⌜S⌝ + ⌜T ⌝
Γ, y: T | inr y: S + T  z: ⌜Γ, T ⌝ | inr⌜π_{T} ⌝z: ⌜S⌝ + ⌜T ⌝

\frac{Γ, x: S | s: U Γ, y: T | t: U}{Γ, z: S + T | case z of x ⇒ s, y ⇒ t: U}

See below

\frac{Γ, x: S | t: T  Γ | s: S}{Γ | t[s/x]: T}  See below

Table 5. Term translations rules for L(E_{𝔾}).

Notice that for pairing, we use the function symbol ⌜⟦⟨s, t⟩⟧⌝ (that is, U⟦⟨s, t⟩⟧ in L(E)). Since ⟦⟨s, t⟩⟧ is a homomorphism in E_{𝔾}, U⟦⟨s, t⟩⟧ is an arrow in E. Hence, it makes sense to translate the term ⟨s, t⟩ this way, because every arrow in E corresponds to a function symbol in L(E). Unfortunately, this translation hides the relevant features of the term ⟨s, t⟩ — namely, that it is a term built by pairing. Also, it is the only translation rule which relies on the semantics of our logic to translate a term of L(E_{𝔾}). Nonetheless, this translation or something like it is necessary, to ensure that arbitrary terms of L(E) cannot be substituted for x (say) in ⌜⟨x, y⟩⌝.

In the translation of the case statement, we use the fact that E_{𝔾} is distributive. Thus,

T_{1} × … × T_{n} × (S + T) = (T_{1} × … × T_{n} × S) + (T_{1} × … × T_{n} × T).

Since U preserves coproducts, we may take ⌜Γ, S + T ⌝ = ⌜Γ, S⌝ + ⌜Γ, T ⌝. Consequently, we translate a case statement constructed thus

\frac{Γ, x: S | s: U Γ, y: T | t: U}{Γ, z: S + T | case z of x ⇒ s, y ⇒ t: U}

4.2. TRANSFER PRINCIPLES 189

to a construction

\frac{x: ⌜Γ, S⌝ | ⌜s⌝: ⌜U⌝ y: ⌜Γ, T ⌝ | ⌜t⌝: ⌜U⌝}{z: ⌜Γ, S⌝ + ⌜Γ, T ⌝ | case z of x ⇒ ⌜s⌝, y ⇒ ⌜t⌝: ⌜U⌝}

We next discuss the translation of a term constructed by substitution. Suppose that Γ, x: S | t: T and Γ | s: S. The translation of the former is a term

z: ⌜Γ, S⌝ | ⌜t⌝: ⌜T ⌝.

We will construct a term that allows a substitution for z. Let

f = ⟨id_{⟦Γ⟧}, ⟦s⟧⟩:\xymatrix{⟦Γ⟧ \ar[r] & ⟦Γ⟧ × ⟦S⟧}.

Then the translation of f (in the context Γ) is given by

y: ⌜Γ⌝ | ⌜f⌝y: ⌜Γ, S⌝.

Thus, we can now use the substitution constructor in L(E) to construct

\frac{z: ⌜Γ, S⌝, y: ⌜Γ⌝ | ⌜t⌝: ⌜T ⌝ y: ⌜Γ⌝ | ⌜f⌝y: ⌜Γ, S⌝}{y: ⌜Γ⌝ | ⌜t⌝[⌜f⌝y/z]: ⌜T ⌝} (21)

(note the use of weakening in the term ⌜t⌝). We take this term to be ⌜t[s/x]⌝. By the definition of the translation of terms, it is easy to confirm the following.

Theorem 4.2.1. For any term Γ | t: T,

⟦⌜Γ | t⌝⟧ = U⟦Γ | t⟧.

Proof. By induction on the construction of the term. For variables,

⌜Γ, x: T | x: T ⌝ = z: ⌜Γ × T ⌝ | ⌜π_{S}⌝z: ⌜T ⌝,

and so

⟦⌜Γ, x | x⌝⟧ = Uπ_{S} ∘ ⟦z⟧ = Uπ_{S} = U⟦Γ, x | x⟧.

Other cases are proved similarly, while pairing is trivial. We include the proof for case and substitution.

Given a case term,

Γ, z: S + T | case z of x ⇒ s, y ⇒ t: U,

its translation is

z: ⌜Γ, S⌝ + ⌜Γ, T ⌝ | case z of x ⇒ ⌜s⌝, y ⇒ ⌜t⌝: ⌜U⌝.

This term in L(E) is interpreted as [⟦⌜s⌝⟧, ⟦⌜t⌝⟧] = [U⟦s⟧, U⟦t⟧] = U[⟦s⟧, ⟦t⟧]. As in (21), a substitution Γ | t[s/x]: T is translated to the term

y: ⌜Γ⌝ | ⌜t⌝[⌜f⌝y/z]: ⌜T ⌝,

where f = ⟨id_{⟦Γ⟧}, ⟦s⟧⟩. Thus, one calculates the interpretation of ⌜t[s/x]⌝ as

⟦⌜t⌝⟧ ∘ π_{⟦⌜Γ,S⌝⟧} ∘ ⟨id_{⟦⌜Γ⌝⟧}, ⟦⌜f⌝y⟧⟩ = U⟦t⟧ ∘ U⟦f⟧ ∘ ⟦y⟧ = U(⟦t⟧ ∘ ⟨id_{⟦Γ⟧}, ⟦s⟧⟩).

190 4. THE INTERNAL LOGIC OF E_{𝔾}

□

4.2.3. The internal □ operator in L(E). Before defining the translation of formulas in L(E_{𝔾}) to L(E), we must introduce an internal □ operator. This operator takes formulas φ over one variable z of type ⌜Γ⌝ to the largest subcoalgebra of ⟦φ⟧. Given this operator for unary predicates over coalgebra types, we can then define the □ operator for bisimulations and n-simulations generally, by using the work of Sections 2.5 and 2.7, although these extended operators are not S4. We will show that, if 𝔾 preserves regular relations, the n-ary □ operator is “almost” S4 — that is, it will preserve binary meets, but still one does not expect □ to preserve ⊤. In Section 4.2.6, we will show that if the bisimulation □ operator preserves binary meets, then bisimulations compose, using the internal logic.

In order to give this translation, we must first augment the language L(E) with a modal operator □ representing the “greatest subcoalgebra” construction. Thus, we add the formula formation rule

\frac{z: ⌜Γ⌝ | φ}{z: ⌜Γ⌝ | □φ} (22)

Notice that this modal operator is only defined for formulas over one variable of type ⌜Γ⌝ for some context Γ in L(E_{𝔾}). The interpretation of □ is defined by

⟦z: ⌜Γ⌝ | □φ⟧ = □_{⟦Γ⟧}⟦φ⟧.

In other words ⟦□φ⟧ is the carrier of the largest subcoalgebra of ⟦Γ⟧ contained in ⟦φ⟧.

Theorem 2.2.16 stated that □ is an S4 modal operator. Consequently, we add the standard S4 axioms, together with an axiom for substitution of homomorphic terms (justified by Theorem 2.2.17).

(□1) \frac{z: ⌜Γ⌝ | φ ⊢ ψ}{z: ⌜Γ⌝ | □φ ⊢ □ψ}

(□2) z: ⌜Γ⌝ | □φ ⊢ φ (□3) z: ⌜Γ⌝ | □φ ⊢ □□φ (□4) z: ⌜Γ⌝ | □φ ∧ □ψ ⊢ □(φ ∧ ψ) (□5) For any term Γ | t: T in L(E_{𝔾}) and formula z: ⌜T ⌝ | φ,

w: ⌜Γ⌝ | (□φ(z))[⌜t⌝/z] ⊣⊢ □(φ(z)[⌜t⌝/z])

(□6) z: ⌜Γ⌝ | ⊤ ⊢ □⊤ Because □ does not commute with arbitrary substitutions, in general,

⟦□(φ[t/x])⟧ ≠ (□φ)[t/x].

In fact, the formula on the left is defined only if the domain of ⟦t⟧ is the carrier of a coalgebra, while the right hand formula requires that the codomain of ⟦t⟧ is the carrier of a coalgebra. Hereafter, we will write □φ[t/x], or just □φ(t), to denote ⟦□(φ[t/x])⟧. Similarly, when we write

x: ⌜Γ⌝, Δ | □φ(x),

we mean the formula obtained by weakening the context of x: ⌜Γ⌝ | □φ. Notice that, in general,

(□φ(x))[t/x] ≠ □φ(t).

In Section 2.7, we saw that there is a modal operator □ taking n-ary relations R on U⟨A_{1}, α_{1}⟩, …, U⟨A_{n}, α_{n}⟩ to the largest n-simulation contained in R, which is “almost” S4 (in particular, it is normal, but □ does not typically preserve ⊤) if 𝔾 preserves regular relations. This modal operator is defined in terms of ∃, U and the subcoalgebra operator □. Thus, we can explicitly define the n-simulation □ operator in our internal logic. To simplify notation, let Γ be the context x_{1} : T_{1}, …, x_{n}: T_{n} in L(E_{𝔾}) and

p = ⟨Uπ_{1}, …, Uπ_{n}⟩:\xymatrix{⟦⌜T_{1}⌝⟧ × … × ⟦⌜T_{n}⌝⟧ \ar[r] & ⟦⌜Γ⌝⟧}.

More precisely, we want the interpretation of x_{1} : ⌜T_{1}⌝, …, x_{n}: ⌜T_{n}⌝ | □ψ to be

⟦□ψ⟧ = ∃_{p}□_{⟦⌜T_{1}⌝⟧×...×⟦⌜T_{n}⌝⟧}p^{∗}⟦ψ⟧.

Accordingly, we define □ψ to denote the formula

x_{1} : ⌜T_{1}⌝, …, x_{n}: ⌜T_{n}⌝ | ∃_{z: ⌜Γ⌝}(⋀_{i} ⌜π_{i}⌝z = w_{i} ∧ □ψ(⌜π_{1}⌝z, …, ⌜π_{n}⌝z)) (23)

Here, the formula □ψ(⌜π_{1}⌝z, …, ⌜π_{n}⌝z) stands for the formula constructed by applying □ to ψ(⌜π_{1}⌝z, …, ⌜π_{n}⌝z), that is, it denotes

z: ⌜Γ⌝ | □(ψ[⌜π_{1}⌝z/x_{1}] … [⌜π_{n}⌝z/x_{n}]).

Since the □ operator for variables z: ⌜Γ⌝ was previously defined, this formula is well-defined. Next, we show that this definition does what it is supposed to.

Theorem 4.2.2. For any formula x_{1} : ⌜T_{1}⌝, …, x_{n}: ⌜T_{n}⌝ | □φ,

⟦□φ⟧ = □_{⟦T_{1}⟧,... ,⟦T_{n}⟧}⟦φ⟧

Proof. One uses the fact that

z: ⟦Γ⟧, x_{1} : ⟦T_{1}⟧, …, x_{n}: ⟦T_{n}⟧ | ⋀_{i}⌜π_{i}⌝z = x_{i} ⊣⊢ ⟨⌜π_{i}⌝z, …, ⌜π_{n}⌝z⟩ = ⟨x_{1}, …, x_{n}⟩.

192 4. THE INTERNAL LOGIC OF E_{𝔾}

By definition of □φ in (23), we have

⟦□φ⟧ = ⟦∃_{z: ⌜Γ⌝}(⋀_{i} ⌜π_{i}⌝z = x_{i} ∧ □φ(⌜π_{1}⌝z, …, ⌜π_{n}⌝z))⟧

= ⟦∃_{z: ⌜Γ⌝}(⟨⌜π_{1}⌝z, …, ⌜π_{n}⌝z⟩ = ⟨x_{1}, …, x_{n}⟩ ∧ □φ(⌜π_{1}⌝z, …, ⌜π_{n}⌝z))⟧

= ∃_{⟦⟨⌜π_{1}⌝z,... ,⌜π_{n}⌝z⟩⟧}⟦□φ(⌜π_{1}⌝z, …, ⌜π_{n}⌝z)⟧
= ∃_{p}□⟦φ(⌜π_{1}⌝z, …, ⌜π_{n}⌝z)⟧
= ∃_{p}□p^{∗}⟦φ⟧ = □⟦φ⟧.
□

The axioms (□1) - (□ 5) generalize to axioms of the analogous formulas for the n-simulation □ operator — assuming that the comonad 𝔾 preserves regular relations for the normality axiom. Some of these axioms are easily provable in the internal logic (for instance, the deflationary axiom □φ ⊢ φ), and perhaps all of them are provable with sufficient work (although it appears the normality axiom would require some semantic argument to use the assumption that 𝔾 preserves pullbacks). Nonetheless, we rely on the work of Sections 2.5 and 2.7 to justify each of the following, which we take to be axioms.

Notably, axiom (□6) does not typically hold for the n-ary □ operator. Instead, □⊤ is properly contained in ⊤ — that is, the largest bisimulation of ⟨A, α⟩ and ⟨B, β⟩ is typically a proper subobject of A × B.

Let Γ = y_{1} : T_{1}, …, y_{n}: T_{n} (in L(E_{𝔾})) and Δ = x_{1} : ⌜T_{1}⌝, …, x_{n}: ⌜T_{n}⌝ (in L(E)).

(□1′) \frac{Δ | φ ⊢ ψ}{Δ | □φ ⊢ □ψ}

(□2′) Δ | □φ ⊢ φ (□3′) Δ | □φ ⊢ □□φ (□4′) (If 𝔾 preserves regular relations) Δ | □φ ∧ □ψ ⊢ □(φ ∧ ψ) (□5′) For any term y: S | t: T in L(E_{𝔾}) and formula Δ, x: ⌜T ⌝ | φ,

Δ, y: ⌜S⌝ | (□φ)[⌜t⌝/x] ⊣⊢ □(φ[⌜t⌝/x])

That the axioms (□1) - (□3) are sound follows from the fact that (the interpretation of) □ is a comonad, the soundness of (□4) was proved in Corollary 2.5.26, and of (□5) follows from Theorem 2.5.19, in which we proved that □ commutes with pullback along products of homomorphisms.

The next theorem is provably equivalent to Theorem 2.7.8, in which we showed that □π^{∗} ≤ π^{∗}□. The following theorem can be understood as stating that, if R is an n-simulation, then ∃_{π}R is also an m-simulation (where π is a projection — and for suitable m). The statement of the theorem is an internal version of this claim.

4.2. TRANSFER PRINCIPLES 193

Theorem 4.2.3. If 𝔾 preserves regular relations, then for any formula φ over context x: ⌜S⌝, y_{1} : ⌜T_{1}⌝, …, y_{n}: ⌜T_{n}⌝,

⊧ ∃_{x: S}□φ ⊢ □∃_{x: S}φ.

Proof. Let π denote the projection \xymatrix{⟦⌜S⌝⟧ × ∏⟦⌜T_{i}⌝⟧ \ar[r] & ∏⟦⌜T_{i}⌝⟧}. Then, by Theorem 2.7.8,

□⟦φ⟧ ≤ □π^{∗}∃_{π}⟦φ⟧ ≤ π^{∗}□∃_{π}⟦φ⟧

and so ∃_{π}□⟦φ⟧ ≤ □∃_{π}φ. Thus, ∃_{x: S}□φ ⊢ □∃_{x: S}φ. □

Thus, in case 𝔾 preserves regular relations, then we may add another □ axiom:

(□6′) ⊧ ∃_{x: S}□φ ⊢ □∃_{x: S}φ.

4.2.4. Translation of formulas. We next give a translation of formulas in L(E_{𝔾}) to formulas in L(E). The inductive definition of the translation is given in Table 6.

Formula formation rule Translation
x: T | φ_{P} (x)  x: ⌜T ⌝ | φ_{P} (x)
x: T, y: T | x = y  z: ⌜T × T ⌝ | □(⌜π_{1}⌝z = ⌜π_{2}⌝z)
Γ | ⊤  z: ⌜Γ⌝ | ⊤
Γ | ⊥  z: ⌜Γ⌝ | ⊥
Γ | φ ∧ ψ  z: ⌜Γ⌝ | ⌜φ⌝ ∧ ⌜ψ⌝
Γ | φ → ψ  z: ⌜Γ⌝ | □(⌜φ⌝ → ⌜ψ⌝)
Γ | ∃_{x: T} φ  z: ⌜Γ⌝ | ∃_{x: ⌜Γ,T ⌝}(⌜π_{Γ}⌝(x) = z ∧ ⌜φ⌝(x))
Γ | ∀_{x: T} φ  z: ⌜Γ⌝ | □∀_{x: ⌜Γ,T ⌝}(⌜π_{Γ}⌝x = z → ⌜φ⌝(x))
Γ | φ[t/x]  z: ⌜Γ⌝ | ⌜φ⌝[⌜⟨x_{1}, …, x_{n}, t⟩⌝/w]
Γ, Δ | φ  z: ⌜Γ, Δ⌝ | ⌜φ⌝[⌜π_{Γ}⌝z/z]

Table 6. Formula formation and interpretation

Remark 4.2.4. One could add a closure operator ▽ to the language of E_{𝔾} as well, where the interpretation comes from the closure operator in Section 2.7. The standard axioms for closure operators would apply, as well as the following axiom (taking its premise from L(E), its conclusion is in L(E_{𝔾})):

\frac{x: ⌜T_{1}⌝ × … × ⌜T_{n}⌝ | ∃_{z: ⌜Γ⌝}(pz = x ∧ ⌜ψ⌝(z)) ⊢ ∃_{z: ⌜Γ⌝}(pz = x ∧ ⌜φ⌝(z))}{Γ | ψ ⊢ ▽φ}

We translate the formula Γ | ▽φ into L(E) as

z: ⌜Γ⌝ | □(∃_{y: ⌜Γ⌝}(⋀_{i}⌜π_{i}⌝y = ⌜π_{i}⌝z ∧ ⌜φ⌝(y))).

194 4. THE INTERNAL LOGIC OF E_{𝔾}

One can show (as an extension of the following theorem) that

⟦⌜▽φ⌝⟧ = U⟦▽φ⟧,

but we omit the details.

Theorem 4.2.5. For every formula Γ | φ of L(E_{𝔾}),

⟦⌜Γ | φ⌝⟧ = U⟦Γ | φ⟧.

Proof. As in the proof of Theorem 4.2.1, we prove the result by induction, but present only a few of the cases here.

For formulas of the form Γ | φ → ψ, we see that

⟦φ → ψ⟧ = ⟦φ⟧ → ⟦ψ⟧
= [U⟦φ⟧ → U⟦ψ⟧]  (by Theorem 2.2.24)
= [⟦⌜φ⌝⟧ → ⟦⌜ψ⌝⟧]  (by inductive hypothesis)

On the other hand,

⟦⌜φ → ψ⌝⟧ = ⟦□(⌜φ⌝ → ⌜ψ⌝)⟧
= □⟦(⌜φ⌝ → ⌜ψ⌝)⟧
= □(⟦⌜φ⌝⟧ → ⟦⌜ψ⌝⟧) = U[⟦⌜φ⌝⟧ → ⟦⌜ψ⌝⟧].

We next consider formulas of the form Γ | ∀_{x: T} φ. We use the fact that, in any logos, for any f,

⟦∀_{x: T} (f(x) = y → φ(x, y))⟧ = ∀_{f}⟦φ(x, y)⟧,

and also that, for any homomorphism f, ∀_{f} = [−] ∘ ∀_{Uf} ∘ U (Theorem 4.1.10). Consequently,

U⟦∀_{x: T} φ⟧ = U(∀_{π_{Γ}}⟦φ⟧) = □∀_{Uπ_{Γ}}⟦⌜φ⌝⟧ = ⟦□∀_{x: ⌜Γ,T ⌝}(⌜π_{Γ}⌝x = z → ⌜φ⌝)⟧.

We translate substitutions

\frac{Γ, x: T | φ Γ | t: T}{Γ | φ[t/x]}

to substitutions

\frac{\frac{w: ⌜Γ, T ⌝ | ⌜φ⌝}{w: ⌜Γ, T ⌝, z: ⌜Γ⌝ | ⌜φ⌝} \frac{z: ⌜Γ⌝ | ⌜t⌝: ⌜T ⌝}{z: ⌜Γ⌝ | ⌜⟨x_{1}, …, x_{n}, t⟩⌝: ⌜Γ, T ⌝}}{z: ⌜Γ⌝ | φ[⌜⟨x_{1}, …, x_{n}, t⟩⌝/w]}

The interpretation of ⌜φ[t/x]⌝, then, is calculated as

⟦⌜φ[t/x]⌝⟧ = ⟦⌜φ⌝[⌜⟨x_{1}, …, x_{n}, t⟩⌝/w]⟧
= ⟦⌜⟨x_{1}, …, x_{n}, t⟩⌝⟧^{∗}⟦⌜φ⌝⟧
= (U⟦⟨x_{1}, …, x_{n}, t⟩⟧)^{∗}(U⟦φ⟧)
= U(⟨1, ⟦t⟧⟩^{∗}⟦φ⟧) = U⟦φ[t/x]⟧.

4.2. TRANSFER PRINCIPLES 195

□

Thus, we have constructed a translation from the language L(E_{𝔾}) to the language L(E) which takes a formula Γ | φ to a formula of L(E) which is interpreted as the carrier of ⟦φ⟧. This translation is “truth-preserving” in the sense that φ ⊢ ψ is valid in E_{𝔾} just in case ⌜φ⌝ ⊢ ⌜ψ⌝ is valid in E.

Theorem 4.2.6. For every sequent Γ | φ ⊢ ψ in L(E_{𝔾}), ⊧ ⌜Γ⌝ | ⌜φ⌝ ⊢ ⌜ψ⌝ iff ⊧ Γ | φ ⊢ ψ.

Proof. Suppose ⊧ Γ | φ ⊢ ψ. Then

⟦⌜Γ⌝ | ⌜φ⌝⟧ = U⟦Γ | φ⟧ ≤ U⟦(⟧Γ | ψ) = ⟦⌜Γ⌝ | ⌜ψ⌝⟧.

Conversely, suppose ⊧ ⌜Γ⌝ | ⌜φ⌝ ⊢ ⌜ψ⌝. Then

U⟦Γ | φ⟧ = ⟦⌜Γ⌝ | ⌜φ⌝⟧ ≤ ⟦⌜Γ⌝ | ⌜ψ⌝⟧ = U⟦Γ | ψ⟧.

Corollary 1.2.10 completes the proof. □

Hence, we may add a rule of inference

(Tr1) \begin{matrix}Γ | φ ⊢ ψ \\ ⌜Γ⌝ | ⌜φ⌝ ⊢ ⌜ψ⌝ \end{matrix}

4.2.5. Coinduction. We will use the internal logic to prove a formula intended to represent the principle of coinduction. The principle of coinduction for the final coalgebra H1 states that the largest coalgebraic relation on H1 is equality, i.e.,

Δ_{H1} = H1.

Equivalently, coinduction says that the largest bisimulation □_{H1,H1}⊤ is just Δ_{UH1} (see Theorem 2.6.3). In what follows, recall that the type 1 in L(E_{𝔾}) is interpreted as H1, the final coalgebra, so that ⌜1⌝ is interpreted as UH1. Thus, we wish to prove the formula

x: ⌜1⌝, y: ⌜1⌝ | □⊤(x, y) ⊢ x = y.

By definition of □ (in the formula (23)), this is the formula

x: ⌜1⌝, y: ⌜1⌝ | ∃_{z: ⌜1×1⌝}(⌜π_{1}⌝z = x ∧ ⌜π_{2}⌝z = y ∧ □⊤) ⊢ x = y. (24)

Since □⊤ ⊢ ⊤, it is sufficient to prove the simpler formula

x: ⌜1⌝, y: ⌜1⌝ | ∃_{z: ⌜1×1⌝}(⌜π_{1}⌝z = x ∧ ⌜π_{2}⌝z = y) ⊢ x = y. (25)

Indeed, since ⊤ ⊢ □⊤ (for the unary □ which appears here), (24) and (25) are equivalent.

In L(E_{𝔾}), the formula

x: 1, y: 1 | ⊤ ⊢ x = y

196 4. THE INTERNAL LOGIC OF E_{𝔾}

is provable, using (Pr1) and the equality axioms. Hence, by Theorem 4.2.6, its translation

z: ⌜1 × 1⌝ | ⊤ ⊢ □(⌜π_{1}⌝z = ⌜π_{2}⌝z)

holds in L(E). Again, we apply the deflationary axiom (□2) to conclude

z: ⌜1 × 1⌝ | ⊤ ⊢ ⌜π_{1}⌝z = ⌜π_{2}⌝z.

From this, it is a simple exercise to prove (25).

We may prove a stronger claim regarding coinduction. From Theorem 1.5.25, we know that, if 𝔾 preserves weak pullbacks, then a coalgebra ⟨A, α⟩satisfies coinduction iff ⟨A, α⟩is simple. From (the dual of) Theorem 1.5.14, we know that, if 𝔾 preserves weak pullbacks, then ⟨A, α⟩is simple iff !:\xymatrix{⟨A, α⟩ \ar[r] & H1} is a regular mono. We will now present this connection in the internal logic.

By assumption, E has regular epi-regular mono factorizations, so every mono is a regular mono. Thus, we can represent the claim that ! is a regular mono by the familiar sequent

x: ⌜T ⌝, y: ⌜T ⌝ | ⌜!⌝x = ⌜!⌝y ⊢ x = y. (26)

Here, we use the fact that U preserves regular monos, and so ! is a regular mono in E_{𝔾} iff ! is a mono in E. Hence, the theorem we wish to prove is that (26) is equivalent to (25) (replacing 1 with T in the latter). We do this by proving the antecedents are equivalent. This has the advantage that it makes clear that two elements are mapped via ! to the same element of UH1 just in case the elements are bisimilar.

First, we must see how to represent the assumption that 𝔾 preserves weak pullbacks. We use it in the proof by applying Theorem 2.5.7, to conclude that the pullback of two 𝔾-homomorphisms is a bisimulation. This fact suggests the following internal formula for each term s, t in L(E_{𝔾})

x: ⌜S⌝, y: ⌜T ⌝ | ⌜s⌝x = ⌜t⌝y ⊢ □(⌜s⌝x = ⌜t⌝y). (27)

We treat this formula as an axiom in the following proof.

Theorem 4.2.7. Suppose that 𝔾 preserves weak pullbacks. For any type T in L(E_{𝔾}),

x: ⌜T ⌝, y: ⌜T ⌝ | ⌜!⌝x = ⌜!⌝y ⊣⊢ ∃_{z: ⌜T ×T ⌝}(⌜π_{1}⌝z = x ∧ ⌜π_{2}⌝z = y).

Proof. By (27), we have

x: ⌜T ⌝, y: ⌜T ⌝ | ⌜!⌝x = ⌜!⌝y ⊢ □(⌜!⌝x = ⌜!⌝y).

By definition of □, the consequent is the formula

x: ⌜T ⌝, y: ⌜T ⌝ | ∃_{z: ⌜T ×T ⌝}(⌜π_{1}⌝z = x ∧ ⌜π_{2}⌝z = y ∧ □(⌜!π_{1}⌝z = ⌜!π_{2}⌝z)) (28)

4.2. TRANSFER PRINCIPLES 197

In the language of E_{𝔾}, one can prove that

z: T × T | ⊤ ⊢ ∗(π_{1}z) = ∗(π_{2}z), (29)

and □(⌜!π_{1}⌝z = ⌜!π_{2}⌝z) is the translation of that consequent. Hence, (28) is provably equivalent to

x: ⌜T ⌝, y: ⌜T ⌝ | ∃_{z: ⌜T ×T ⌝}(⌜π_{1}⌝z = x ∧ ⌜π_{2}⌝z = y). (30)

Hence, we have shown

x: ⌜T ⌝, y: ⌜T ⌝ | ⌜!⌝x = ⌜!⌝y ⊢ ∃_{z: ⌜T ×T ⌝}(⌜π_{1}⌝z = x ∧ ⌜π_{2}⌝ = y).

For the other direction, we again translate (29) and apply (□2) (□ is deflationary) to yield the sequent

z: ⌜T × T ⌝ | ⌜!π_{1}⌝z = ⌜!π_{2}⌝z ⊢ .

Using the axioms for equality, we get

z: ⌜T × T ⌝, x: ⌜T ⌝, y: ⌜T ⌝ | ⌜π_{1}⌝z = x ∧ ⌜π_{2}⌝z = y ⊢ ⌜!⌝x = ⌜!⌝y.

An application of existential introduction (i.e., (Str6)) completes the proof. □

Corollary 4.2.8. Let 𝔾 preserve weak pullbacks. Then, for any type T,

⊧ x: ⌜T ⌝, y: ⌜T ⌝ | ⌜!⌝x = ⌜!⌝y ⊢ x = y

just in case

⊧ x: ⌜T ⌝, y: ⌜T ⌝ | ∃_{z: ⌜T ×T ⌝}(⌜π_{1}⌝z = x ∧ ⌜π_{2}⌝z = y) ⊢ x = y.

In other words, the internal principle of coinduction is valid just in case ⌜!⌝ is monic.

4.2.6. Composition of bisimulations. We offer an example of the internal logic at work in the following theorem, in which we prove that, if 𝔾 preserves regular relations, then the composition of two bisimulations is again a bisimulation. From [JR97], one finds the well-known theorem that, if E satisfies the axiom of choice, then bisimulations compose. These two theorems suffice to prove that bisimulations compose in a variety of familiar settings, but in both theorems, the category of bisimulations consists of relations which come with a structure map (as opposed to bisimulations in the sense of Definition 2.5.4, which is more general). We know of no results for categories in which bisimulations are not “merely” relations which come with a structure map.

Theorem 4.2.9. If 𝔾 preserves regular relations, then bisimulations compose. That is, for any x: ⌜R⌝, y: ⌜S⌝ | φ and y: ⌜S⌝, z: ⌜T ⌝ | ψ such that

x: ⌜R⌝, y: ⌜S⌝ | φ ⊢ □φ and y: ⌜S⌝, z: ⌜T ⌝ | ψ ⊢ □ψ,

we have x: ⌜R⌝, z: ⌜R⌝ | ψ ∘ φ ⊢ □(ψ ∘ φ).

198 4. THE INTERNAL LOGIC OF E_{𝔾}

Proof. By the assumption, one infers that ψ ∧ φ ⊢ □ψ ∧ □φ. Hence, ψ ∧ φ ⊢ □(ψ ∧ φ). Applying the cut rule to this sequent and to the sequent

□(ψ ∧ φ) ⊢ ∃_{y: S}□(ψ ∧ φ)

yields ψ ∧ φ ⊢ ∃_{y: S}□(ψ ∧ φ) and thus ∃_{y: S}(ψ ∧ φ) ⊢ ∃_{y: S}□(ψ ∧ φ). By Theorem 4.2.3, ∃_{y: S}□(ψ ∧ φ) ⊢ □∃_{y: S}(ψ ∧ φ), and so ∃_{y: S}(ψ ∧ φ) ⊢ □∃_{y: S}(ψ ∧ φ), as desired. □

Remark 4.2.10. This proof really doesn’t require all of the assumptions on E_{𝔾} that we’ve made in this chapter. Rather, it holds whenever E has epi-regular mono factorizations, is cocomplete and finitely complete and 𝔾 preserves regular relations. In fact, 𝔾 may be an endofunctor, rather than a comonad. Thus, it holds under the same assumptions that applied in Section 2.5.2, where we discussed relationpreserving functors.

4.3. A Kripke-Joyal style semantics

Throughout this section, we continue with the assumptions from Section 4.2. That is, we assume that E is an extensive, well-powered, locally complete logos with all coproducts and regular epi-regular mono factorizations. We also assume that 𝔾 nearly preserves pullbacks.

One of the motivations for considering the internal logics L(E_{𝔾}) and L(E) is that, given an injective object C, a coequation over C is just a regular subobject of UHC, where H is right adjoint to U:\xymatrix{E_{𝔾} \ar[r] & E}. In other words, a coequation over C is the interpretation of some formula x: ⌜HC⌝ | φ.

A coalgebra ⟨A, α⟩ forces the coequation φ just in case, for every p:\xymatrix{⟨A, α⟩ \ar[r] & HC}, the image of p (more precisely, Up) is contained in the interpretation of φ. Thus, ⟨A, α⟩ ⊩ φ just in case, for every element p of HC centered at ⟨A, α⟩, we have Im(p) ≤ ⟦φ⟧. This suggests that the standard Kripke-Joyal semantics can be used to express coequation satisfaction in a simple, familiar way.

In this section, we first introduce Kripke-Joyal semantics for a locally complete logos and state (without proof) the Kripke-Joyal semantics theorem. We adopt this semantics for the category L(E), in which certain formulas represent coequations. Namely, those formulas ⌜Γ⌝ | φ are interpreted as subobjects of ⟦⌜Γ⌝⟧ = U⟦Γ⟧, and hence as conditional coequations over ⟦Γ⟧. We complete this section by proving a couple of theorems about coequation forcing in terms of the internal logic, first introducing an internal version of the S4 modal operator ⊠ from Section 3.8.

Let Γ be a context in L(E) and φ a formula in context Γ. Let A be given and a an element of ⟦Γ⟧, centered at A, i.e.,

a:\xymatrix{A \ar[r] & ⟦Γ⟧}.

4.3. A KRIPKE-JOYAL STYLE SEMANTICS 199

Then we say that A ⊩ φ(a) just in case Im(a) ≤ ⟦φ⟧, i.e., pa ∈_{A} ⟦φ⟧.

The following theorem (which can be found, essentially, in [LS86, Bor94], etc.) can be proved in any locally complete logos. As it is a well-known theorem (the Kripke-Joyal theorem — sometimes called Beth-Kripke-Joyal), we omit the proof but include the statement for completeness.

Theorem 4.3.1. Let Γ | φ be given and p ∈_{A} ⟦Γ⟧. In each of the clauses below, the context of the formula is Γ, unless stated otherwise.

(1) A ⊩ ⊤(p) always.

(2) A ⊩ ⊥(p) iff A = 0.

(3) A ⊩ (φ ∧ ψ)(p) iff A ⊩ φ(p) and A ⊩ ψ(p).

(4) A ⊩ (φ → ψ)(p) iff, for every b ∈_{B} A such that B ⊩ φ(pb), then also

B ⊩ ψ(pb).

(5) A ⊩ ∃_{x: T} φ(x, p) iff there is a regular epi b:\xymatrix{B \ar[r] & A} and a c ∈_{B} ⟦T ⟧ such that

B ⊩ φ(c, pb).

(6) A ⊩ ∀_{x: T} φ(x, p) iff, for all b ∈_{B} A and c ∈_{B} ⟦T ⟧, B ⊩ φ(c, pb).

(7) A ⊩ φ[t/x](a) iff A ⊩ φ(⟦t⟧a).

(8) (Weakening) A ⊩ Δ, Γ | φ(a) iff A ⊩ Γ | φ(π_{⟦Γ⟧}a).

Let ⌜Γ⌝ | φ be given. The ⟦φ⟧ is a conditional coequation over ⟦⌜Γ⌝⟧. A coalgebra ⟨A, α⟩forces ⟦φ⟧ just in case, for every homomorphism p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧}, we have Im(Up) ≤ ⟦φ⟧, equivalently, Im(p) ≤ ⟦□φ⟧.

Theorem 4.3.2. Let ⌜Γ⌝ | φ and ⟨A, α⟩ be given. Then ⟨A, α⟩ ⊩_{⟦Γ⟧} ⟦φ⟧ (over ⟦Γ⟧) just in case, for every element p ∈_{⟨A, α⟩} ⟦Γ⟧, that is, every homomorphism

p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧},

A ⊩ φ(Up).

We next show that a coalgebra forces φ at Up just in case it forces □φ at Up. This is an easy corollary to Corollary 2.2.9. It also implies that the quasi-covariety defined by φ is the same as that defined by □φ, i.e., Theorem 3.8.10. In Theorem 4.3.4, we present a similar theorem for the ⊠ operator.

Theorem 4.3.3. Let ⌜Γ⌝ | φ and ⟨A, α⟩ be given, and p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧} a homomorphism. Then A ⊩ φ(Up) iff A ⊩ □φ(Up).

Proof. Corollary 2.2.9 states that Up factors through ⟦φ⟧ just in case p factors through [⟦φ⟧] (the largest subcoalgebra of ⟦φ⟧). Hence, Up factors through ⟦φ⟧ iff it factors through □⟦φ⟧ = ⟦□φ⟧ (see Corollary 1.2.10). □

For the next theorems, we augment the language L(E) with another S4 modal operator, ⊠. The interpretation of ⊠φ is ⊠⟦φ⟧, that is, the largest invariant subcoalgebra of ⟦φ⟧ (see Section 3.8).

200 4. THE INTERNAL LOGIC OF E_{𝔾}

Theorem 4.3.4. ⟨A, α⟩ ⊩ φ(p), for every p ∈_{⟨A, α⟩} ⟦Γ⟧, just in case we also have ⟨A, α⟩ ⊩ ⊠φ(p) for every p ∈_{⟨A, α⟩} ⟦Γ⟧.

Proof. This is just a restatement of Theorem 3.8.9 in terms of the Kripke-Joyal semantics. □

Theorem 4.3.5. Let ⌜Γ⌝ | φ be given. If ⟦Γ⟧ is injective (say, Γ = x: HC), and p ∈_{⟨A, α⟩} ⟦Γ⟧, then

A ⊩ ⊠φ(p)

iff, for every homomorphism g:\xymatrix{⟦Γ⟧ \ar[r] & ⟦Γ⟧}, A ⊩ φ(gp).

Proof. Let A ⊩ ⊠φ(p), where p is a homomorphism, and g:\xymatrix{⟦Γ⟧ \ar[r] & ⟦Γ⟧} be given. Then, by definition of ⊠, ∃_{g}⟦⊠φ⟧ ≤ ⟦φ⟧ and thus,

Im(gp) = ∃_{g} Im p ≤ ⟦φ⟧.

Conversely, suppose that for every such g, A ⊩ φ(gp). Then, for every homomorphism g:\xymatrix{⟦Γ⟧ \ar[r] & ⟦Γ⟧}, we have ∃_{g} Im(p) ≤ ⟦φ⟧. But ⊠⟦φ⟧ was defined to be the join of all those subobjects K of U⟦Γ⟧ such that, for every homomorphism g:\xymatrix{⟦Γ⟧ \ar[r] & ⟦Γ⟧}, we have ∃_{g}K ≤ ⟦φ⟧ (see Section 3.8). Hence, the result follows. □

4.4. Pointwise forcing of coequations

Again, throughout this section, E is an extensive, well-powered, locally complete logos with all coproducts and regular epi-regular mono factorizations and that 𝔾:\xymatrix{E \ar[r] & E} is a comonad that nearly preserves pullbacks.

Let Γ be a context in L(E_{𝔾}), and φ a formula over ⌜Γ⌝, so that ⟦φ⟧ is a conditional coequation over ⟦Γ⟧. As we saw in the previous section, a coalgebra ⟨A, α⟩ forces φ just in case, for every element p of ⟦Γ⟧ centered at ⟨A, α⟩, A ⊩ φ(Up). In other words, the Kripke-Joyal semantics give a means of stating that ⟨A, α⟩ forces a coequation under a particular coloring, where ⟨A, α⟩ forces the coequation (with no qualifications) if it forces it under every coloring.

Alternatively, we could consider the elements of A and ask which elements satisfy φ. That is, which elements are mapped into ⟦φ⟧ under every mapping p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧}? Clearly, ⟨A, α⟩ iff for all p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧} and all a ∈ A, pa ∈ ⟦φ⟧. In Section 4.3, we stripped away the quantifier ranging over colorings and defined “⟨A, α⟩ forces φ under p.” In this section, we strip away the quantifier ranging over elements of A and define “⟨A, α⟩ forces φ at a,” where a is an element of A (i.e., a ∈_{B} A for some B ∈ E).

Definition 4.4.1. Let ⌜Γ⌝ | φ and ⟨A, α⟩ be given, with a ∈ A (i.e., a:\xymatrix{• \ar[r] & A} in E). Then we say

⟨A, α⟩ ⊩ φ[a]

iff, for every homomorphism p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧}, we have Im(pa) ≤ ⟦φ⟧.

We use the square brackets for pointwise forcing to distinguish the notation from A ⊩ φ(p), where p ∈_{⟨A, α⟩} ⟦Γ⟧. Clearly, ⟨A, α⟩ ⊩ φ[a] iff, for every p ∈_{⟨A, α⟩} ⟦Γ⟧,

B ⊩ φ(pa)

(where B is the domain of a, i.e., a ∈_{B} A).

Theorem 4.4.2. Let ⌜Γ⌝ | φ be given. If C is a generating set for E, then

⟨A, α⟩ ⊩_{⟦Γ⟧} ⟦φ⟧

just in case ⟨A, α⟩ ⊩ φ[a] for each a ∈_{C} A, C ∈ C.

Proof. Let ⟨A, α⟩ ⊩ ⟦φ⟧, so for every p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧}, we have ⟨A, α⟩ ⊩ φ(p). Clearly, for every a ∈_{C} A, C ∈ C, then, C ⊩ φ(pa), so ⟨A, α⟩ ⊩ φ[a].

On the other hand, suppose that ⟨A, α⟩ ⊩ φ[a] for all a ∈_{C} A, C ∈ C. Let p: \xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧} be given. Then, for each a ∈_{C} A, C ∈ C, we have C ⊩ φ(pa). Hence, p ∘ a equalizes Coker([figure: ⟦φ⟧; ⟦⌜Γ⌝⟧]) for each a:\xymatrix{C \ar[r] & A}, C ∈ C and thus (by the assumption that C is a generating set for E), p equalizes Coker([figure: ⟦φ⟧; ⟦⌜Γ⌝⟧]), too. Hence p factors through ⟦φ⟧. Since p was an arbitrary homomorphism, we see ⟨A, α⟩ ⊩_{⟦Γ⟧} ⟦φ⟧. □

It is natural to ask whether this semantics comes with a Kripke-Joyal style theorem, similar to Theorem 4.3.1. Unfortunately, we do not have any such theorem relating the condition that ⟨A, α⟩ ⊩ φ[a] and the structure of φ.

The motivation for this section is the intuition that, in order to show that a coalgebra ⟨A, α⟩ forces a coequation ⟦φ⟧, one checks that, for each element of a ∈ A and homomorphism p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧}, p(a) ∈ ⟦φ⟧. In other words, in practice, one may verify that ⟨A, α⟩ forces ⟦φ⟧ at each a ∈ A.

Supposing that, in fact, ⟨A, α⟩ does not force ⟦φ⟧, one may still be interested in those elements a ∈ A that do force φ. In what remains, we will define an functor J_{φ} taking coalgebras ⟨A, α⟩ to the subobject B ≤ A consisting of all those elements of A which pointwise force φ. We conclude by showing that if ⟦φ⟧ is a coequation over an injective ⟦Γ⟧ (i.e., a proper coequation, rather than a conditional coequation), then we can define the comonad 𝔾^{φ} in terms of J_{φ} and [−].

Given ⌜Γ⌝ | φ and ⟨A, α⟩ ∈ E_{𝔾}, we define

J_{φ}⟨A, α⟩ = ⋁\{S ≤ A | ∀p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧} . ∃_{p}S ≤ ⟦φ⟧\}.

It is easy to check that for all p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧},

∃_{p}J_{φ}⟨A, α⟩ ≤ ⟦φ⟧.

In other words, ∃_{p}J_{φ}⟨A, α⟩ ≤ J_{φ}⟨A, α⟩.

202 4. THE INTERNAL LOGIC OF E_{𝔾}

Theorem 4.4.3. J_{φ}⟨A, α⟩ is invariant, in the sense of Section 3.8. That is, for every homomorphism p:\xymatrix{⟨A, α⟩ \ar[r] & ⟨A, α⟩},

∃_{p}J_{φ}⟨A, α⟩ ≤ J_{φ}⟨A, α⟩.

Proof. Let p: \xymatrix{⟨A, α⟩ \ar[r] & ⟨A, α⟩} be given. It suffices to show that, for every

r:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧},

∃_{r}∃_{p}J_{φ}⟨A, α⟩ ≤ ⟦φ⟧,

i.e., ∃_{r∘p}J_{φ}⟨A, α⟩ ≤ ⟦φ⟧. This follows, since J_{φ}⟨A, α⟩ is a join of subobjects S such that ∃_{r∘p}S ≤ ⟦φ⟧ and joins commute with ∃. □

We still must show that J_{φ} defines a functor. Let f:\xymatrix{⟨B, β⟩ \ar[r] & ⟨A, α⟩} be given. We will show that ∃_{f}J_{φ}⟨B, β⟩ ≤ J_{φ}⟨A, α⟩. This allows one to define J_{φ}f to be the composite along the top row of Figure 3.

[figure: J_{φ}⟨B, β⟩; ∃_{f}J_{φ}⟨B, β⟩; J_{φ}⟨A, α⟩; ⟨B, β⟩; f; ⟨A, α⟩]

Figure 3. Definition of J_{φ} on arrows.

To show that ∃_{f}J_{φ}⟨B, β⟩ ≤ J_{φ}⟨A, α⟩, it suffices to show that, for every homomorphism p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧},

∃_{p}∃_{f}J_{φ}⟨B, β⟩ = ∃_{p∘f}J_{φ}⟨B, β⟩ ≤ ⟦φ⟧.

But this is clear, since p ∘ f is a homomorphism.

Theorem 4.4.4. Let a ∈_{B} A. Then a ∈ J_{φ}⟨A, α⟩ just in case ⟨A, α⟩ ⊩ φ[a].

Proof. Clearly, if ⟨A, α⟩ ⊩ φ[a], then a ∈ J_{φ}A.

On the other hand, suppose that a ∈ J_{φ}A and let r:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧} be given. Then

∃_{r}J_{φ}A = ⋁\{∃_{r}S ≤ A | ∀p:\xymatrix{⟨A, α⟩ \ar[r] & ⌜Γ⌝} . ∃_{p}S ≤ ⟦φ⟧\} ≤ ⟦φ⟧.

Hence, ra ∈ ⟦φ⟧. □

From Chapter 3, we know that there is a comonad

𝔾^{φ}:\xymatrix{E_{𝔾} \ar[r] & E_{𝔾}},

𝔾^{φ} = ⟨G^{φ}, ε^{φ}, δ^{φ}⟩, such that ⟨A, α⟩ ⊩ ⟦φ⟧ just in case ⟨A, α⟩ ⊥ ε_{α}^{φ}. In fact, G^{φ}⟨A, α⟩ is the greatest subcoalgebra ⟨B, β⟩ of ⟨A, α⟩ such that ⟨B, β⟩ ⊩ ⟦φ⟧. Hence, there is some similarity between G^{φ}⟨A, α⟩ and our definition of J_{φ}⟨A, α⟩. The following theorem makes the relationship between the two clearer.

4.4. POINTWISE FORCING OF COEQUATIONS 203

Theorem 4.4.5. If ⟦Γ⟧ is injective (so that ⟦φ⟧ defines a covariety, rather than a quasi-covariety), then

G^{⟨}A, α⟩ = [J_{φ}⟨A, α⟩]_{α}.

In other words, G^{φ}⟨A, α⟩ is the largest subcoalgebra of J_{φ}⟨A, α⟩.

Proof. Since G^{⟨}A, α⟩ ⊩ ⟦φ⟧, it follows that for every p:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧}, we have ∃_{p}UG^{φ}⟨A, α⟩ ≤ ⟦φ⟧. Hence, by definition of J_{φ}, UG^{φ}⟨A, α⟩ ≤ J_{φ}⟨A, α⟩ and so G^{φ}⟨A, α⟩ ≤ [J_{φ}⟨A, α⟩].

On the other hand, to prove the reverse inclusion, it suffices to show that the coalgebra [J_{φ}⟨A, α⟩] forces the coequation ⟦φ⟧. That is, for every homomorphism

p:\xymatrix{[J_{φ}⟨A, α⟩] \ar[r] & ⟦Γ⟧},

Im p ≤ ⟦φ⟧. Since ⟦Γ⟧ is injective, p extends to a homomorphism

p̃:\xymatrix{⟨A, α⟩ \ar[r] & ⟦Γ⟧}.

Since ∃p̃J_{φ}⟨A, α⟩ ≤ ⟦φ⟧, the conclusion follows. □

Concluding remarks and further research

In this thesis, we had three main goals in mind. First, we wanted to develop the theory of coalgebras alongside the theory of algebras in a general setting. Second, we wanted to apply the principle of duality to some well-known and fundamental theorems of universal algebra to learn their implications in the theory of coalgebras. Lastly we wanted to provide an internal logic for categories of coalgebras which is appropriate for representing relevant constructions and for expressing the relation between E and E_{𝔾} via certain transfer principles.

The first task yielded sufficient conditions for a category of coalgebras to be well enough behaved for the development of basic results like the co-Birkhoff theorem. Among other results, we found that a category E_{𝔾} of coalgebras for a comonad 𝔾 inherits much of the relevant structure from E presuming E has epi-regular mono factorizations and cokernel pairs and 𝔾 preserves regular monos. If we further assume that E has enough injectives, then so does E_{𝔾}, and these injectives provide a natural interpretation of coequations. We also showed that E_{𝔾} is “as complete” as E is, although the limits in E_{𝔾} are not created by the forgetful functor. Supposing that E is a locally complete logos with regular epi-regular mono factorizations, and 𝔾 nearly preserves pullbacks, then E_{𝔾} is also a locally complete logos and thus interprets first order logic.

We further contributed to the theory of coalgebras by offering a new definition of bisimulation which is, we hope, more natural in settings in which choice is not available. This definition preserves the intuition behind bisimulation — two elements are bisimilar just in case there’s a coalgebraic relation ⟨R, ρ⟩ such that they are related by the image of R. Furthermore, while it allows for greater structure than the traditional definition in categories without choice, it also reduces to that definition if choice is available (or if 𝔾 preserves pullbacks).

The second task is closely related to the first. In order to dualize familiar theorems from universal algebra, one must first state and prove these theorems in categorical terms. In this stage, one sees what is really relevant, categorically speaking, for a theorem like, say, the variety theorem and this in turn helps guide the development of the theory of coalgebras. To the extent that we are interested in the duals of such fundamental algebraic theorems, we are committed in assuming the dual conditions

206 CONCLUDING REMARKS AND FURTHER RESEARCH

(with certain exceptions – the proof of the subdirect product theorem is an example of a proof which is not easily dualized. Our approach, following [GS98], involved finding an alternate proof.).

Once a classic theorem has been stated and proved in terms which are easily dualized, the dual theorem must still be interpreted. For the variety theorem, this meant understanding coequations as predicates over the carrier of a cofree coalgebra, and coequation forcing as an assertion about the images of a coalgebra under the various colorings. This in turn led to an understanding of the invariance theorem. Namely, it allowed a definition of a modal operator which takes a coequation to the largest subobject which is invariant under all colorings. Without interpretations such as these, the result of dualizing a theorem is largely formal — we receive a provable statement but are at a certain loss for what it means.

The final task, too, relied on the first task for establishing the inheritance in E_{𝔾} of the relevant structure in E. This established that an internal logic for E_{𝔾} could include full first-order logic. The work on bisimulations suggested a closure operator for the language L(E_{𝔾}), in which the closed propositions correspond to nsimulations. The work on the invariance theorem suggested an interior operator as well, taking each proposition (i.e., conditional coequation) to its largest invariant subcoalgebra. For each of these operators, however, there were important properties which are semantically verifiable but not expressible in the internal logic – unless E_{𝔾} has exponentials.

The relation between E and E_{𝔾} suggested the addition of certain transfer rules which allow one to make inferences in L(E_{𝔾}) based on derivations in L(E) and vice versa. These transfer rules allowed the characteristic property of cofree coalgebras to be expressed in a natural way in the join of the logics involved.

The work presented here can be extended in several ways. First, one may be interested in base categories with less structure than we’ve assumed. For instance, if one considers coalgebras over various categories of posets, then the assumption of “enough injectives” is unreasonable. Hence, it would be worthwhile to investigate what structural properties may be lost in such settings and to try to understand what the appropriate notion of a coequation is in these settings.

Related to this concern is a question that has, unfortunately, largely remained unanswered in this thesis. Namely, what applications are there for coalgebras over categories other than Set and related categories? There is a notable lack of examples of such coalgebras – although, one should stress that the broad approach developed here does not depend on mathematical applications for its justification. Rather, it is motivated by a desire to make clear which theorems of universal algebra can be dualized in a straightforward way. Since we are not interested in coalgebras over Set^{op}, this means that we must make clear what properties of Set are relevant in

CONCLUDING REMARKS AND FURTHER RESEARCH 207

the classical theorem, so that we can see whether these properties are reasonable for categories of coalgebras as well. Nonetheless, compelling examples of coalgebras over other categories would be most helpful in understanding the basic theory.

The project of dualizing theorems in universal algebra is still in its infancy. One can go through any standard text in universal algebra and find candidates for dualization. One needs, however, to develop a few methods for dualizing certain common assertions in algebra. A survey of the work of Andréka and Németi [AN83, Ném82, AN81a, AN81b, AN79b, AN79a, AN78] shows great promise in this direction. In the early 1980’s, they extended the work of Herrlich and Banaschewski [BH76] to give an analysis of “cone-injectivity” and classes of algebras defined by an extension of equational logic. This work was unknown to the author until an anonymous reviewer for CMCS 2001 brought it to his attention. A review of these earlier results, with an eye towards applications of their coalgebraic dual, seems most promising.

The development of the internal logic in Chapter 4 should lead to clean proofs of certain claims about coalgebras. One would certainly like more examples of such proofs. To begin, it is reasonable to take well-known properties of (certain) coalgebras and prove them in the internal logic, as we did with the property of coinduction for the final coalgebra and also the proof that bisimulations compose (given that 𝔾 preserves regular relations). However, time did not permit as broad a development of these proofs in the internal logic as one would like, and in particular, we did not attempt to represent the property of corecursion and prove that it holds in the final coalgebra. The aim of using the internal logic to re-prove well-known results is twofold: First, it gives a measure of the practical strength of the logic and shows how the transfer principles can be used, and second, it allows one to develop skills of reasoning internally, much simplifying (and formalizing) proofs, and this skill can be applied for “real” advances to the theory as well.

APPENDIX A Preliminaries

A.1. Notation

We adopt the following notation conventions for morphisms in a category.

Morphism  Arrow
Monos  i:[figure: A; B]
Epis  p:\xymatrix{A \ar@{->>}[r] & B}
Regular monos  i:[figure: A; B]
Regular epis  p:\xymatrix{A \ar@{|->}[r] & B}
Isomorphisms  i:[figure: A; B]
Natural transformations τ:\xymatrix{F \ar@{=>}[r] & G}
Cones  τ:\xymatrix{A \ar@{=>}[r] & G}

Table 1. Notation conventions

A.2. Factorization systems

This section gives a brief review of factorization systems with a special emphasis on the factorization systems of special interest here: regular epi-mono factorizations (for categories of algebras) and epi-regular mono factorizations (for categories of coalgebras). For a more thorough treatment of factorization systems, see [Bor94, Volume I] or [AHS90]. First, we review the definition of regular epi/regular mono.

Definition A.2.1. We say that a map p:\xymatrix{A \ar@{|->}[r] & B} is a regular epi if there is a pair of maps e_{1} and e_{2} such that

\xymatrix{• \ar[r]^{e_{1}} \ar[r]_{e_{2}} & A \ar@{|->}[r]^{p} & B}

is a coequalizer diagram. Dually, a regular mono is a map that is an equalizer of some pair of arrows.

Throughout, we will often use the fact that regular epis are strong, so we include a definition and proof of this connection.

Definition A.2.2. An epi e is strong just in case, whenever the square below commutes, with m mono, then there is a (necessarily unique) map d making each triangle commute.

[figure: •; e; •; d; •; m; •]

A strong mono is a mono m as in the diagram above such that, whenever the square commutes and e epi, then again there is a unique d making the triangles commute.

Theorem A.2.3. Every regular epi is strong (and, dually, every regular mono is strong).

Proof.

[figure: •; k_{1}; k_{2}; •; e; f; •; g; d; •; m; •]

Figure 1. Every regular epi is strong.

Let e be the coequalizer of k_{1}, k_{2} as shown in Figure 1 and let m be a mono making the diagram commute. Then it is easy to see that (because m is monic), f also coequalizes k_{1} and k_{2} and so there is a unique d making the upper triangle commute. The lower triangle also commutes, since e is epi. □

Definition A.2.4. A factorization system for a category C consists of a pair ⟨E, M⟩ where E and M are class of morphisms of C satisfying the following:

(1) Every isomorphism is in E and M;

(2) E and M are closed under composition;

(3) Whenever e ∈ E and m ∈ M such that the square below commutes, there is a unique d as shown, making each triangle commute.

[figure: •; e; •; d; •; m; •]

(4) For each f:\xymatrix{A \ar[r] & B} in C, there is an e:\xymatrix{A \ar[r] & C} in E and a m:\xymatrix{C \ar[r] & B} in M such that f = m ∘ e (as shown below).

[figure: A; f; e; B; C; m]

A.2. FACTORIZATION SYSTEMS 211

Note that our definition of factorization system does not require that E be a subclass of the epis of C or that M be a subclass of the monos. Nonetheless, the common examples of factorization systems do have this property, and certainly the factorization systems in which we are interested are no exception.

Theorem A.2.5. Let ⟨E, M⟩ be a factorization system for C. Factorizations f = m ∘ e, where e ∈ E and m ∈ M, are unique up to isomorphism.

Proof. If m∘e = m′ ∘e′, where e, e′ ∈ E and m, m′ ∈ M, then there are unique d, d′, as shown in Figure 2, making the triangles commute. The uniqueness part of Condition 3 from Definition A.2.4 implies that the composites d ∘ d′ and d′ ∘ d are the identity. □

[figure: A; e; e′; C; m; d; D; m′; d′; C]

Figure 2. ⟨E, M⟩-factorizations are essentially unique.

For the remainder of this section, let E_{e} denote the epis of C and M_{m} the monos. Also, let E_{re} denote the regular epis and M_{rm} the regular monos. We complete our review of factorization systems by introducing the notion of regular epi-mono factorizations and its dual, epi-regular mono factorizations. We show that, if every map factors by a regular epi followed by a mono, then ⟨E_{re}, M_{m}⟩ is a factorization system (and the dual result as well).

Definition A.2.6. Let E be a category. We say that E has regular epi-mono factorizations if every arrow f:\xymatrix{A \ar[r] & B} can be factored into a regular epi followed by a mono.

[figure: A; f; B; A/f]

The codomain of the regular epi is denoted A/f, as shown above.

Dually, we say that E has epi-regular mono factorizations if every arrow f:\xymatrix{A \ar[r] & B} can be factored into a epi followed by a regular mono.

[figure: A; f; B; Im(f)]

212 A. PRELIMINARIES

The domain of the regular mono is denoted Im(f), as shown above.

Theorem A.2.7. If E has regular epi-mono factorizations (epi-regular mono factorizations, resp.), then ⟨E_{re}, M_{m}⟩ (⟨E_{e}, M_{rm}⟩, resp.) form a factorization system.

Proof. Conditions (1) and (2) are obvious, and (4) is by hypothesis. The diagonal condition (by (3)) is just the fact that regular epis (monos, resp.) are strong. □

As we can see in the proof of Theorem A.2.7, the strong epis provide most of the properties we require. Indeed, throughout this thesis, the assumption of regular epi-mono factorizations in E^{Γ} could be largely replaced by strong epi-mono factorizations, weakening some assumptions while strengthening others in the process. We nonetheless prefer to stick with the regular epis, since in the algebraic setting, they correspond to deductively closed sets of equations. We also use epi-regular mono factorizations in E_{Γ} in keeping with the duality.

We close this section with a categorical definition of the axiom of choice.

Definition A.2.8. We say that an epi p (a mono i, resp.) splits if there is a map f such that p ∘ f = id (f ∘ i = id, resp.) Such epis (monos, resp.) are necessarily regular.

Definition A.2.9. Let E be given. We say that E satisfies the axiom of choice if every epi splits. That is, if for every epi p, there is a (necessarily monic) i such that

p ∘ i = id

.

We say that E satisfies the weak axiom of choice if every regular epi splits.

Theorem A.2.10. If E satisfies the weak axiom of choice, then every endofunctor Γ:\xymatrix{E \ar[r] & E} preserves regular epis.

Proof. Let p be a regular epi in E. Then p splits, and hence Γp splits. □

A.3. Predicates and Subobjects

We very briefly present the basic construction of the category Sub(A) and show how to define ∧ and ∨ in Sub(A). This material is not intended to be complete. In particular, we simply show the constructions here without bothering to verify that our construction of ∧ (say) really does define a meet operation. For a proper introduction in lattice theory, see [DP90], and for a discussion of the Heyting algebra Sub(A) in a topos E, see [LM92].

Let C be a category and A ∈ C. We form the category, Sub_{C}(A) or just Sub(A), as follows: Take the full subcategory of the slice category C/A consisting of the monos

[figure: P; A] .

A.3. PREDICATES AND SUBOBJECTS 213

Then, take the quotient of that subcategory by the relation ≅ that holds if two objects are isomorphic. In other words, we consider the skeleton of the category of monos into A. We call the elements of Sub(A) the subobjects of A. It is easy to see that Sub(A) is a poset.

We define the intersection of two subobjects P and Q as the pullback,

[figure: P ∧ Q; P; Q; A]

if it exists. More generally, the intersection ⋀ P_{i} of a collection of subobjects P_{i} of A is the generalized pullback of the P_{i}’s.

In a category with + and a factorization system ⟨E, M⟩, E a subclass of the epis and M a subclass of the monos, the join (or union) of two subobjects as the factorization of the induced map \xymatrix{P + Q \ar[r] & A} :

[figure: P + Q; P ∨ Q; A] .

More generally, in a category with arbitrary coproducts, one can define an infinite join, ⋁_{i} P_{i} of subobjects P_{i}.

Definition A.3.1. A category C is well-powered if each object has set-many subobjects. C is regularly well-powered if each object has set-many regular subobjects.

Dually, C is (regularly, resp.) co-well-powered if, for each object C, there are set-many (regular, resp.) epis out of C, up to isomorphism.

In a well-powered category C with pullbacks, we have a contravariant functor

Sub:\xymatrix{C^{op} \ar[r] & Poset}.

We must describe the action of Sub on arrows f:\xymatrix{A \ar[r] & B}, which we write as

f^{∗}:\xymatrix{Sub(B) \ar[r] & Sub(A)}.

Take a subobject [figure: P; B] to the object making this square a pullback:

[figure: f^{∗}(P); P; A; B]

If C has regular epi-mono factorizations, then f^{∗} has a left adjoint, denoted ∃_{f} and defined by taking the factorization shown below.

[figure: P; ∃_{f}P; A; B]

See Section 4.1 for a discussion of a right adjoint to f^{∗}.

We complete our brief review of subobjects by showing that a regularly wellpowered category is also regularly co-well-powered, given kernel pairs.

Claim A.3.2. If C has kernel pairs and is regularly well-powered, then C is regularly co-well-powered. Dually, a regularly co-well-powered category with cokernel pairs is regularly well-powered.

Proof. Assume C is finitely complete and regularly well-powered and C ∈ C. Then, we map quotients of C to regular subobjects of C × C by taking a regular epimorphism q to its kernel pair. This mapping is injective. □

A.3.1. Regular subobjects. The categories of coalgebras in which we are interested do not, in general, have regular epi-mono factorizations. Rather, they have epi-regular mono factorizations. Consequently, the corresponding category of subobjects is not well-behaved: we cannot define the join of arbitrary subcoalgebras.

If C is a category with epi-regular mono factorizations, it is natural to consider the regular subobjects of A as predicates over A. In the category RegSub_{C}(A) of regular subobjects, one can define meet, join, etc., as before and view the collection of regular subobjects as the predicates over A.

A.4. Relations

We briefly introduce the basic definitions for relations on a category. Since we are concerned with categories with finite products, for the most part, we simplify this material by assuming finite products exist whenever convenient. See [Bor94, Volume 2, Chapter 2] for a more complete discussion of this topic.

Definition A.4.1. A collection of maps \{f_{i}:\xymatrix{A \ar[r] & B_{i}}\}_{i} ∈ I are jointly monic if, whenever g, h:\xymatrix{C \ar[r] & A} satisfy, for all i ∈ I,

f_{i} ∘ g = f_{i} ∘ h

then g = h.

If I = 1, then jointly monic is just monic.

A.4. RELATIONS 215

Definition A.4.2. Let C be a category, A and B objects of C. A (binary) relation on A and B is a triple ⟨R, r_{1}, r_{2}⟩ such that

r_{1} :\xymatrix{R \ar[r] & A},
r_{2} :\xymatrix{R \ar[r] & B}

and r_{1} and r_{2} are jointly monic. This definition generalizes in the obvious way to n-ary (or I-ary) relations. A unary relation is a subobject.

If A = B, we say that ⟨R, r_{1}, r_{2}⟩ is a relation on A. Also, we often refer to a relation ⟨R, r_{1}, r_{2}⟩ by just its carrier R, if no confusion will result.

If C has finite products, then a relation ⟨R, r_{1}, r_{2}⟩ on A and B is just a subobject ⟨R, ⟨r_{1}, r_{2}⟩⟩ of A × B. Also, any pullback (and so, any kernel pair) is a relation. In particular, Δ_{A} = ⟨A, id_{A}, id_{A}⟩ is a relation on A (sometimes called the equality relation or the diagonal) and, more generally, given a map f:\xymatrix{A \ar[r] & B}, then ⟨A, id_{A}, f⟩ is a relation on A and B, called the graph of f (denoted graph(f)).

The category of relations on A and B forms a partial order, where ⟨R, r_{1}, r_{2}⟩ ≤ ⟨S, s_{1}, s_{2}⟩ just in case there is an arrow f:\xymatrix{R \ar[r] & S} such that

r_{1} = s_{1} ∘ f, r_{2}  = s_{2} ∘ f.

Given finite products, this ordering is just the same as the ordering on Sub(A × B), of course.

In a category C with finite products and epi-regular mono factorizations, we can define the composition of two relations easily. Namely, let ⟨R, r_{1}, r_{2}⟩ be a relation on A and B and ⟨S, s_{1}, s_{2}⟩ a relation on B and C. Take the pullback shown in Figure 3. In general, this will not be a relation, so take the regular epi-mono factorization of

\xymatrix{P \ar[r] & A × C}.

\xymatrix{ &  & • \ar[dl]_{t_{1}} \ar[dr]^{t_{2}} \\  & R \ar[dl]_{r_{1}} \ar[dr]^{r_{2}} &  & S \ar[dl]_{s_{1}} \ar[dr]^{s_{2}} \\ A &  & B &  & C}

Figure 3. Composition of relations

If R is any relation on A, we say that R is reflexive if Δ ≤ R.

Given any relation ⟨R, r_{1}, r_{2}⟩, the triple ⟨R, r_{2}, r_{1}⟩ is also a relation, called the opposite relation of R and denoted R^{0}. We say that R is symmetric if R^{0} ≤ R.

216 A. PRELIMINARIES

Because −^{0} is monotone and (R^{0})^{0} = R, we have that a relation R is symmetric iff R^{0} = R.

A relation R on A is said to be transitive if R ∘ R ≤ R. If R is reflexive, then R ≤ R ∘ R. Thus, if R is reflexive, then R is transitive iff R ∘ R = R.

Definition A.4.3. A relation R on A is an equivalence relation if it is reflexive, symmetric and transitive.

Notice that a kernel pair of an arrow is always an equivalence relation. We say that an equivalence relation is effective if it is the kernel pair of its coequalizer.

[figure: Δ_{A}; id; id; R; r_{1}; r_{2}; R^{0}; r_{1}; r_{2}; R; r_{1}; r_{2}; R ∘ R; r_{2}∘t_{2}; r_{1}∘t_{1}; R; r_{1}; r_{2}; A; A; A]

Figure 4. The defining conditions for equivalence relations.

The equality relation Δ is an effective equivalence relation, and is obviously the least equivalence relation. Also, in Set, for instance, every equivalence relation is effective.

Definition A.4.4. A category C is regular if it satisfies the following: • Every arrow has a kernel pair.

• Every kernel pair has a coequalizer.

• The pullback of a regular epi is a regular epi (regular epis are stable under

pullbacks. A regular category in which all equivalence relations are effective is called exact.

A.5. Monads and comonads

This section is a brief reminder of the basic definition of monad and how a pair of adjoint functors give rise to a monad. See any basic text on category theory for more details. We take this material largely from [BW85, Bor94].

Definition A.5.1. A monad (also called a triple) is an ordered triple 𝕋 = ⟨T, η, μ⟩ where

T:\xymatrix{C \ar[r] & C}

is an endofunctor,

η:\xymatrix{1_{C} \ar@{=>}[r] & T} and
μ:\xymatrix{T^{2} \ar@{=>}[r] & T}

are natural transformations such that the following diagrams commute.

\xymatrix{T^{3} \ar@{=>}[r]^{μ_{T}} \ar@{=>}[d]_{T μ} & T^{2} \ar@{=>}[d]^{μ} & T \ar@{=>}[r]^{η_{T}} & T^{2} \ar@{=>}[d]^{μ} & T \ar@{=>}[l]_{T η} \\ T^{2} \ar@{=>}[r]_{μ} & T &  & T}

The first diagram is called the associativity condition and the second the unit condition.

Rather than give explicit examples of monads, let us show how any adjoint pair gives rise to a monad. In Section 2.1, we state the Eilenberg-Moore theorem showing that every monad arises from an adjoint pair. In fact, it arises from (at least) two different pairs of adjoints, but we will not discuss the Kleisli construction. See any of [Bor94, Lan71, BW85] for a more thorough development of this topic.

Let L:\xymatrix{C \ar[r] & D} and R:\xymatrix{D \ar[r] & C} be given, with L ⊣ R. Let η:\xymatrix{id_{C} \ar@{=>}[r] & RL} and ε:\xymatrix{LR \ar@{=>}[r] & id_{D}} be the unit and counit of the adjunction, respectively. It is easy to show that

⟨RL, η, Rε_{L}⟩

is a monad on C. The associativity condition

\xymatrix{RLRLRL \ar@{=>}[r]^{Rε_{LRL}} \ar@{=>}[d]_{RLRε_{L}} & RLRL \ar@{=>}[d]^{Rε_{L}} \\ RLRL \ar@{=>}[r]_{Rε_{L}} & RL}

holds just by the naturality of ε. The unit condition

\xymatrix{RL \ar@{=>}[r]^{η_{RL}} & RLRL \ar@{=>}[d]^{Rε_{L}} & RL \ar@{=>}[l]_{RLη} \\  & RL}

holds just because of the identities

η_{R} ∘ Rε = id_{C} and
Lη ∘ ε_{L} = id_{D} .

A comonad in C is a monad in C^{op}. We state the definition explicitly, nonetheless, since comonads play such an important role for categories of coalgebras.

Definition A.5.2. A comonad (also called a cotriple) is a triple 𝔾 = ⟨G, ε, δ⟩ where G:\xymatrix{C \ar[r] & C} is a functor and

ε:\xymatrix{G \ar@{=>}[r] & id_{C}} and
δ:\xymatrix{G \ar@{=>}[r] & G^{2}}

are natural transformations such that the following diagrams commute.

[figure: G^{3}; G^{2}; δ_{G}; G; G^{2}; ε_{G}; Gε; G^{2}; G^{2}; Gδ; G; δ; δ; G; δ]

One sees, by duality, that an adjoint pair also gives rise to a comonad. Explicitly, let L ⊣ R, with unit η and counit ε. Then one easily shows that

⟨LR, ε, LηR⟩

is a comonad.

Example A.5.3. Consider the adjoint pair

U:\xymatrix{Grp \ar[r] & Set} and
F:\xymatrix{Set \ar[r] & Grp},

where U takes a group to its underlying set and F takes a set to the free group on that set. We have that F ⊣ U. This yields a familiar monad on Set, ⟨UF, η, μ⟩. The unit of the monad,

η:\xymatrix{id_{Set} \ar@{=>}[r] & UF} ,

is the insertion of generators \xymatrix{X \ar[r] & UF X} . The multiplication is a natural transformation

μ:\xymatrix{UF UF \ar@{=>}[r] & UF} .

It can be described componentwise as follows: Given a set X, UF X is the set of group terms over X, which we can regard as finite strings over X. The set UF UF X, then, is the collection of group terms taking elements of UF X as variables. Thus, UF UF X is the collection of finite strings over the “alphabet” UF X. The multiplication μ_{X} takes such a string and concatenates its elements, yielding a string over X.

The comonad ⟨F U, ε, δ⟩ over Grp can be easily described too, although it may seem less familiar. The functor part of the comonad takes a group G to the free group over UG. The counit

ε_{G}:\xymatrix{F UG \ar[r] & G}

takes a term over G and multiplies it using the multiplication of G. The comultiplication

δ_{G}:\xymatrix{F UG \ar[r] & F UF UG}

is given by F η_{UG}, where η is the insertion of generators described above. Thus, it is the group homomorphism extending this insertion to all of F UG.

Bibliography

[Acz88] P. Aczel, Non-well-founded sets, CSLI Lecture Notes, vol. 14, Stanford University, 1988. [Adá01] Jiří Adámek, Final coalgebras are ideal completions of initial algebras, Journal of Logic

and Computation (2001), To appear.

[AGM92] S. Abramsky, Dov M. Gabbay, and T. S. E Maibaum (eds.), Handbook of logic in computer science, vol. 1, Oxford Science Publications, 1992.

[AH00] Steve Awodey and Jesse Hughes, The coalgebraic dual of Birkhoff’s variety theorem, Tech. Report CMU-PHIL-109, Carnegie Mellon University, Pittsburgh, PA, 15213, November 2000.

[AHS90] J. Adámek, H. Herrlich, and G. E. Strecker, Abstract and concrete categories, Wiley Interscience, 1990.

[AM89] Peter Aczel and Nax Mendler, A final coalgebra theorem, Category Theory and Computer Science, Lecture Notes in Computer Science, Vol. 389 (D. H. Pitt, D. E. Rydeheard, P. Dybjer, A. M. Pitts, and A. Poigne, eds.), Lecture Notes in Computer Science, vol. 389, Springer-Verlag, 1989.

[AN78] H. Andréka and I. Németi, Loś lemma holds in every category, Studia Sci. Math. Hungar. 13 (1978), 361–376.

[AN79a] H. Andréka and I. Németi, Formulas and ultraproducts in categories, Beitrage zur Algebra und Geometrie 8 (1979), 133–151.

[AN79b] H. Andréka and I. Németi, Injectivity in categories to represent all first order formulas, Demonstratio Mathematica 12 (1979), 717–732.

[AN81a] H. Andréka and I. Németi, Cone-implicational subcategories and some birkhoff-type theorems, Universal Algebra (Proc. Coll. Esztergom 1977), Colloq. Math. Soc. J. Bolyai, vol. 29, 1981, pp. 535–578.

[AN81b] H. Andréka and I. Németi, A general axiomatizability theorem formulated in terms of cone-injective subcategories, Universal Algebra (Proc. Coll. Esztergom 1977), Colloq. Math. Soc. J. Bolyai, vol. 29, North–Holland, Amsterdam, 1981, pp. 13–35.

[AN83] H. Andréka and I. Németi, Generalization of variety and quasivariety concept to partial algebras through category theory, Dissertationes Mathematicae (Rozprawy Math.) (1983).

[AP01] Jiří Adámek and Hans-E. Porst, From varieties of algebras to covarieties of coalgebras, In Corradini et al. [CLM01].

[AR94] Jiří Adámek and Jiří Rosický, Locally presentable and accessible categories, London Mathematical Society Lecture Note Series, vol. 189, Cambridge University Press, 1994.

[Bar92] Michael Barr, Algebraically compact functors, Journal for Pure and Applied Algebra 82 (1992), 211–231.

[Bar93] M. Barr, Terminal coalgebras in well-founded set theory, Theoretical Comp. Sci. 114 (1993), 299–315.

[Bec67] J.M. Beck, Triples, algebras, and cohomology, Ph.D. thesis, Columbia University, 1967.

[BH76] B. Banaschewski and H. Herrlich, Subcategories defined by implications, Houston Journal of Mathematics 2 (1976), no. 2.

[Bir35] G. Birkhoff, On the structure of abstract algebras, Proceedings of the Cambridge Philosophical Society 31 (1935), 433–454.

[Bir44] G. Birkhoff, Subdirect unions in universal algebra, Bulletin of the American Mathematical Society 50 (1944), 764 – 768.

[BM96] Jon Barwise and Lawrence Moss, Vicious circles, CSLI Lecture Notes, vol. 60, Stanford University, 1996.

[Bor94] F. Borceux, Handbook of categorical algebra I-III, Cambridge University Press, 1994.

[But98] Carsten Butz, Regular categories and regular logic, BRICS LS-98-2, October 1998, Course notes, 35 pp.

[BW82] Stephen Bloom and Jesse B. Wright, Finitary quasi-varieties, Journal of Pure and Applied Algebra 25 (1982), 121–154.

[BW85] Michael Barr and Charles Wells, Toposes, triples and theories, Grundlehren der maathematischen Wisenschaften, vol. 278, Springer-Verlag New York, 1985.

[Che80] Brian F. Chellas, Modal logic: An introduction, Cambridge University Press, 1980. [Cîr00] Corina Cîrstea, An algebra-coalgebra framework for system specification, In Reichel

[Rei00], pp. 81–112.

[CLM01] A. Corradini, M. Lenisa, and U. Montanari (eds.), Electronic notes in theoretical computer science, vol. 44, Coalgebraic Methods in Computer Science (CMCS’2001), 2001.

[Coc93] J. R. B. Cockett, Introduction to distributive categories, Mathematical Structures in Computer Science 3 (1993), no. 3, 277–307.

[Cro93] Roy L. Crole, Categories for types, Cambridge University Press, 1993.

[DP90] B. A. Davey and Hilary Priestley, Introduction to lattices and order, Cambridge University Press, Cambridge, 1990.

[EM65] S. Eilenberg and J. C. Moore, Adjoint functors and triples, Illinois Journal of Mathematics 9 (1965), 381–398.

[FS79] M. P. Fourman and D. S. Scott, Sheaves and logic, Applications of Sheaf Theory to Algebra, Analysis, and Topology (M. P. Fourman, C. J. Mulvey, and D. S. Scott, eds.), Lecture Notes in Mathematics, Springer-Verlag, 1979.

[FS90] P. Freyd and A. Scedrov, Categories, allegories, North-Holland, Amsterdam, 1990.

[GHS01] H. Peter Gumm, Jesse Hughes, and Tobias Schröder, Distributivity of categories of coalgebras, FG Informatik 25, Philipps-Universität Marburg, 2001.

[Gol99] Robert Goldblatt, What is the coalgebraic analogue of Birkhoff’s Variety Theorem?,

         Available at http://www.mcs.vuw.ac.nz/~rob/, December 1999.

[Grä68] George Grätzer, Universal algebra, D. Van Nostrand Company, Inc., 1968.

[GS98] H. Peter Gumm and Tobias Schröder, Covarieties and complete covarieties, In Jacobs et al. [JMRR98], pp. 43–56.

[GS01] H. Peter Gumm and Tobias Schröder, Products of coalgebras, Algebra Universalis (2001), To appear.

[Gum98] H. Peter Gumm, Equational and implicational classes of coalgebras, 1998, Extended Abstract submitted for RelMiCS’4.

[Gum99] H. Peter Gumm, Elements of the general theory of coalgebras, LUATCS’99, Rand Africaans University, Johannesburg, South Africa. Available at http://proof.mth.uct.

         ac.za/~pjipsen/luatcs99/, 1999.

[Gum01a] H. Peter Gumm, Birkhoff’s variety theorem for coalgebras, Contributions to General Algebra 2000 (2001), To appear.

[Gum01b] H. Peter Gumm, Functors for coalgebras, Algebra Universalis (2001), To appear.

[HC68] G. Hughes and M. Cresswell, An introduction to modal logic, Methuen, London, 1968.

[HJ99] Ulrich Hensel and Bart Jacobs, Coalgebraic theories of sequences in PVS, Journal of Logic and Computation 9 (1999), no. 4, 463–500.

[Hug00] Jesse Hughes, The coalgebraic analogue of Birkhoff’s variety theorem (abstract), Bulletin of Symbolic Logic, June 2000, Abstract for talk delivered at 1999–2000 Winter Meeting of the ASL, Washington, DC.

[Hug01] Jesse Hughes, Modal operators for coequations, In Corradini et al. [CLM01].

[Jac95] B. Jacobs, Mongruences and cofree coalgebras, Lecture Notes in Computer Science 936 (1995).

[Jac99] B.P.F. Jacobs, The temporal logic of coalgebras via Galois algebras, Tech. Report CSI-R9906, Computing Science Institute, April 1999.

[Jac00] Bart Jacobs, Towards a duality result in the modal logic of coalgebras, In Reichel [Rei00], pp. 163–198.

[JMRR98] Bart Jacobs, Larry Moss, Horst Reichel, and Jan Rutten (eds.), Electronic notes in theoretical computer science, vol. 11, Coalgebraic Methods in Computer Science (CMCS’1998), 1998.

[JPT^{+}98] Peter Johnstone, John Power, Toru Tsujishita, Hiroshi Watanabe, and James Worrell,

The structure of categories of coalgebras, August 1998.

[JR97] Bart Jacobs and Jan Rutten, A tutorial on (co)algebras and (co)induction, Bulletin of the European Association for Theoretical Computer Science 62 (1997).

[JR99] Bart Jacobs and Jan Rutten (eds.), Electronic notes in theoretical computer science, vol. 19, Coalgebraic Methods in Computer Science (CMCS’1999), 1999.

[Kle65] H. Kleisli, Every standard construction is induced by a pair of adjoint functors, Proceedings of the American Mathematical Society 16 (1965), 544–546.

[Kur99] Alexander Kurz, Modal rules are co-implications, Draft. Available at http://helios.

         pst.informatik.uni-muenchen.de/~kurz, February 1999.

[Kur00] Alexander Kurz, Logics for coalgebras and applications for computer science, Ph.D. thesis, Ludwig-Maximilians-Universität München, 2000.

[Lam70] Joachim Lambek, Sub equalizers, Canadian Mathematical Bulletin 13 (1970).

[Lan71] S. Mac Lane, Categories for the working mathematician, Graduate Texts in Mathematics, Springer-Verlag, 1971.

[Law63] Bill Lawvere, Functorial semantics of algebraic theories, Proceedings of the National Academy of Sciences of the United States of America 50 (1963).

[LM92] Saunders Mac Lane and Ieke Moerdijk, Sheaves in geometry and logic: a first introduction to topos theory, Universitext, Springer-Verlag, 1992.

[LS86] J. Lambek and P. J. Scott, Introduction to higher order categorical logic, Cambridge University Press, 1986.

[Man76] Ernie Manes, Algebraic theories, Graduate Texts in Mathematics, no. 26, Springer-Verlag, 1976.

[Maš01] Dragan Mašulović, Invariants of monadic coalgebras, In Corradini et al. [CLM01].

[Mos99] Lawrence S. Moss, Coalgebraic logic, Annals of Pure and Applied Logic 96 (1999), 277– 317.

[MT92] K. Meinke and J. V. Tucker, Universal algebra, In Abramsky et al. [AGM92], pp. 189– 412.

[Ném82] I. Németi, On notions of factorizations systems and their applications to cone-injective

subcategories, Periodica Mathematica Hungarica 13 (1982), no. 3, 229–235.

[PZ01] Erik Poll and Jan Zwanenburg, From algebras and coalgebras to dialgebras, In Corradini et al. [CLM01].

[Rei00] H. Reichel (ed.), Electronic notes in theoretical computer science, vol. 33, Coalgebraic Methods in Computer Science (CMCS’2000), 2000.

[Rob94] Edmund Robinson, Variations on algebra: Monadicity and generalisations of equational theories, 1994.

[Roş01] Grigore Roşu, Equational axiomatizability for coalgebra, Theoretical Computer Science

260 (2001), Scheduled to appear.

[RTJ01] J. Rothe, H. Tews, and B. Jacobs, The coalgebraic class specification language ccsl, Journal of Universal Computer Science (JUCS) 7 (2001), no. 2, 175–193.

[Rut96] J.J.M.M. Rutten, Universal coalgebra: a theory of systems, Tech. Report CS-R9652, Centrum voor Wiskunde en Informatica, 1996.

[Tay99] Paul Taylor, Practical foundations of mathematics, Cambridge University Press, 1999.

[Tur96] Daniele Turi, Functorial operational semantics and its denotational dual, Ph.D. thesis, Free University, Amsterdam, June 1996.

[vK01] Burghard von Karger, Temporal algebra, Mathematical Structures in Computer Science (2001), To appear.

[Wor98] James Worrell, Toposes of coalgebras and hidden algebras, In Jacobs et al. [JMRR98].

[Wor00] James Worrell, Terminal sequences for accessible endofunctors, A chapter of Worrell’s dissertation, 2000.

Index

absolute coequalizer, 55 accessibility relation, 71 algebra

– for a monad, 48–51

– for an endofunctor, 7 coequalizers of –, 78 colimits of –, 19–22, 77–89 coproducts of –, 89 final, 32 free, 47, 51–53, 115, 133 homomorphism, 7 initial, 32–40, 45–46 limits of –, 16–18 minimal, 40 universal, 10–11, 36–37, 39

almost co-regular, 21 almost regular, 21 associativity condition, 217 automata, 108, 146, 164

Beck’s theorem, 55 behavioral covariety, 168–172 Birkhoff variety, 115, 116 Birkhoff variety theorem, 122 Bisim, 91 bisimilar, 105–108, 196 bisimulation, 92, 197

total, 168–170 bounded functor, 160

carrier, 7, 8 category

almost co-regular, 21 almost regular, 21 co-Birkhoff, 141 exact, 216 extensive, 175–176 quasi-co-Birkhoff, 140, 141 regular, 216

child, 14 choice

axiom of –, 90, 92, 93, 105, 197, 212 weak axiom of –, 31, 212

closed – under codomains of epis, 141

– under coproducts, 141

– under products, 114

– under quotients, 114

– under regular subobjects, 141

– under subobjects, 114 deductively –, 136, 137

co-well-powered, 213 coalgebra

– for a comonad, 48–51, 150

– for an endofunctor, 8 cofree, 57, 58 colimits of –, 16–18 equalizers of –, 78 final, 32–34, 41–43, 45–46 homomorphism, 8 initial, 32 limits of –, 19–22, 77–89 products of –, 79–89 simple, 43–45, 106, 196

coequalizer absolute, 55 split, 55

coequation, 140, 143–145, 149, 162, 166, 171,

198, 200, 201, 203 conditional, 149–153 conditional –, 149, 150, 152, 199, 200, 206 endo-invariant, 162–168 generating –, 163

cofree, 57 cofree coalgebra, 57, 58 coinduction, 43–45, 105–107, 195–197 coloring, 57 comonad, 217 comonadic, 59 complete Heyting algebra, 72 congruence, 29–32 conjunct covering, 154 conjunct representation, 155 conjunctly irreducible, 154 conjunctly presentable, 155 constructibly equivalent, 173 context, 181 corecursion, 41–43 cotriple, 217 covarietor, 59 covariety, 141

behavioral, 168–172

deductively closed, 136, 137 diagonal, 215 distributive, 155

E^{Γ}, 8 colimits in –, 19–22, 77–89 coproducts in –, 89 limits in –, 16–18

E_{Γ}, 8 colimits in –, 16–18 equalizers in –, 78 limits in –, 19–22, 77–89 products in –, 79–89

Eilenberg-Moore theorem, 49 elementary variety, 173 endomorphism-invariant, 162–168 endomorphism-stable, 136 epi

– splits, 212

regular, 209 epi-regular mono factorizations, 211 ε^{V}, 121 equality, 215 equation, 115, 117–119, 134 equational domain, 127 equational variety, 115, 118 equivalence relation, 216

effective –, 216 η^{V}, 119 exact

category, 216

sequence, 22 extensive, 155

F^{V}, 119 factorization system, 209–212

epi-regular mono, 211

regular epi-mono, 211

regular epi-regular mono, 177

strong epi-mono, 212 filter, 15 final, 32 finitely presentable, 128 fixed points, 32–34, 117, 139 forgetful functor, 8 foundation

axiom of, 40 free algebra, 47, 51, 52, 115, 133 functor

– creates colimits, 17

– creates limits, 17

– nearly preserves pullbacks, 176

– preserves colimits, 17

– preserves intersections, 74, 167

– preserves limits, 16

– preserves regular relations, 101

– reflects colimits, 17

– reflects limits, 17

bounded, 160 comonadic, 59 monadic, 55

𝔾-coalgebra, 49

Galois correspondence, 119

Γ-algebra, 7 Γ-coalgebra, 8 graph, 92, 169, 215

Heyting algebra, 69, 72, 73, 101, 103, 151, 212

complete, 72 homomorphism, 7, 8 Hughes, Quincy, iii

induction, 37–40, 53 inductive predicate, 38 initial, 32 intersection

preservation of –, 74 invariant coequation, 162–168

join, 213

jointly monic, 214

Kripke frames, 15

Kripke models, 14–15, 70–72, 77

Kripke structures, 15

Kripke-Joyal semantics, 198–200

Lambek’s lemma, 32, 33, 45

lifting functor, 36, 41

locally finitely presentable, 128

logos, 175, 177, 178 locally complete, 175, 177, 178, 180–185,

198

minimal, 38 Mod_{𝔄}(ϕ), 71 monad, 216–217 monadic, 55 mono

– splits, 212

regular, 209 Mon, 122

ℕ, 34–36, 39 \overline{ℕ}, 41 natural numbers object, 34 nearly preserves pullbacks, 176 neighborhood, 16 neighborhood filter, 16 NNO, 34 notation conventions, 209 NWF, 34

object oriented languages, 60, 146 ω, 36 \overline{ω}, 41 opposite relation, 215 orthogonality, 118–119

ℙ, 33 ⊥ (perp), 118–119, 141 pointwise semantics, 200–203 polynomial functor, 43

coalgebras for -, 76 power set functor, 33 pre-congruence, 27–29 predicates, 212–214 pullbacks

nearly preserves –, 175–177, 186

weak –, 44, 45, 93, 102, 108, 196

quasi-Birkhoff variety, 116 quasi-co-Birkhoff category, 140 quasi-covariety, 141 quasi-variety, 116, 119–122 quasi-variety theorem, 119

recursion, 34–37, 53 reflexive, 215 RegSub, 63 RegSub, 214 regular

category, 216

epi, 209

mono, 209 regular co-relation, 104 regular epi-mono factorizations, 211 regular epi-reflective, 119 regular n-ary relation, 109 regular relation, 90, 92, 99, 101–103 regularly co-well-powered, 213 regularly well-powered, 213 relation, 214–216

preserves regular -, 101

regular –, 90, 92, 99, 101–103 retractable presentation, 129 retractably presentable, 130

Sat, 135 SET, 33

non-well-founded, 34 well-founded, 34, 39–40

Set

quasi-varieties in, 122 S4, 69, 100 S4, 47, 69, 110, 164, 165, 190, 199 Σ-algebra, 10 signature, 10 specification

coalgebraic, 60

coalgebraic, 146, 148 split coequalizer, 55 stable, 136, 140

– under pullbacks, 216 streams, 13–14, 42–43, 107 finite, 11–12, 37, 39 infinite, 12–13, 41–42, 76

strong epi, 209 strong mono, 210 structure map, 7, 8 Sub, 212 SubAlg, 23–26 subalgebra, 23

generated by P, 24 subcoalgebra, 62

cogenerated by P, 64, 69 generated by P, 73, 77 subdirectly irreducible, 154 subobject classifier, 179–180 subobjects, 212–214 closed under α, 38 successor functor, 34, 41 symmetric, 215

𝕋-algebra, 48 T^{V}, 121 terminal, 32 Top, 15–16 total bisimulation, 168–170 total relation, 168 transitive, 216 trees, 14, 36–37, 39, 43, 107

well-founded, 39 triple, 216

U, 8, 18

creates (co)limits, 18 U^{V}, 119 uniformly Birkhoff, 127 uniformly co-Birkhoff, 153 union, 213 unit condition, 217

valid, 183 varietor, 56 variety, 115, 116

Birkhoff, 116

Birkhoff –, 115

elementary –, 173

equational –, 115

quasi-Birkhoff –, 116

weak pullbacks, 44, 45, 93, 102, 108, 196 well-founded, 39–40 well-pointed, 159 well-powered, 213 WF, 34