Download Article (PDF)
Total Page:16
File Type:pdf, Size:1020Kb
Cent. Eur. J. Comp. Sci. • 4(3) • 2014 • 96-106 DOI: 10.2478/s13537-014-0220-7 Central European Journal of Computer Science Categorical structures as expressing tool for differential calculus Research Article William Steingartner1∗, Davorka Radaković2† 1 Department of Computers and Informatics, Faculty of El. Engineering and Informatics Technical University of Košice, Letná 9, 04200 Košice, Slovakia 2 Department of Mathematics and Informatics, Faculty of Sciences University of Novi Sad, Trg D. Obradovića 4, 21000 Novi Sad, Serbia Received 28 February 2014; accepted 01 September 2014 Abstract: Category is a mathematical structure consisting of objects and morphisms between objects with some specific properties. Categories examine in abstract way the properties of particular mathematical concepts by formalizing them as collections of objects and morphisms. Categorical structures are widely used in computer science for ex- act mathematical modeling. This paper highlights the most typical use of categories for constructing the model of part of differential calculus by using special category named arrow category; and codomain and domain functors. Keywords: arrow category• category theory • categorical model• codomain functor• derivative © Versita sp. z o.o. 1. Introduction Category theory is an area of study in mathematics that examines in abstract way the properties of particular math- ematical concepts by formalizing them as collections of objects and arrows (called morphisms, although this term also has a specific, non category-theoretical meaning), where these collections satisfy some basic conditions [1–3]. Category theory has been developed over the last fifty years, and it has concerned with the study of algebraic structures [4, 5]. Many significant areas of mathematics and informatics can be formalized by using categories. The use of category theory allows many intricate and subtle mathematical results in some fields to be stated and proved, in a much simpler way than without the use of categories [6]. Infinitesimal calculus is widely used in mathematics and often applied in computer science or other industrial branches. Many communication systems and control systems, for example, are based on engineering topics which rely heavily on integral ([7, 8]) and differential calculus (for example [9]). Since computers work with fixed-precision numbers (integers or floating-point), the math-book-style calculus of continuous functions has to be translated into forms that are computable ∗ E-mail: [email protected] (Corresponding author) † E-mail: [email protected] 96 William Steingartner, Davorka Radaković using discrete functions. For example, in digital signal processing we often see a discrete convolution (used in filtering, etc.) which is more or less the same operation as a convolution, only replacing the integrals with summations. On the other hand, typical computer work like database design, operating systems, web-based applications, point-of-sale terminals, etc. - these types of algebraic and logical systems would rarely use integral or differential calculus; only in the case when the knowledge of probability and statics is required and they are useful in several areas of computer science. When we need to analyze the correctness of computation in program [3, 10–12], we can use many approaches. One of the fruitful method is the construction of categorical model based on methodsrôle like Curry-Howard correspondence or linear logic. We want to extend this method also with an analysis of computations in differential calculus because they are very often a part of some another computation. In our paper we show the of categorical structures in a part infinitesimal calculus, namely in differential calculus. We show how to express derivatives in two manners in categories and we formulate relation between these two approaches. 2. Practical foundations from category theory Some basic notions from category theory needed for our approach are briefly introduced here. Category theory is a part of mathematics. Its importance for theoretical computer science grew in the last decades. Categories are interesting mathematical structures, consisting of objects and morphisms between them with some specific properties. Objects can be sets, data structures or other mathematical structures. Fundamentals of category theory are relations between objects. These relations are expressed by morphisms. In application of category theory, morphisms usually correspond to computations, proofs or other forms [13]. The existence of identity morphism for any object and composition of morphisms is also important for category. A structure which expresses equality inrôle category is commutative diagram. It is a diagram of objects and morphisms such that all directed paths in the diagram with the same start and endpoints lead to the same result by composition. Commutative diagrams play the crucial in category theory that equations play in algebra [2]. A general form of commutative diagram is depicted in Fig. 1. f - fn−- A ··· An− - 2 1 1 1 f f n 1 - A B - g - g m 1 0 - - 0 A ··· Am− g gm− 1 1 2 1 Figure 1. General form of commutative diagram. Diagram in Fig. 1 expresses the equalityfn of◦ f twon− ◦ paths::: ◦ (twof compositions)gm ◦ gm− ◦ ::: as◦ g follows: 1 1 1 1 m; n ∈ N = (1) for . C A; B; : : : We define category as it was defined in [2, 4]. A category is mathematical structure consisting of a collection of objects, e.g. and composable morphisms betweenf A them→ B: in the form : 97 Categorical structures as expressing tool for differential calculus f; g cod f dom g From each pair of two morphisms which fulfillg ◦ thef dom conditionf → cod( g) = ( ) we can compose new morphism associativity : ( ) ( ) subject to the axiom of h ◦ g ◦ f h ◦ g ◦ f f A → B g B → C h C → D ( ) = ( ) for all morphisms : , : and : A . An identity morphisms is defined for each object , idA A → A; unit : subject to the axioms of : f ◦ idA idB ◦ f f f A → B = = (2) for all : such that the diagram at Fig. 2 commutes. id A A - A id f B ◦ ◦ id f f A - ? - B - B idB Figure 2. Diagram of unit in category. C → The previous laws are required because of their ability to represent arbitrary structuresC → that are not expressible by sets.C In our approach we work with special type of category called arrowC category, usually denoted . This category is a kindC of a comma category - with a construction in category. An arrow category is defined over a base category and it holds, that its objects are the morphisms of metacategory , and its morphisms are commuting squares (diagrams) in , depicted in the Fig. 3. a dom f - dom g f ( ) g( ) ? ? cod f - cod g b ( ) ( ) Figure 3. Commutative square of objects f and g in arrow category. f A → B The identity in arrow category for : is defined as follows: idf idA; idB : = ( ) 98 William Steingartner, Davorka Radaković a ; b f → f a ; b f → f 1 1 1 2 2 2 2 3 A composition of two morphisms ( ): a and◦ a (; b ◦ b): f → fis defined as follows: 2 1 2 1 1 3 ( ): and it is depicted in diagram in the Fig. 4. a a dom f - dom f - dom f 1 2 1 2 3 f ( ) (f ) (f ) ? ? ? 1 b 2 b 3 cod f - codm f - cod f 1 2 ( 1) ( 2) ( 3) Figure 4. Composition of morphism in arrow category. functors The relation between categories is expressed by special morphisms called which preserve structure: objects are sent to objects and morphisms into morphisms betweenF imagesC → D of objects in source morphism. A functor C D : from a category into a category (or between categories) considered as a structure-preserving mapping between categoriesF f asA follows:→ B F f F A → F B 1. F(id:A idF)A = ( ): ( ) ( ); ( ) 2. F(g ◦)f = F g; ◦ F f 3. ( F ) = ( ) ( ). Codomain functor A functor preserves domains and codomains, identity arrows, and composition. is the special functor defined for arrow category. Codomain functor is always defined for the arrow category and the appropriate base category [14]. ItC isod definedC → → asC; follows: f A → B : which assigns to each object : in arrow categoryCod f its codomain,B; a; b ( ) = and to each morphism ( ) from arrow category (Fig.Cod3)a; the b morphismb: between appropriate codomains, (( )) = domain functor A general scheme of codomain functor is in the Fig. 5. A is another functor necessary for expressing the model of our approach. Domain functor is defined analogously as codomain functor, from arrow categoryD om intoC metacategory,→ → C; : 99 Categorical structures as expressing tool for differential calculus C → f (a, b) g od C C A C f g B Figure 5. A general scheme of codomain functor. f A → B Domain functor assigns to each object : in arrowD om categoryf A; its domain, a; b ( ) = and to each morphism ( ) from arrow category (Fig.D om3)a; the b morphisma: between appropriate domains, (( )) = Taking domain and codomain functor over metacategory of sets for differentiable functions we construct categorical model of a part of differential calculus. 3. Categorical Structures in Differential Calculus Derivatives in category can be expressed as follows:Der functions and their derivatives are morphisms. Objects are domains and codomains of functions. All these functions must to be differentiable. Identity and composition in this category are defined by obvious way. We denote this category and we define it as a category of sets for differentiable functions 3.1.- only differentiable How to express functions derivatives are morphisms. in category Der→ Der Der→ Der For another defining the derivatives in category we considerDer→ the arrow category over the metacategory . The arrow categoryf overf 0 a base metacategory of sets exists according to the definition, so we can define any function as object in arrow category. MorphismsDer→ of Der are the operations of differentiation which assign to any function its derivative according to the definition.