# Modal Predicates and CoequationsAcademic research paper on "Computer and information sciences" CC BY-NC-ND 0 0
Share paper
OECD Field of science
Keywords
{}

## Abstract of research paper on Computer and information sciences, author of scientific article — Alexander Kurz, Jiří Rosický

Abstract We show how coalgebras can be presented by operations and equations. This is a special case of Linton's approach to algebras over a general base category X , namely where X is taken as the dual of sets. Since the resulting equations generalise coalgebraic coequations to situations without cofree coalgebras, we call them coequations. We prove a general co-Birkhoff theorem describing covarieties of coalgebras by means of coequations. We argue that the resulting coequational logic generalises modal logic.

## Academic research paper on topic "Modal Predicates and Coequations"

﻿Electronic Notes in Theoretical Computer Science 65 No. 1 (2002) URL: http://www.elsevier.nl/locate/entcs/volume65.html 20 pages

Modal Predicates and Coequations

Alexander Kurz 1 'z CWI

P.O. Box 94 079, 1090 GB Amsterdam The Netherlands

Jin Rosicky 3

Masaryk University Janackovo nam. 2a, 662 95 Brno Czech Republic

Abstract

We show how coalgebras can be presented by operations and equations. This is a special case of Linton's approach to algebras over a general base category ^, namely where ^ is taken as the dual of sets. Since the resulting equations generalise coalgebraic coequations to situations without cofree coalgebras, we call them coequations. We prove a general co-Birkhoff theorem describing covarieties of coalgebras by means of coequations. We argue that the resulting coequational logic generalises modal logic.

Introduction

Let us start with recalling that universal algebras are defined as sets equipped with operations subjected to equations. Operations can be infinitary. Given a set X, a mapping f : AX ^ A is an X-ary operation on a set A. One is often working with Y-tuples fy : AX ^ A, y E Y, of X-ary operations on a set A. These Y-tuples uniquely correspond to mappings f : AX ^ AY. Starting with a set of operations one always has free algebras. But there are important examples of universal algebras given by a class of operations which still have free algebras (complete semilattices, compact Hausdorff spaces). Linton

1 Partially supported by the Ministry of Education of the Czech Republic under the project MSM 143100009.

2 Email: kurz@cwi.nl

3 Supported by the Grant Agency of the Czech Republic under the grant 201/01/0148.

4 Email: rosicky@math.muni.cz

showed in  that equationally defined universal algebras are, under the existence of free algebras, precisely the monadic categories over Set. Moreover, in , he generalised the result from sets to any base category X. In that work, operations are still mappings

where A, X, and Y are objects in * and AX is the set of all morphisms X ^ A. Note that, in Set, AX coincides with the X-fold product of A. In general, however, it is important to consider AX as a set of morphisms because the other approach would be too special for a general base category X. In particular, it would be too special for X = Setop. Davis  used Linton's approach for introducing universal coalgebras over Set even without assuming the existence of cofree coalgebras (i.e., free algebras over Setop). The second author then considered Linton's algebras over a general base category, without the existence of free algebras, in .

There is another way of defining universal algebras over a general base category. One starts with an endofunctor F : X ^ X and defines F-algebras as objects A equipped with a morphism a : FA ^ A. These algebras are called F-dynamics in Manes  and were extensively studied by Trnkova and her students in Prague (cf. ). Notably, Reiterman  compared F-algebras with algebras given by operations and equations.

There is a revived interest in universal coalgebra motivated by its connections with the theory of systems (see ). Coalgebras are here understood as F-algebras over X = Setop, i.e., as sets A equipped with a mapping a : A ^ FA where F : Set ^ Set. Our aim is to show the potential of defining coalgebras by means of operations and equations (Section 2). Our equations for coalgebras dualise equations for algebras and generalise previous concepts of coalgebraic coequations (cf. [24,8,12,10]) to situations without cofree coalgebras. We prove a general co-Birkhoff theorem showing that covarieties of coalgebras are always definable by coequations (Section 3) and we present a full explanation of Davis's characterisation of coequational categories (Section 4). Finally, we show that the dual of operations f : AX ^ AY are modal predicates, i.e., predicates that are invariant under bisimulation. This gives rise to general notions of modal predicate and modal operator and shows that our coequational logic is a generalised modal logic (Section 5).

We work in Godel-Bernays set theory with the axiom of choice for classes. It means that all proper classes are isomorphic, in particular to the class Ord of all ordinals. Categories are assumed to be locally small, which means that they have a class of objects and sets of morphisms between any two given objects. Occasionally we encounter categories which do not satisfy this requirement and we call them illegitimate.

1 Preliminaries

Given an endofunctor F : X ^ X, a F-coalgebra A = (A,a) consists of an object A E X and an arrow a : A ^ FA. F-coalgebras form a category Coalg(F) where a F-morphism f : (A, a) ^ (B, f3) is an arrow f : A ^ B eX such that Ff o a = f3 o f:

B-- FB

The forgetful functor U : Coalg(F) — X maps a coalgebra (A, a) to A and a morphism f : (A, a) — (B,fl) to the arrow f : A — B in X. U creates and hence preserves colimits.

Set denotes the category of sets and functions and P : Set — Set the covariant powerset functor. 5 We also use the convention 2 = {0,1} and call the elements of 2 truth values.

Given A,X E X, the set of arrows A — X is denoted by XA. For f : X — Y, the function fA : XA — YA is defined as f A(g : A — X) = f o g. For f : A — B, the function Xf : XB — XA is defined as Xf (g : B — X) = g o f. 6 The assignment — — X- gives rise to a functor X- : Xop — Set. We write XU for the functor Aop — Set obtained from composing U : A — X and X- : Xop — Set.

A concrete category is a faithful functor U : K — Set. A functor F : K — K' is a concrete functor between the concrete categories U : K — Set and U : K' — Set iff U'F = U. Concrete categories are isomorphic if the isomorphisms are concrete functors. In case that K has coproducts, a covariety in K is a full subcategory which is closed under coproducts, subobjects and quotients. 7

A measurable cardinal k is a cardinal on which a non-principal K-complete ultrafilter exists. An ultrafilter is K-complete if it is closed under intersections of cardinality < k and it is non-principal if it does not contain a singleton-set.

Each category of coalgebras comes equipped with a notion of bisimulation or, as we prefer to call it, behavioural equivalence. There are different but equivalent ways to define this notion, the following one seems to be ap-

5 PX = {Y | Y C X} and P(f : X ^ X') : PX ^ PX', X D Y ^ {f (y) | y e Y}.

6 For instance, with X = Set, 2A is the set of subsets of A and 2f : 2B ^ 2A is the inverse-image-map of f : A ^ B.

7 We say that B is a subobject of A if there is f : B ^ A such that Uf is injective; B is a quotient of A if there is f : A ^ B such that Uf is surjective.

propriate in our setting (in the case X = Set). It formalises the idea that behavioural equivalence is the smallest equivalence relation that is invariant under coalgebra morphisms, see . We define two notions, the second one taking 'colourings' into account: Given C, a colouring v for a coalgebra A is an arrow UA ^ C. Instead of U : Coalg(F) ^ Set, we only require a functor U : A ^ Set in our definition of behavioural equivalence.

Definition 1.1 (Behavioural Equivalence) Consider a functor U : A ^ Set and C E Set. In the following A, B range over A, v,w over valuations UA ^ C, UB ^ C, respectively, and a,b over elements of UA,UB, respectively, and f over morphisms A ^ B.

(i) — is the equivalence relation generated by all

(A, a) - (B, Uf(a)).

(ii) —c is the equivalence relation generated by all

(A, w ◦ Uf, a) -c (B,w,Uf(a)).

If (A,a) — (B,b) we say that a and b are behaviourally equivalent. If (A,v,a) —c (B,w,b) we say that a and b are C-behaviourally equivalent.

Remark 1.2

(i) In case that A = Coalg(F) and F preserves weak pullbacks, (A,a) — (B,b) iff a and b are related by a bisimulation in the sense of Aczel and Mendler .

(ii) In particular, in case of Coalg(P), behavioural equivalence is the familiar bisimulation between (unlabelled) transition systems.

The following gives an alternative characterisation of behavioural equivalence.

Proposition 1.3 Suppose U : A ^ Set creates colimits. (Al,vl,al) —c (A2,v2,a2) iff there are B, w and morphisms fi : Ai ^ B such that

w X (1)

U Ai 1 Ufi

commutes and (Uf1)(a1) = (Uf2)(a2).

Proof Let ~ denote the relation defined by condition (1). œ C ^ is immediate. For the converse, note that ~ contains the generating pairs of ~ and is reflexive and symmetric. ~ is transitive, since A has pushouts and U preserves these. □

2 Coequational Categories

As we have explained in the introduction, coalgebras can be introduced as sets A equipped with operations

f : xa ^ ya

where X, Y are sets and XA denotes the set of all mappings A ^ X (because Xa in Set is AX in Setop).

Definition 2.1 (Coalgebras for a signature) A signature E is a class of operation symbols a each equipped with a pair (X, Y) of sets. We call a a (X,Y)-ary operation symbol. A E-coalgebra A is a set A together with mappings

aA : Xa ^ Ya

for each (X,Y)-ary operation symbol a E E. A homomorphism of E-coalgebras is defined as a mapping h : A ^ B such that the following square commutes

X a aa ( Y a

Xb ab | yb

for all a in E. The resulting (illegitimate) category of coalgebras is denoted by Coalg(E).

Remark 2.2 If E consists of a single (X,Y)-ary operation symbol a then Coalg(E) = Coalg(Y(x )). (It generalises the presentation of topological spaces together with open continuous maps as coalgebras, see .) Hence, for a set E of operation symbols, Coalg(E) = Coalg(F) for some functor F : Set ^ Set (by taking a coproduct of (Yx )'s).

As usual, a signature E gives rise to terms. Terms are also equipped with arities and defined as follows:

(i) every (X, Y)-ary operation symbol is an (X, Y)-ary term,

(ii) every mapping f : X ^ Y determines an (X,Y)-ary term Xf,

(iii) having an (X, Y)-ary term tl and an (Y, Z)-ary term t2, we get an (X, Z)-ary term t2 • tl.

For each (X, Y)-ary term t and a E-coalgebra A we get the mapping

tA : Xa ^ Ya

as follows:

(ii) (xf )A(v) = f o v for v : A ^ X,

(iii) (t2 • t1)a = (t2)a o (t1)a.

We can now define coequations:

Definition 2.3 (Coequations) A coequation is a pair (t1,t2) of (X,Y)-ary terms. We vjrite t1 = t2. A Y-coalgebra A satisfies this coequation iff (t1)A = (t2)a.

A coequational theory E is a class of coequations. The category of all Y-coalgebras satisfying all coequations from E is denoted by Coalg(E). It might be an illegitimate category. We are interested in legitimate categories Coalg(E). Each such category is equipped with a forgetful functor U : Coalg(Y) — Set and thus it is a concrete category.

Definition 2.4 (Coequational category) A concrete category will be called coequational if it is isomorphic to Coalg(E) for some coequational theory E.

We show that Coalg(F) is always coequational. This result is due to Re-iterman. His paper , p. 62, formulates it, without proof, over Setop only (i.e. for algebras over Set) and thus we present Reiterman's proof sent to the second author in the late 70s.

Proposition 2.5 (Reiterman) Let F : Set — Set be a functor. Then Coalg(F) is coequational.

Proof Let Y be a signature consisting of (X, FX)-ary operation symbols jX for every set X and let E consist of coequations

jY • Xf = xFf • jX (2)

for every mapping f : X — Y. There is a functor G : Coalg(F) — Coalg(E) given as follows: For A = (A, a), G(A) is the E-coalgebra (a,jxa) where

jxa(v) = Fv o a

for v : A — X. On the other hand there is a functor H : Coalg(E) — Coalg(F) sending an E-coalgebra A = (a,jx ) to the F-coalgebra (a,ja (idA)).

We have HG = Id because, for each F-coalgebra A = (A, a) we have ac;A (idA) = FidA o a = a. Conversely, GH = Id because, for each E-coalgebra A = (AjX), we have GHA = G(A, ja(ida)) = (A, F(—) o j£(ida)) which equals (a,jx) because for all v : A — X

Aa-(fa)a

(xv )A

XA (FA)A

commutes (due to the coequation aX • xv = xFv • aA) and thus Fv o aA(idA) = aX (v o idA) = aX (v). □

A disadvantage of the just described procedure is that one needs a proper class of operation symbols. Let (M) denote the following set-theoretic statement (see ).

(M) There do not exist arbitrarily large measurable cardinals.

Proposition 2.6 Assume (M) and let F : Set ^ Set be a functor preserving cofiltered limits. Then Coalg(F) is coequational in a signature consisting of a single operation symbol.

Proof Let P be an infinite set whose cardinality is greater than any measurable cardinal. Then the full subcategory P of Set having a single object P is codense in Set (see  A.5). Let E consist of a single (P,FP)-ary operation symbol a and E consist of coequations (2) for f : P ^ P (where a = aP). Analogously to Proposition 2.5 , we get a functor G : Coalg(F) ^ Coalg(E) and our task is to define H : Coalg(E) ^ Coalg(F). Let (A, aA) E Coalg(E). Since P is infinite, the comma-category (AjP) is cofiltered ((u,v) serves as a lower bound for u,v : A ^ P). The codensity of P means that f : A ^ P forms a limit cone to the projection Q : (AjP) ^ Set. Since F preserves cofiltered limits, Ff : FA ^ FP forms a limit cone to FQ. Coequations in E say that aA(f) : A ^ FP is a cone to FQ. Thus there is a unique mapping a : A ^ FA such that Ff o a = aA(f) for each f : A ^ P. We put HA = (A, a). The rest is analogous to Proposition 2.5. □

Remark 2.7

(i) We can assume that there are no measurable cardinals. If V is a model of ZFC in which measurable cardinals exist, let k be the smallest such. Then VK, the restriction of V to sets of rank < k, is a model of ZFC that contains no measurable cardinals.

(ii) If there are no measurable cardinals, we can take a countable set for P.

(iii) Since cofiltered limits are connected, Proposition 2.6 applies to polynomial functors F : Set ^ Set.

We have seen that categories of coalgebras for a functor are coequational. But often, one is more interested in covarieties of these categories.

Problem 2.8 Is every covariety in Coalg(F), where F : Set ^ Set, coequational? More generally, is every covariety of a coequational category coequational?

Let U : K^ Set be a functor. A U-split equaliser is an equaliser in K

A-e^ Bf C

such that its U-image splits, i.e., it is equipped with t : UC ^ UB and s : UB ^ UA such that s o Ue — id^A, t o Uf — id^B, and t o Ug — Ue o s. U creates U-split equalisers if it creates equalisers of pairs f,g for which Uf,Ug has a split equaliser in Set. Beck's theorem  says that U is comonadic iff it has a right-adjoint and creates U-split equalisers. We will say that a concrete category K is co-Beck if U creates colimits and U-split equalisers.

Proposition 2.9 Each covariety of a coequational category is co-Beck.

Proof Straightforward, cf. . □

Remark 2.10

(i) Propositions 2.5 and 2.9 also hold if we replace Set by an arbitrary category.

(ii) We can now give an easy proof of Linton's theorem , § 9, which says that coequational categories with cofree coalgebras (i.e., U has a right adjoint) coincide with comonadic categories. A proof that comonadic categories are coequational follows from Proposition 2.5. If F : Set ^ Set is a comonad with a counit e : F ^ Id and a comultiplication 5 : F ^ FF, we get comonad coalgebras by imposing the following additional coequations to (2):

xsx ' a — xidx i FX X

a • a — xSx • ox . The converse statement that coequational categories with cofree coalgebras are comonadic follows from Beck's theorem and Proposition 2.9.

3 Implicit Operations

If £ is a signature and U : Coalg(£) ^ Set the forgetful functor then each (X, Y)-ary operation symbol a E £ determines a natural transformation

So does each (X, Y)-ary term. It leads us to define (X, Y)-ary implicit operations, for every concrete category U : K — Set as natural transformations

XU — YU.

If the functor U has a right adjoint R then (X, Y)-ary implicit operations correspond to natural transformations

hom(-,RX) — hom(-,RY),

i.e., to morphisms RX ^ RY.

Definition 3.1 (Coequations in Implicit Operations) Let U : K ^ Set

be a functor and X,Y E Set. Having two (X,Y)-ary implicit operations al and a2 in K, we say that an object K eK satisfies the coequation al = a2 and write K = ai = a2 iff (ai)k = (a2)k.

Remark 3.2

(i) For a collection E of coequations in implicit operations, the full subcate-gory of all objects satisfying each coequation from E is a covariety in K (assuming that K has coproducts and that U : K ^ Set preserves them).

(ii) If U has a right adjoint and al, a2 are represented by sl,s2 : RX ^ RY, respectively, then an object K satisfies the coequation al = a2 iff every morphism h : K ^ RX is coequalised by al and a2, i.e., iff h factors through an equaliser

S-- RX =£ RY

This notion of a coequation as a subobject S of a cofree object RX is a special case of Manes , Theorem 3.4, page 227. It was further investigated in [24,8,22,12,10]. Conversely, for any subobject S ^ RX, take the cokernel pair f, g : RX ^ A and compose it with nA : A ^ RUA given by the unit n of the adjunction U H R. Then the pair nA ◦ f,nA ◦ g produces the pair of natural transformations XU ^ YU in our sense. Thus, in the presence of cofree coalgebras, our approach is equivalent to the coequations-as-subobjects-of-cofree-objects approach.

(iii) Without cofree coalgebras, there are related concepts of a coequation in  and . They are subsumed by coequations in implicit operations.

We already mentioned that a class definable by coequations in implicit operations is a covariety. We now show the converse which is a co-Birkhoff theorem not relying on the existence of cofree coalgebras. The proof uses certain implicit operations defined in terms of the behavioural equivalence relations ~x (Definition 1.1). The following proposition shows that transformations

2U that are invariant under ~x are implicit operations.

Proposition 3.3 Consider U : K ^ Set. A transformation p : XU ^ 2U is natural if for all Ai eK, vi : U Ai ^ X, ai E U Ai, (i = 1, 2)

(Al,vl,al) ^X (A2,v2,a2) ^ pai (vl)(al) = pa2 (v2)(a2)

Proof By definition, p is natural if pAi (v2 o Uf )(al) = pA2 (v2)(Uf (al)) for all f : Al ^ A2 in K, v2 : UA2 ^ X, al E UAl. Now use that (Al,v2 o Uf, al) ~x (A2,v2,Uf(al)). □

Theorem 3.4 Let E be a coequational theory. Then every covariety C in Coalg(E) is definable by coequations in implicit operations.

Proof For a set X and a E-coalgebra A, define

. vUa ^ 0Ua : X ^ 2

as follows: for v : U A ^ X and a E U A, let ^ (v)(a) = 1 iff there are C EC, u : UC ^ X, c E UC, such that (A,v,a) ~x (C,u,c), see Definition 1.1. LpX is an implicit operation by Proposition 3.3.

Consider coequations

tpX = true (3)

where true = Xf is given by the constant function f : X ^ 2,x ^ 1. Each C E C satisfies (3). Conversely, assume that A satisfies all coequations (3). Then, due to Proposition 1.3, for each a E UA, there are Ba e Coalg(£"), Ca EC, and homomorphisms fa,ga and mappings wa,ua such that

Ufa Uga

commutes and (Ufa)(a) E (Uga)(UCa). Using a multiple pushout of the fa B

fa we get

A_k B _

fa a "" Uf - Uf O ga) '

with (Uf)(UA) C U(U(fa o ga)(UCa) : a E UA}. Note that U{U(fa ◦ ga)(UCa) : a E UA} is the carrier of an E-coalgebra which is in C due to closure under coproducts and quotients. Since f is injective and C is closed under subobjects, it follows A eC. □

Remark 3.5

(i) If Coalg(E) has cofree coalgebras, the implicit operation is induced by a morphism h : RX ^ R2, U H R, or, equivalently, by a mapping h : URX ^ 2. Then, for v : UA ^ X,

vX (v) — h o Uv»

with vN : A ^ RX being the transpose of v.

(ii) Our proof works in the universe of finite sets, i.e., every covariety of finite coalgebras is given by coequations in implicit operations. This is the "Reiterman Theorem"  for coalgebras.

(iii) The just proved theorem does not mean that C is coequational. It may happen that the interpretation of the implicit operations are not forced to be the given ones. Hence the theorem does not solve Problem 2.8.

4 Davis's Theorem

We may allow signatures with (X, Y)-ary operation symbols where X and Y are classes. It leads to meta-coequational categories. Every meta-coequational category is co-Beck. Davis  proved the converse. He overstated his result by claiming that every co-Beck category is coequational, which is not true as Example 4.3 shows. The second author observed Davis's mistake in ; here we give a full explanation. First, we sketch an argument proving Davis's theorem.

Theorem 4.1 (Davis) A concrete category is meta-coequational iff it is co-Beck.

Proof Let U : C ^ Set create colimits and U-split equalisers. Let R : Class ^ Class be the density comonad of

U:C Set ^ Class.

It means that RX is the colimit of the canonical diagram (UIX) ^ Class

where eX is induced by the cone given by v's. Since Ü creates colimits, (Ü[X) is ^-filtered (= every small subcategory of (Ü[X) has an upper bound). Since the (illegitimate) category Coalg(R) of coalgebras for the comonad R is coequational over Class, it suffices to prove that the image of the comparison functor

C-- Coalg(R)

consists precisely of the R-coalgebras (X, £) with X a set. Any such coalgebra is given by a V-split equaliser

uBi : uAi *-UCi

RRX : ~ RX :-X

where 8 is the comultiplication. Since RRX and RX are given by ^-filtered colimits, this equaliser is an ^-filtered colimit of U-split equalisers in C (we are also using that U creates U-split equalisers). Since X is a set, some R-coalgebra homomorphism ci : Ci — (X,£) splits, i.e., ci o s = idx for some s : (X, £) — Ci. Hence (X, e) is isomorphic to some C-object. □

Remark 4.2 Let C be a concrete category and o : XU — YU an implicit operation where X, Y are classes. Take mappings f : X1 — X and g : Y — Y1 where X1,Y1 are sets. We get an implicit operation gU o o o fU where arities are sets. If sets are codense in classes then Y is a canonical limit of the canonical diagram (Y[Set) — Class consisting of g : Y — Y1 where Y1 is a set. Hence, the implicit operation o o fU is determined by implicit operations gU o o o fU. Moreover, since U C are sets, o is determined by implicit operations gU o o o fU. This is what Davis claimed. However, it does not mean that coequations of implicit operations whose arities are classes can be replaced by coequations of implicit operations whose arities are sets. There is a problem with compositions XU ZU YU where Z is a proper class. The precise result is Proposition 5.5 in .

As before, sets are codense in classes iff Ord is not measurable, i.e., iff each Ord-complete ultrafilter is principal. A model of such a set theory is Va where a is inaccessible but not measurable. On the other hand, in the theory of finite sets, i.e., in V^, is Ord = u measurable.

Example 4.3 Let E consist of a single (1, Ord)-ary operation symbol o. Then E-coalgebras A are sets A equipped with an operation oA : 1A — OrdA, i.e., with a mapping a : A — Ord. Homomorphisms h : (A, a) — (B,fl) are mappings h : A — B such that f3 o h = a. Coalg(E) is a (legitimate) meta-coequational category. It cannot be isomorphic to any full subcategory of Coalg(F) for any functor F : Set — Set because it contains a proper class of one-element coalgebras.

Each mapping f : Ord — m gives a (1,m)-ary term (i.e., a (1,m)-ary implicit operation) Xf • o). In fact, every implicit operation p : 1U — mU is of that kind. It suffices to take f : Ord — m given as f (p) = pP(id1) where P is the one-element E-coalgebra with oP taking the value p (see 7.2 for the easy

calculation that p = Xf • a.)

Let E1 be the collection of all (1,m)-ary operation symbols af ,f : Ord — m. E1 is not a signature because it is larger than a class. If Ord is not measurable then, following 5.5, Coalg(E) is described in E1 by coequations xg • af = agof, for f : Ord — m and g : m — k. In fact, having a E1-coalgebra (A, (af )a) satisfying these equations, we get a cone (af )a : A — m of the canonical diagram (Ord¿Set) and, therefore, the induced mapping a : A — Ord. (A, a) is the E-coalgebra determined by (A, (af )a).

If Ord is measurable, then Coalg(E) is not coequational. In fact, it is shown in 7.2 that Ord-complete ultrafilters provide one-element coalgebras living in all coequational categories containing Coalg(E).

5 Modal Predicates

This section presents an explanation of implicit operations and coequations from the point of view of modal logic. For more details on modal logic and universal coalgebra see e.g. [6,24,11,13].

We show that a predicate on Kripke frames, or more generally on coalgebras, is invariant under bisimulation iff it depends naturally on Kripke frames, i.e., iff it is an implicit operation in the sense of Section 3 (Section 5.1 and 5.2). This leads us to a general notion of modal operator as a natural operator on predicates. The coequational logic considered in Sections 2-4 then coincides with the modal logic induced by modal predicates and operators (Section 5.3).

5.1 Kripke frames

A Kripke frame A = (A, a) consists of a carrier set A and a function a : A — PA. 8 We think of a(a) as the set of successors of a. Given a set I of atomic propositions, a Kripke model (A, v) consists of a frame A and a valuation of atomic propositions v : A — f 2. The notion of a bisimulation between Kripke frames (or Kripke models) is defined in the usual way. The category KF consists of Kripke frames as objects and has as morphisms those functions whose graphs are bisimulations (also known as bounded morphisms or p-morphisms). We write ML for the set of modal formulae, formulae being built from atomic propositions using boolean operators and a unary modal operator □. The semantics of a modal formula p E ML is given w.r.t. to a Kripke frame A, a valuation v, and a state a E A, via

A,v,a = p iff (v(a))p = 1 for p E I

A,v,a = □ p iff У a' E A . a' E a(a) ^ A,v,a' = p,

and for boolean operators in the obvious way. One says p holds in (A,v), written A,v = p, iff A,v,a = p for all a E A; p holds in A if it holds in all

8 PX = {Y \Y с X}.

(A,v). p is valid, written = p, iff p holds in all Kripke frames.

We now rephrase the semantics of modal logic in terms of natural transformations. For this, let U : KF ^ Set be the functor mapping Kripke frames to their carriers and morphisms to the underlying functions. The semantics [p] of a modal formula p can then be understood as a KF-indexed class of operations

Ma :(I[2fa ^ 2UA, A e KF, i

that is, each [p]a maps valuations v e I 2)UA and elements a e UA to truth values [p]A(v, a) e 2 = {0,1}.

A central feature of modal logic is that formulae are invariant under bisimulation. That is, for a modal formula p and two Kripke models (A,a,v), (B,fl,w), and a e A, b e B, it holds

a, b bisimilar ^ [p](A,a)(v, a) = [p](B,p)(w,b).

This property can be expressed equivalently by saying that [p] is a natural transformation:

Proposition 5.1 Consider a family ([p]a : (HI 2)UA ^ 2UA)AeKF- Then p is invariant under bisimulation iff [p]a is natural in A.

A proof of the proposition is given in the next subsection in a more general setting.

5.2 Modal Predicates

We now generalise the semantics of modal formulae from the previous subsection. A and PA(v,a) below replace KF and [p]A(v,a). And the behavioural equivalences ~C (Definition 1.1) replace bisimulation.

Definition 5.2 (Modal and Behavioural Predicates) Consider a functor U : A ^ Set. A predicate P in colours from C e Set is an operation which determines for each A eA, v : UA ^ C, a e UA a truth value

Pa(v, a) e {0,1}. (4)

P is called a modal predicate iff

(A, v, a) (B, w, b) ^ Pa(v, a) = Pb(w,b) (5)

for all w : UB ^ C and a e UA. We also write A,v,a = P or a e PA(v) for PA(v,a) = 1. As usual, we let A,v = P iff A,v,a = P for all a e UA and A = P iff A,v = P for all v : UA ^ C. In case that C =1 we call P a behavioural predicate and drop the v as e.g. in A,a = P or PA(a) = 1.

The following is immediate from the respective definitions.

Lemma 5.3 An operation P which determines for each A E A, v : UA — C, a E UA a truth value PA(v,a) E (0,1} is a modal predicate iff for all morphisms f : A — B, all valuations w for B, and all elements a of A, it holds

Pa(w o Uf, a) = Pb(w,Uf (a)). (6)

We now show that invariance of a predicate CU — 2U under C-behavioural equivalence is equivalent to the naturality of CU — 2U. Recall the definition of the functor XU from Section 1. In terms of modal logic (i.e., A = KF, X = Set, C = nj 2), CU maps a frame A to the set of valuations UA — C and a morphism f : A — B to the function CUf : CUB — CUA which takes a valuation w for B and transforms it into a valuation w o Uf for A. Also note that 2Uf : 2UB —> 2Ua is the inverse image of Uf mapping subsets Y C UB to

(Uf )-1(y).

Theorem 5.4 Consider a functor U : A — Set. An operation P vhich determines for each A E A, v : UA — C, a E UA a truth value PA(v,a) E (0, 1} is a modal predicate iff

pa : cUa -—{0,1}UA

is a natural transformation.

Proof Naturality of P means that for any morphism f : A — B

cua pa t 2Ua

Cu b pb t 2u b

commutes. Given w : U B ^ C and spelling out the definition of the vertical arrows we obtain PA(w o Uf ) = PB(w) o Uf, i.e., PA (w o Uf, a) = PB(w, Uf (a)) for all a G UA, yielding condition (6) in Lemma 5.3. □

Remark 5.5 It follows that behavioural predicates are natural transformations PA : 1 —► {0,1}UA or also PA : UA —► {0,1}.

5.3 Modal Operators and the Logic of Modal Predicates

We introduce a general notion of modal operator and discuss the corresponding basic modal logic. In particular, for modal predicates in propositional variables a notion of substitution is available.

Definition 5.6 (Modal Operator) Let U : A — Set be a functor and I a

set. An I-ary modal operator is a natural transformation

- :(n 2)" — 2U.

Given modal predicates Qi : CU ^ 2U, we define

□*№)*!) = Cu {Qi)ieI ■ n(2U) = (n 2)u —-—2U.

We list some examples and further definitions:

(i) An I-ary boolean operator is a modal operator

fu :(n 2)U — 2U i

given by a function f : I 2 ^ 2. Examples include the constant true : 1 ^ 2 and the 'truth-tables' — : 2 ^ 2, ^ :2 x 2 ^ 2.

(ii) Boolean operators also include infinitary operators. For example, conjunctions over an index set I are given

by AU : (EIi 2)U —> 2U where

Ai((bi)iei) = 1 ^ Vi e I . bi = 1.

(iii) A 0-ary modal operator is called an atomic proposition and is given by a natural transformation 1 ^ 2U (or also U ^ 2).

(iv) In case A = Coalg(P), an example of a unary modal operator is given by □ as in Section 5.1. The corresponding natural transformation - is 9 -A(X, a) = 1 ^ a(a) C X where A = (A, a), X C A, a e A. In case of O = —□— the corresponding natural transformation is -A(X,a) = 1 ^ a(a) n X = 0.

(v) More generally, Pattinson's modal operators given by natural relations  or predicate liftings  are further examples.

(vi) A unary modal operator is called normal iff, for X,Y C UA, -A(X n Y) = -A(X) n -a(Y) and -A(UA) = UA. For example, in (iv), □ is a normal modal operator and O is not.

(vii) In case of coalgebras A = (A, a), a : A ^ P(A x A), an example of a binary modal operator is

A,v,a = (P,Q) ^^ 3(b,c) e a(a) . A,v,b = P & A,v,c = Q

which corresponds to the natural transformation -A({X,Y),a) = 1 a(a) n X x Y = 0 where X,Y C A, a e A. (This binary modal operator is not a boolean combination of unary modal operators. It plays a central role in arrow logic .)

9 We take the liberty to denote a mapping v : UA ^ 2 by the corresponding subset X C UA.

(viii) Modal operators are closed under composition, i.e., for modal operators j : (HI 2)U —► 2U and fa : (^J 2)U ^ 2U, the composition j o J) is a modal operator.

(ix) Recursively defined modalities as in dynamic logic or the j-calculus are modal operators in our sense. Using (ii) and (viii) above, this follows from the fact that both logics embed into infinitary modal logic.

(x) Examples of modalities which are not covered by Definition 5.6 can be obtained by definitions that require a 'change of structure'. For instance, consider A = (A, a) E Coalg(P) and define

, A*,v*,a = é if A,v,a = p false otherwise

where A* = (A*, a*) is given by A* = A \{a : A,v,a = p} and a*, v* are the restriction of a, v to A*. Modalities of this kind arise in epistemic logic, see .

The reader will have noticed that our modal operators are in fact a special case of modal predicates. More precisely they are those modal predicates that allow for a notion of substitution.

Definition 5.7 (Propositional Variables and Substitution)

Let U : A ^ Set be a functor and I a set. A modal predicate

P 2)U 2U

is called a modal predicate in propositional variables (from I) or an I-ary modal predicate. Given modal predicates Qi : CU ^ 2U, the substitution P[Qi,/i] is the composition

CU > H(2U) = (H 2)U P ' 2U

Thus, in case we restrict ourselves to modal predicates in propositional variables, we have that substitution is composition. This explains why modal logic prefers to use propositional variables rather than colours.

The logic arising from a language in which formulas and connectives are interpreted as (our generalised) modal predicates and modal operators is familiar modal logic as shown by the following proposition.

Proposition 5.8 Let U : A ^ Set be a functor and j a normal unary modal operator. Consider a class \$ of modal predicates in propositional variables and let Q be in the closure of \$ under propositional tautologies, modus ponens, substitution, and

(dist) (nec)

Then A = \$ ^ A = Q.

Proof Straightforward. For (dist) and (nec) use that - is normal. □

Remark 5.9 The basic logic of modal predicates in propositional variables consists of (possibly infinitary) propositional tautologies, modus ponens, and substitution. Additional axioms and rules as (dist) and (nec) above depend on special properties of the modal operators.

Finally, we make precise the relationship between modal predicates and the coequations of Section 3.

Proposition 5.10 Let U : A ^ Set be a functor. Coequations in implicit operations (Definition 3.1) and modal predicates in propositional variables (Definition 5.7) have the same expressive power.

Proof Each modal predicate P is logically equivalent to the coequation P = true,10 which is to say that A = P (Definition 5.2) iff A = P = true (Definition 3.1) for all A e A. Conversely, for a coequation P = Q with P, Q : CU ^ DU, we find a set I and a surjective function e : i 2 ^ C and a modal predicate P o e ^ Q o e : (J]i 2)U ^ 2U such that A = P = Q ^ A = P o e ^ Q o e for all A eA. □

Acknowledgements

The first author wants to thank Alexandru Baltag for discussions on 'modalities' while the second author profited from discussions with H.P. Gumm. Diagrams were produced with Paul Taylor's macro package.

□ (P ^ P') ^ □P ^ □P' from P derive P

References

 P. Aczel and N. Mendler. A final coalgebra theorem. In D. H. Pitt et al, editor, Category Theory and Computer Science, volume 389 of LNCS, pages 357-365. Springer, 1989.

 J. Adamek and H. Porst. From varieties of algebras to covarieties of coalgebras. In A. Corradini, M. Lenisa, and U. Montanari, editors, Coalgebraic Methods in Computer Science (CMCS'01), volume 44.1 of ENTCS. Elsevier, 2001.

 J. Adamek and J. Rosicky. Locally Presentable and Accessible Categories, volume 189 of London Mathematical Society Lecture Notes Series. Cambridge University Press, 1994.

10 true is the obvious natural transformation. It was denoted by trueU in (i) above.

 J. Adamek and V. Trnkova. Automata and Algebras in Categories. Kluwer Academic Publishers, 1990.

 A. Baltag, L. Moss, and S. Solecki. The logic of public announcements, common knowledge, and private suspicions. Technical Report SEN-R9922, CWI, Amsterdam, November 1999.

 P. Blackburn, M. de Rijke, and Y. Venema. Modal Logic. Cambridge University Press, 2001. See also http://www.mlbook.org.

 Robert Davis. Quasi-cotripleable categories. Proceedings of the American Mathematical Society, 35:43-38, 1972.

 H. Peter Gumm. Equational and implicational classes of colgebras. Theoretical Computer Science, 260, 2001.

 H. Peter Gumm. Functors for coalgebras. Algebra Universalis, 45:135-147, 2001.

 Jesse Hughes. A Study of Categories of Algebras and Coalgebras. PhD thesis, Carnegie Mellon University, Pittsburgh, 2001. Available at http://www.cs.kun.nl/~jesseh/.

 B. Jacobs and J. Rutten. A tutorial on (co)algebras and (co)induction. EATCS Bulletin, 62, 1997.

 Alexander Kurz. Logics for Coalgebras and Applications to Computer Science. PhD thesis, Ludwig-Maximilians-Universität München, 2000. http://www.informatik.uni-muenchen.de/~kurz.

 Alexander Kurz. Coalgebras and Modal Logic. 2001. Course Notes for ESSLLI 2001. http://www.cwi.nl/~kurz.

 F.E.J. Linton. Some aspects of equational categories. In S. Eilenberg, D.K. Harrison, S. Mac Lane, and H. Rohrl, editors, Proceedings of the Conference on Categorical Algebra, La Jolla, 1965, pages 84-91. Springer, 1966.

 F.E.J. Linton. An outline of functorial semantics. In B. Eckmann, editor, Seminar on triples and categorical homology theory, volume 80 of Lecture Notes in Mathematics, pages 7-52. Springer, 1969.

 Saunders Mac Lane. Category Theory for the Working Mathematician. Springer, 1971.

 Ernest G. Manes. Algebraic Theories. Springer, 1976.

 Dirk Pattinson. Semantical principles in the modal logic of coalgebras. In Proceedings 18th International Symposium on Theoretical Aspects of Computer Science (STACS 2001), volume 2010 of LNCS, Berlin, 2001. Springer. Also available as technical report at http://www.informatik.uni-muenchen.de/~pattinso/.

 Dirk Pattinson. Coalgebraic modal logic: Soundness, completeness and decidability. Technical report, LMU Mnchen, 2002. http://www.informatik.uni-muenchen.de/~pattinso/.

 Jan Reiterman. The Birkhoff theorem for finite algebras. Algebra Universalis, 14:1-10, 1982.

 Jan Reiterman. Algebraic theories and varieties of functor algebras. Fundamenta Mathematicae, 118:59-68, 1983.

 Grigore Rosu. Equational axiomatizability for coalgebra. Theoretical Computer Science, 260:229-247, 2001.

 Jirí Rosicky. On algebraic categories. In Universal Algebra (Proc. Coll. Esztergom 1977), volume 29 of Colloq. Math. Soc. J. Bolyai, pages 662-690, 1981.

 J.J.M.M. Rutten. Universal coalgebra: A theory of systems. Theoretical Computer Science, 249:3-80, 2000. First appeared as technical report CS R 9652, CWI, Amsterdam, 1996.

 Yde Venema. A crash course in arrow logic. In M. Marx, L. Polos, and M. Masuch, editors, Arrow Logic and Multi-Modal Logic, Studies in Logic, Language and Information, pages 3-34. csli publications, Stanford, 1996.