# Coalgebra

## Idea

Many systems can be described by having some kind of state space and a map that assigns to each state the result of observations that can be made on that state and possible next states that are reachable from that state. From an abstract perspective, the structure of the states are described by a category C and the possible observations are specified by an endofunctor on this category. A coalgebra is then a morphism for some carrier X, the state space.

Let us take a look at some examples before we dive into formal definitions and results.

1. Deterministic Automata. The typical, first year example one learns about in Computer Science are deterministic automata over a finite alphabet . These are given by a set of states , a set of final states and a map that assigns to a state and an input symbol the next state. We can combine this data into a single map by putting with and .
2. Non-deterministic automata. These are an extension of deterministic automata where we allow a state to have a set of successors, they are maps of the type .
3. Differential Equations. A more mathematical example are (ordinary) differential equations, these assign to each point in space a time dependent vector field, i.e., they are given on vector spaces by maps of the form where is the tangent space and are the real numbers.

Note that in all these cases we have completely ignored initial states or initial conditions. These are not part of coalgebras, every element of the state space can be initial.

## Definition

<definition id="coalg"> Let C be a category and an endofunctor on C. An F-coalgebra is a morphism in C, and a homomorphism from a coalgebra to is a morphism such that

commutes. </definition>

Straight from the definition, we can prove the following. <theorem id="coalg-cat">

 -Coalgebras and their homomorphisms form a category .


</theorem>