An initial algebra for an endofunctor on a category is an initial object in the category of algebras of .
If has an initial algebra , then is isomorphic to via ; this is Lambek’s theorem. In this sense, is a fixed point of . Being initial, is the smallest fixed point of in that there is a map from to any other fixed point (indeed, any other algebra), and this map is an injection if is Set.
The dual concept is terminal coalgebra, which is the largest fixed point of .
Given an initial algebra structure , define an algebra structure on to be . By initiality, there exists an -algebra map , so that
commutes. Now it is trivial, in fact tautological that is itself an -algebra map . Thus , since both sides of the equation are -algebra maps and is initial. As a result, , so that according to the commutative square. Hence is an isomorphism, with inverse .
In many cases, initial algebras can be constructed in recursive? fashion, using the following theorem: let be a category with an initial object and colimits of chains (where is the first infinite ordinal), and suppose preserves colimits of -chains. Then the colimit of the chain
is an initial -algebra. This applies in particular to any functor which is a colimit of finitely representable functors , as in the following examples.
Let be a set, and let be the functor . Then the initial -algebra is , the free monoid on . The -algebra structure is
where is the identity and is the restriction of the monoid multiplication along the evident inclusion .
This “fixed point” of can be thought of as the result of the (slightly nonsensical) calculation
which can be made rigorous by interpreting the initial equality as defining the solution by recursion, and applying the theorem above.
Let be the functor . Then the initial -algebra is the set of isomorphism classes of finite (planar, rooted) binary trees. The -algebra structure is
where names the tree consisting of just a root vertex, and creates a tree from two trees , by joining their roots to a new root, so that the root of becomes the left child and the root of the right child of the new root.
The recursive equation
would seem to imply that the structure behaves something like a structural “sixth root of unity”, and indeed the structural isomorphism allows one to exhibit an isomorphism
constructively, as famously explored in the paper by Andreas Blass, Seven Trees in One.
Let be the functor (the free monoid from an earlier example). Then the initial -algebra is the set of isomorphism classes of finite planar rooted trees (not necessarily binary as in the previous example).