In mathematics, specifically in category theory, an -coalgebra is a structure defined according to a functor . For both algebra and coalgebra, a functor is a convenient and general way of organizing a signature. This has applications in computer science: examples of coalgebras include lazy, infinite data structures, such as streams, and also transition systems.
-coalgebras are dual to -algebras. Just as the class of all algebras for a given signature and equational theory form a variety, so does the class of all -coalgebras satisfying a given equational theory form a covariety, where the signature is given by .
of , usually written as .
An -coalgebra homomorphism from to another -coalgebra is a morphism
in such that
Thus the -coalgebras for a given functor F constitute a category.
The set of conatural numbers consisting of the nonnegative integers and also infinity when equipped with the function given by , for and is a coalgebra of the endofunctor that sends a set to its disjoint union with the singleton set . In fact, is the terminal coalgebra of this endofunctor.
More generally, fix some set , and consider the functor that sends to . Then an -coalgebra is a finite or infinite stream over the alphabet , where is the set of states and is the state-transition function. Applying the state-transition function to a state may yield two possible results: either an element of together with the next state of the stream, or the element of the singleton set as a separate "final state" indicating that there are no more values in the stream.
In many practical applications, the state-transition function of such a coalgebraic object may be of the form , which readily factorizes into a collection of "selectors", "observers", "methods" . Special cases of practical interest include observers yielding attribute values, and mutator methods of the form taking additional parameters and yielding states. This decomposition is dual to the decomposition of initial -algebras into sums of 'constructors'.
Let P be the power set construction on the category of sets, considered as a covariant functor. The P-coalgebras are in bijective correspondence with sets with a binary relation. Now fix another set, A. Then coalgebras for the endofunctor P(A×(-)) are in bijective correspondence with labelled transition systems, and homomorphisms between coalgebras correspond to functional bisimulations between labelled transition systems.
In computer science, coalgebra has emerged as a convenient and suitably general way of specifying the behaviour of systems and data structures that are potentially infinite, for example classes in object-oriented programming, streams and transition systems. While algebraic specification deals with functional behaviour, typically using inductive datatypes generated by constructors, coalgebraic specification is concerned with behaviour modelled by coinductive process types that are observable by selectors, much in the spirit of automata theory. An important role is played here by final coalgebras, which are complete sets of possibly infinite behaviours, such as streams. The natural logic to express properties of such systems is coalgebraic modal logic.
- B. Jacobs and J. Rutten, A Tutorial on (Co)Algebras and (Co)Induction. EATCS Bulletin 62, 1997, p.222-259.
- Jan J. M. M. Rutten: Universal coalgebra: a theory of systems. Theor. Comput. Sci. 249(1): 3-80 (2000).
- J. Adámek, Introduction to coalgebra. Theory and Applications of Categories 14 (2005), 157-199
- B. Jacobs, Introduction to Coalgebra. Towards Mathematics of States and Observations (book draft)
- Yde Venema: Automata and Fixed Point Logics: a Coalgebraic Perspective. Information and Computation, 204 (2006) 637-678.