Welcome to fletrix.com on January 7 2009.
This is an internet experiment running to monitor browsing habbits of individuals through wikipedia contents.

Initial algebra

From Wikipedia, the free encyclopedia

Jump to: navigation, search

In mathematics, an initial algebra is an initial object in the category of F-algebras for a given endofunctor F. The initiality provides a general framework for induction and recursion.

For instance, consider the endofunctor 1+(-) on the category of sets. An algebra for this endofunctor is a set X together with a point xεX and a function XX. The set of natural numbers is the initial such algebra: the point is zero and the function is the successor map.

For a second example, consider the endofunctor 1+N×(-) on the category of sets, where N is the set of natural numbers. An algebra for this endofunctor is a set X together with a point xεX and a function N×XX. The set of lists of natural numbers is the initial such algebra. The point is the empty list, and the function is cons, taking a number and a list, and returning a new list with the number at the head.

Contents

[edit] Theorems

  • Initial algebras are minimal (have no proper subalgebra[1])
  • Final coalgebras are simple (have no proper quotients[2]).[1]

[edit] Example

Consider the endofunctor F: \mathbf{Set} \longrightarrow \mathbf{Set} sending X to 1 + X. Then the set N of natural numbers together with the functions [zero,succ] : 1+N \longrightarrow N, where zero : 1 \longrightarrow N and succ : N \longrightarrow N are the obvious functions suggested by their names, is an initial F-algebra. The initiality (the universal property for this case) is not hard to establish; the unique homomorphism to an arbitrary F-algebra (A,[e,f]), for e : 1 \longrightarrow A an element of A and f : A \longrightarrow A a function on A, is the function sending the natural number n to fn(e), that is, f(f(...(f(e))...)), the n-fold application of f to e.

[edit] Use in programming theory

Various finite data structures used in programming, such as lists and trees, can be obtained as initial algebras of specific endofunctors. While there may be several initial algebras for a given endofunctor, they are unique up to isomorphism, which informally means that the "observable" properties of a data structure can be adequately captured by defining it as an initial algebra.

To obtain the type List(A) of lists whose elements are members of set A, consider that the list-forming operations are:

  • nil : 1\longrightarrow List(A)
  • cons : A\times List(A)\longrightarrow List(A)

Combined into one function, they give:

  • [nil,cons] : 1 + (A\times List(A))\longrightarrow List(A),

which makes this an F-algebra for the endofunctor F sending X to 1+(A\times X). It is, in fact, the initial F-algebra. Initiality is established by the function known as foldr in functional programming languages such as Haskell and ML.

Likewise, binary trees with elements at the leaves can be obtained as the initial algebra

  • [tip,join] : A + (Tree(A)\times Tree(A))\longrightarrow Tree(A).

Types obtained this way are known as algebraic data types.

Types defined by using least fixed point construct with functor F can be regarded as an initial F-algebra, provided that parametricity holds for the type.[3]

In a dual way, similar relationship exists between notions of greatest fixed point and terminal F-coalgebra, with applications to coinductive types. These can be used for allowing potentially infinite objects while maintaining strong normalization property.[3] In the strongly normalizing Charity programming language (i.e. each program terminates), coinductive data types can be used achieving surprising results, e.g. defining lookup constructs to implement such “strong” functions like the Ackermann function.[4]

[edit] See also

[edit] Notes

  1. ^ a b Initiality and finality from CLiki
  2. ^ Induction and Co-induction from CLiki
  3. ^ a b Philip Wadler: Recursive types for free! University of Glasgow, July 1998. Draft.
  4. ^ Robin Cockett: Charitable Thoughts (ps and ps.gz)

[edit] External links

Personal tools

Visit joltnews for the latest headlines
Visit bloit.com for company information
Geed Media does computer consulting on long island.
This page viewed times. See Logs