Lifting Results for Categories of Algebras
Total Page:16
File Type:pdf, Size:1020Kb
Theoretical Computer Science 278 (2002) 257–269 www.elsevier.com/locate/tcs Lifting results for categories of algebras P.S. Mulry Department of Computer Science, Colgate University, Hamilton, NY 13346, USA Abstract In this paper, we present results that provide an abstract setting for the construction and in- terpretation of categories of algebras appearing in various semantic examples including those related to Scott domains and cartesian closed categories. A methodology is introduced that lifts adjoint pairs on categories with monads to categories whose objects are algebras for these mon- ads. Results are achieved by exploiting prior work on Kleisli liftings and the existence of key isomorphisms. While applicable to domain theory and the semantics of partiality, the construc- tion at work is considerably more general and is applicable to other settings as well. c 2002 Elsevier Science B.V. All rights reserved. 1. Introduction It is by now quite well known that certain functorial relationships exist between various standard semantic categories. For example, the connection between bottomless, strict and ordinary domains can be fruitfully described in a categorical framework of Kleisli and Eilenberg–Moore algebras. Strict domains form the category of lift- algebras for the category of (possibly bottomless) domains and the canonical functor between them is nothing more than the categorical comparison functor from Kleisli to Eilenberg–Moore algebras [8]. In this paper, we show that these observations are not accidental but rather arise as simple examples of a more general process that provides a means of lifting an adjoint pair from categories with monads to categories whose objects consist of the algebras of the corresponding monads. More precisely, starting with categories with assigned monads, an adjoint pair, and assuming certain closure conditions, we build in stages ÿrst to an adjunction on the categories of algebras and secondly to an adjunction on the Kleisli categories generated by the comonads. The interim adjoint pair constructed is often of interest as well. A key step involves the recognition of the existence of an iso- morphism relating lifted and underlying adjoint pairs. Special cases of this isomorphism This research was partially supported by NSF Grants CCR-9203106 and CCR-9506383. E-mail address: [email protected] (P.S. Mulry). 0304-3975/02/$ - see front matter c 2002 Elsevier Science B.V. All rights reserved. PII: S0304-3975(00)00338-8 258 P.S. Mulry / Theoretical Computer Science 278 (2002) 257–269 arise in domain theory and linear logic leading to the construction of cartesian closed categories. Results are also applicable to work of Jacobs on the semantics of weak- ening and contraction, and to other domain theoretic constructions. A ÿnal application provides an abstract setting for connecting partial and total semantics. It demonstrates not just how, but more importantly why, Scott total map semantics must arise in a systematic way from the corresponding partial semantics. 2. Liftings 2.1. Liftings and algebras We begin with a brief introduction to monads, algebras and liftings. See [1] for details about monads and algebras. Deÿnition 2.1. A monad (H; ; Á) on category C is a triple consisting of an endofunctor H and two natural transformations Á : id → H and : H 2 → H satisfying (1) ◦ ÁH = idH = ◦ HÁ, (2) ◦ H = ◦ H. Example 2.2. P, the powerset functor on SET, is a monad. For set A, Á (a)={a} A generates singletons and A{Ai} = Ai takes a family of subsets of A to their union. This paper focuses on lifting properties for categories of algebras. We brieDy describe these categories. Deÿnition 2.3. Let (H; Á; ) be a monad on category C. The Kleisli category, CH , has the same objects as in C. Arrows from A to B in CH correspond to arrows A → HB in C. The deÿnition of arrows in Kleisli makes composition of arrows non-trivial. If f is an arrow from A to B, and g an arrow from B to C in CH , the composition corresponds to the arrow B ◦ Hg ◦ f in C. It is easy to check that this composition is well deÿned. There is a standard inclusion functor iH : C → CH . It is well known that iH has a right adjoint, iH RH , that the monad formed by the adjunction is just H and that it is the initial such adjunction generating H. Further, the Kleisli category on H is equivalent to the category of free Eilenberg–Moore algebras on H [1]. Example 2.4. Given P, the monad of Example 2.2, SETP is the category whose objects are sets and whose morphisms from A to B are functions A → PB, i.e. relations on A × B. Thus SETP is just REL, the category of sets and relations. Deÿnition 2.5. Let (H; Á; ) be a monad on category C. The Eilenberg–Moore (E–M) category of H-algebras, denoted CH , has: P.S. Mulry / Theoretical Computer Science 278 (2002) 257–269 259 Objects: E–M algebras (A; a) Arrows: An arrow from (A; a)to(B; b)inCH is an arrow f : A → B in C so that b ◦ Hf = f ◦ a. Example 2.6. Returning to the powerset monad P on SET, E–M algebras (X; x) and (Y; y) are complete semilattices. Algebra maps f from (X; x)to(Y; y) are set functions so that y ◦ Pf = f ◦ x. This is turn forces f to preserve and therefore order as well. SETP then is the category of complete semilattices and sup-preserving maps, SLAT. H There is a standard forgetful functor UH : C → C. UH has a left adjoint, FH UH , which on object A in C creates the free algebra (HA; A). The monad formed by the adjunction is again just H and it is the ÿnal such adjunction generating H.In H particular, there always exists a comparison functor G : CH → C which is a map of the corresponding adjunctions. See [1]. Example 2.7. Let F be the free functor from SET to MON, the category of monoids, with forgetful right adjoint U. The monad H on SET formed by this adjunction is Kleene star which acting on set X produces X ∗ the set of strings on alphabet X . Á(x)=‘x’ coerces a character into a string of length one and acting on a string of words concatenates the string into a single word. SETH is isomorphic to the category MON. Multiplication on algebra object (X; h) is determined by the structure map h, namely the monoid product of x and y is just h(‘xy’), while the identity element is simply the image under h of the empty string. Thus the comparison functor is an isomorphism. This motivates the general nomenclature deÿning a right adjoint to be monadic when the comparison functor, for the monad generated by the adjunction, is an isomorphism. Example 2.8. In the case of the powerset monad P on SET, the comparison functor REL → SLAT maps the relation R on A × B to the semilattice morphism G(R):PA→PB, where for subset A0 of A, G(R)(A0)={b|aRb for a in A0}. We now consider the notion of lifting functors to categories of algebras. Consider monads (H; Á; ) and (K; ; ) on categories C and D, respectively. Let F be a functor F : C → D. The notion of the lifting of a functor F exists for both Eilenberg–Moore and Kleisli categories. Let iH ;iK denote the inclusion functors into Kleisli categories. G G Deÿnition 2.9. A functor F : CH → DK is a Kleisli lifting of F if F ◦ iH = iK ◦ F or equivalently that the following diagram commutes. FG CH → DK iH↑ iK↑ C →F D One can specify conditions that ensure such liftings exist. 260 P.S. Mulry / Theoretical Computer Science 278 (2002) 257–269 G Theorem 2.10. For C; D;H;K;Fas above; functors F : CH → DK which are liftings are in 1–1 correspondence with natural transformations of the form : FH → KF that satisfy the following: (1) ◦ FÁ = F ; (2) F ◦ K ◦ H = ◦ F. Proof. See [5, 10] where further references can be found. The natural transformation along with the corresponding equations is often referred to as a distributive law. In a similar fashion one can deÿne E–M liftings F∗ : CH → D K of functors F to ∗ E–M categories of algebras where the equation F ◦ UH = UK ◦ F holds for forgetful functors UH ;UK . Such liftings are ensured by the existence of natural transformations of the form : KF → FH satisfying equations similar to those for above [3]. Notation: Again we are supposing that functor F : C → D exists with accompanying monads H and K. We will denote Kleisli lifts of F by FG and Eilenberg–Moore lifts by F∗. A key point to note is that more than one lifting of each kind may exist for a given functor, depending on the existence of particular distributive laws. Further discussion on this can be found in [10]. Example 2.11. Let C be a symmetric monoidal category with monad H. Monad H is called strong [4] if there exists a natural transformation A; B : HA ⊗ B → H(A ⊗ B) satisfying (1) A; B ◦ ÁA ⊗ B = ÁA⊗B, (2) A⊗B ◦ HA; B ◦ HA; B = A; B ◦ A ⊗ B. By the above we note that H is strong exactly when the product functor ⊗ B on C lifts to the Kleisli category CH . Likewise if H is commutative (monoidal), then the bifunctor ⊗ lifts. A special case arises when dealing with the product bifunctor × on a cartesian category C × C. Example 2.12.