In mathematics, coalgebras or cogebras are structures that are dual (in the category-theoretic sense of reversing arrows) to unital associative algebras. The axioms of unital associative algebras can be formulated in terms of commutative diagrams. Turning all arrows around, one obtains the axioms of coalgebras.
Every coalgebra, by (vector space) duality, gives rise to an algebra, but not in general the other way. In finite dimensions, this duality goes in both directions (see below).
Coalgebras occur naturally in a number of contexts (for example, universal enveloping algebras and group schemes).
There are also F-coalgebras, with important applications in computer science.
Formally, a coalgebra over a field K is a vector space C over K together with K-linear maps Δ: C → C ⊗ C and ε: C → K such that
(Here ⊗ refers to the tensor product over K and id is the identity function.)
Equivalently, the following two diagrams commute:
In the first diagram we silently identify C ⊗ (C ⊗ C) with (C ⊗ C) ⊗ C; the two are naturally isomorphic. Similarly, in the second diagram the naturally isomorphic spaces C, C ⊗ K and K ⊗ C are identified.
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
.
An -coalgebra for an endofunctor on the category
is an object of
together with a morphism
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.
Consider the functor that sends
to
,
-coalgebras
are then finite or infinite streams 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.