F-coalgebra

From HandWiki

In mathematics, specifically in category theory, an [math]\displaystyle{ F }[/math]-coalgebra is a structure defined according to a functor [math]\displaystyle{ F }[/math], with specific properties as defined below. For both algebras and coalgebras,[clarification needed] a functor is a convenient and general way of organizing a signature. This has applications in computer science: examples of coalgebras include lazy evaluation, infinite data structures, such as streams, and also transition systems.

[math]\displaystyle{ F }[/math]-coalgebras are dual to [math]\displaystyle{ F }[/math]-algebras. Just as the class of all algebras for a given signature and equational theory form a variety, so does the class of all [math]\displaystyle{ F }[/math]-coalgebras satisfying a given equational theory form a covariety, where the signature is given by [math]\displaystyle{ F }[/math].

Definition

Let

[math]\displaystyle{ F : \mathcal{C}\longrightarrow \mathcal{C} }[/math]

be an endofunctor on a category [math]\displaystyle{ \mathcal{C} }[/math]. An [math]\displaystyle{ F }[/math]-coalgebra is an object [math]\displaystyle{ A }[/math] of [math]\displaystyle{ \mathcal{C} }[/math] together with a morphism

[math]\displaystyle{ \alpha : A \longrightarrow FA }[/math]

of [math]\displaystyle{ \mathcal{C} }[/math], usually written as [math]\displaystyle{ (A, \alpha) }[/math].

An [math]\displaystyle{ F }[/math]-coalgebra homomorphism from [math]\displaystyle{ (A, \alpha) }[/math] to another [math]\displaystyle{ F }[/math]-coalgebra [math]\displaystyle{ (B, \beta) }[/math] is a morphism

[math]\displaystyle{ f:A\longrightarrow B }[/math]

in [math]\displaystyle{ \mathcal{C} }[/math] such that

[math]\displaystyle{ Ff\circ \alpha = \beta \circ f }[/math].

Thus the [math]\displaystyle{ F }[/math]-coalgebras for a given functor F constitute a category.

Examples

Consider the endofunctor [math]\displaystyle{ X \mapsto X \sqcup \{*\} : \mathbf{Set} \to \mathbf{Set} }[/math] that sends a set to its disjoint union with the singleton set [math]\displaystyle{ \{ \ast \} }[/math]. A coalgebra of this endofunctor is given by [math]\displaystyle{ (\overline{\mathbb{N}},\alpha) }[/math], where [math]\displaystyle{ \overline{\mathbb{N}}= \{0, 1, 2, \ldots \} \sqcup \{\infty\} }[/math] is the so-called conatural numbers, consisting of the nonnegative integers and also infinity, and the function [math]\displaystyle{ \alpha }[/math] is given by [math]\displaystyle{ \alpha(0) = \ast }[/math], [math]\displaystyle{ \alpha(n) = n - 1 }[/math] for [math]\displaystyle{ n = 1, 2,\ldots }[/math] and [math]\displaystyle{ \alpha(\infty) = \infty }[/math]. In fact, [math]\displaystyle{ (\overline{\mathbb{N}}, \alpha) }[/math] is the terminal coalgebra of this endofunctor.

More generally, fix some set [math]\displaystyle{ A }[/math], and consider the functor [math]\displaystyle{ F: \mathbf{Set} \longrightarrow \mathbf{Set} }[/math] that sends [math]\displaystyle{ X }[/math] to [math]\displaystyle{ (X\times A)\cup\{1\} }[/math]. Then an [math]\displaystyle{ F }[/math]-coalgebra [math]\displaystyle{ \alpha : X \longrightarrow (X\times A)\cup\{1\} = FX }[/math] is a finite or infinite stream over the alphabet [math]\displaystyle{ A }[/math], where [math]\displaystyle{ X }[/math] is the set of states and [math]\displaystyle{ \alpha }[/math] is the state-transition function. Applying the state-transition function to a state may yield two possible results: either an element of [math]\displaystyle{ A }[/math] together with the next state of the stream, or the element of the singleton set [math]\displaystyle{ \{1\} }[/math] 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 [math]\displaystyle{ X \rarr f_1 \times f_2 \times \ldots \times f_n }[/math], which readily factorizes into a collection of "selectors", "observers", "methods" [math]\displaystyle{ X \rarr f_1, \, X \rarr f_2 \, \ldots \, X \rarr f_n }[/math]. Special cases of practical interest include observers yielding attribute values, and mutator methods of the form [math]\displaystyle{ X \rarr X^{A_1 \times \ldots \times A_n} }[/math] taking additional parameters and yielding states. This decomposition is dual to the decomposition of initial [math]\displaystyle{ F }[/math]-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.

Applications

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.[citation needed]

See also

References

External links