Cardinality Functions in Allegories ∗ Yasuo Kawahara a , Michael Winter B, ,1
Total Page:16
File Type:pdf, Size:1020Kb
CORE Metadata, citation and similar papers at core.ac.uk Provided by Elsevier - Publisher Connector The Journal of Logic and Algebraic Programming 79 (2010) 830–844 Contents lists available at ScienceDirect The Journal of Logic and Algebraic Programming journal homepage:www.elsevier.com/locate/jlap Cardinality functions in allegories ∗ Yasuo Kawahara a , Michael Winter b, ,1 a Department of Informatics, Kyushu University, Fukuoka, Japan b Department of Computer Science, Brock University, St. Catharines, Ontario, Canada L2S 3A1 ARTICLE INFO ABSTRACT Article history: In this paper we want to investigate three notions of the cardinality of relations in the context Availableonline17July2010 of allegories. Two of the three axiom systems are motivated on the existence of injective and surjective functions, respectively. Since those notions may differ we provide a third unifying definition of cardinality. In all cases we provide a canonical cardinality function and show that it is initial in the category of all cardinality functions over the given allegory. © 2010 Elsevier Inc. All rights reserved. 1. Introduction The calculus of relations, and its categorical versions in particular, are often used to model programming languages, classical and non-classical logics and different methods of data mining (see for example [1–3,8,9]). In many applications relations that are minimal with respect to inclusion as well as minimal with respect to their cardinality are substantial. For example, in deductive databases and logic programming the minimal relations satisfying all facts and rules taken as the semantics of the program. Another example arises from non-monotonic reasoning, where minimality is crucial in formalizing abnormal behaviors and situations. The last example is taken from graph theory. Finite trees can be characterized as those connected graphs satisfying the numerical equation e = n − 1 relating the number of edges e and vertices n. Since graphs can be considered as binary relation, an abstract formulation of the property above in the theory of allegories needs a notion of cardinality. This is an extended version and a continuation of [7]. In the current paper we want to investigate three notions of the cardinality of relations in the context of allegories. The first notion is motivated by the standard cardinal (pre)ordering of sets, i.e. a set A is smaller than a set B if there is an injective function from A to B. The second notion will be based on surjective functions, i.e. we consider a set A smaller than a set B if there is a surjective function from B to A. Ignoring the empty set, the two notions are equivalent in regular set theory with the axiom of choice. Since the theory of allegories is much weaker we cannot expect such a result in general. Therefore, we present a third notion of the cardinality of a relations generalizing the others. We also investigate under which assumptions the different notions coincide. In all cases we provide a canonical cardinality function and show that it is initial in the category of all cardinality functions over the given allegory. Last but not least, we give an additional axiom characterizing the canonical cardinality function (up to isomorphism). 2. Categories of relations Throughout this paper we assume that the reader is familiar with the basic notions from category and lattice theory. For notions not defined here we refer to [4,5]. ∗ Corresponding author. E-mail addresses: [email protected] (Y. Kawahara), [email protected] (M. Winter). 1 The author gratefully acknowledges support from the Natural Sciences and Engineering Research Council of Canada. 1567-8326/$ - see front matter © 2010 Elsevier Inc. All rights reserved. doi:10.1016/j.jlap.2010.07.018 Y. Kawahara, M. Winter / Journal of Logic and Algebraic Programming 79 (2010) 830–844 831 Given a category C we denote its collection of objects by ObjC and its collection of morphisms by MorC . To indicate that amorphismf has source A and target B we usually write f : A → B. The collection of all morphisms between A and B is denoted by C[A, B].Weuse; for composition of morphisms, which has to be read from left to right, i.e. f ; g means first f then g. The identity morphism on the object A is written as IA. Definition 1. An allegory R is a category satisfying the following: (1) For all objects A and B the class R[A, B] is a lower semi-lattice. Meet and the induced ordering are denoted by , , respectively. The elements in R[A, B] are called relations. (2) There is a monotone operation (called the converse operation) such that for all relations Q, R : A → B and S : B → C the following holds (Q; S) = S ; Q and (Q ) = Q. (3) For all relations Q : A → B, R, S : B → C we have Q; (R S) Q; R Q; S. (4) For all relations Q : A → B, R : B → C and S : A → C the following modular law holds Q; R S Q; (R Q ; S). ArelationR : A → B is called univalent (or a partial function) iff R ; R IB and total iff IA R; R . Functions are total and univalent relations and are usually denoted by lowercase letters. Furthermore, R is called injective iff R is univalent and surjective iff R is total. In the following lemma we have summarized several basic properties of relations used in this paper. A proof can be found in [4,8,9]. Lemma 1. Let R be an allegory. Then we have: (1) Q; R S (Q S; R ); (R Q ; S) for all relations Q : A → B, R : B → CandS: A → C (Dedekind formula); (2) If Q : A → B is univalent, then Q; (R S) = Q; R Q; S for all relations R, S : B → C; (3) If R : B → C is univalent, then Q; R S = (Q S; R ); R for all relations Q : A → BandS: A → C. (4) (IA R; R ); R = R for all relations R : A → B. Another important property of commuting squares of functions is as follows: Lemma 2. Let R be an allegory, and f : A → B, g : A → C, h : B → Dandk: C → D be functions with f ; g = h; k .Then we have f ; h = g; k. Proof. Consider the following computation f ; h g; g ; f ; hgtotal = g; k; h ; h assumption g; khunivalent f ; f ; g; kftotal = f ; h; k ; k assumption f ; h. k univalent This completes the proof. Two functions f : C → A and g : C → B with common source are said to tabulate a relation R : A → B iff R = f ; g and f ; f g; g = IC . If for all relations of an allegory R there is tabulation, then R is called tabular. Notice that a function f : A → B and its converse f : B → A always have a tabulation. The tabulation is given by (IA, f ) and (f , IB), respectively. Lemma 3. Let R be an allegory, and R : A → B a relation that is tabulated by f : C → Aandg : C → B. Furthermore, let h : D → Aandk: D → B be functions with h ; k R, and define l := h; f k; g : D → C. Then we have the following: (1) l is the unique function with h = l; fandk= l; g. (2) If h ; k = R, then l is surjective. (3) If h : D → Aandk: D → B is a tabulation, i.e. h; h k; k = ID, then l is injective. (4) If R is a partial identity, i.e. A = BandR IA, then f (or g) is a tabulation of R, i.e. R = f ; fandf; f = IC . 832 Y. Kawahara, M. Winter / Journal of Logic and Algebraic Programming 79 (2010) 830–844 Proof (1) This was already shown in 2.143 of [4]. (2) Assume h ; k = R.Thenwehave IC = IC f ; f ; g; g f , g total = IC f ; h ; k; g assumption (f ; h g; k ); (h; f k; g ) Lemma 1(1) = l ; l. (3) Assume h; h k; k = ID.Thenwehave l; l = (h; f k; g ); (f ; h g; k ) h; f ; f ; h k; g ; g; k h; h k; k f , g univalent = ID. assumption (4) This was already shown in 2.145 of [4]. The previous lemma also implies that tabulations are unique up to isomorphism. The next lemma is concerned with a tabulation of the meet of two relations. Lemma 4. Let R be an allegory, and Qi : A → B be relations tabulated by fi : Ci → Aandgi : Ci → Bfori = 1, 2.If f : D → Aandg : D → B is a tabulation of Q1 Q2, then there are unique injections hi : D → Ci (i = 1, 2) satisfying the following: (1) hi; fi = fandhi; gi = g; (2) If there are functions ki : E → Cwithk1; f1 = k2; f2 and k1; g1 = k2; g2, then there is a unique function m : E → D with ki = m; hi (i = 1, 2). Qi / AR_> ?BL >> ÐÐ >> ÐÐ > Ð g fi > ÐÐ i Ci f OY g hi DO ki m E = ; ; : → Proof. From Lemma 3 (1) and (3) we get hi f fi gi gi . It just remains to verify the second property. Assume ki E C are as required, and let p := k1; f1 = k2; f2 and q := k1; g1 = k2; g2.Thenwehave p ; q = p ; q p ; q = (k1; f1) ; k1; g1 (k2; f2) ; k2; g2 by definition = ; ; ; ; ; ; f1 k1 k1 g1 f2 k2 k2 g2 ; ; f1 g1 f1 g1 ki univalent = Q1 Q2. Since f , g is a tabulation of Q1 Q2 there is a unique function m : E → D with m; f = p and m; g = q.