Initial algebra

Initial algebra

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 "X"→"X". 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×"X"→"X". 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.

Theorems

* Initial algebras are minimal (have no proper subalgebra), final coalgebras are simple (have no proper quotients [ [http://tunes.org/wiki/induction_20and_20co-induction.html Induction and Co-induction] from CLiki] ). [http://tunes.org/wiki/initiality_20and_20finality.html Initiality and finality] from CLiki]

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 f^n(e), that is, f(f(...(f(e))...)), the "n"-fold application of "f" to "e".

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 : 1longrightarrow List(A)
*cons : A imes List(A)longrightarrow List(A)

Combined into one function, they give:

* [nil,cons] : 1 + (A imes List(A))longrightarrow List(A),

which makes this an "F"-algebra for the endofunctor "F" sending X to 1+(A imes 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) imes 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.Philip Wadler: [http://homepages.inf.ed.ac.uk/wadler/papers/free-rectypes/free-rectypes.txt Recursive types for free!] University of Glasgow, July 1998. Draft.]

In a dual way, similar relationship exists between notions of greatest fixed point and terminal F-coalgebra, these can be used for allowing potentially infinite objects while maintaining strong normalization property. 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. [Robin Cockett: Charitable Thoughts ( [ftp://ftp.cpsc.ucalgary.ca/pub/projects/charity/literature/papers_and_reports/charitable.ps ps] and [ftp://ftp.cpsc.ucalgary.ca/pub/projects/charity/literature/papers_and_reports/charitable.ps.gz ps.gz] )]

See also

* Algebraic data type
* Catamorphism
* Final algebra

Notes

External links

* [http://www.cs.ut.ee/~varmo/papers/thesis.pdf Categorical programming with inductive and coinductive types] by Varmo Vene
* Philip Wadler: [http://homepages.inf.ed.ac.uk/wadler/papers/free-rectypes/free-rectypes.txt Recursive types for free!] University of Glasgow, July 1998. Draft.
* [http://citeseer.ist.psu.edu/rutten94initial.html Initial Algebra and Final Coalgebra Semantics for Concurrency] by J.J.M.M. Rutten and D. Turi
* [http://tunes.org/wiki/initiality_20and_20finality.html Initiality and finality] from CLiki


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Initial and terminal objects — Terminal element redirects here. For the project management concept, see work breakdown structure. In category theory, an abstract branch of mathematics, an initial object of a category C is an object I in C such that for every object X in C,… …   Wikipedia

  • algebra — /al jeuh breuh/, n. 1. the branch of mathematics that deals with general statements of relations, utilizing letters and other symbols to represent specific sets of numbers, values, vectors, etc., in the description of such relations. 2. any of… …   Universalium

  • Algebra of Communicating Processes — The Algebra of Communicating Processes (ACP) is an algebraic approach to reasoning about concurrent systems. It is a member of the family of mathematical theories of concurrency known as process algebras or process calculi. ACP was initially… …   Wikipedia

  • F-algebra — In mathematics, specifically in category theory, an F algebra for an endofunctor :F : mathbf{C}longrightarrow mathbf{C} is an object A of mathbf{C} together with a mathbf{C} morphism :alpha : FA longrightarrow A. In this sense F algebras are dual …   Wikipedia

  • Heterogene Algebra — Heterogene Algebren sind algebraische Strukturen und stellen im gewissen Sinn eine Verallgemeinerung von universellen Algebren dar. Während bei universellen Algebren von einer einzelnen Menge als Grundmenge ausgegangen wird ist die Grundmenge… …   Deutsch Wikipedia

  • History of algebra — Elementary algebra is the branch of mathematics that deals with solving for the operands of arithmetic equations. Modern or abstract algebra has its origins as an abstraction of elementary algebra. Historians know that the earliest mathematical… …   Wikipedia

  • Boolean algebra — This article discusses the subject referred to as Boolean algebra. For the mathematical objects, see Boolean algebra (structure). Boolean algebra, as developed in 1854 by George Boole in his book An Investigation of the Laws of Thought,[1] is a… …   Wikipedia

  • Boolean algebra (introduction) — Boolean algebra, developed in 1854 by George Boole in his book An Investigation of the Laws of Thought , is a variant of ordinary algebra as taught in high school. Boolean algebra differs from ordinary algebra in three ways: in the values that… …   Wikipedia

  • Boolean algebra (logic) — For other uses, see Boolean algebra (disambiguation). Boolean algebra (or Boolean logic) is a logical calculus of truth values, developed by George Boole in the 1840s. It resembles the algebra of real numbers, but with the numeric operations of… …   Wikipedia

  • Comparison of vector algebra and geometric algebra — Vector algebra and geometric algebra are alternative approaches to providing additional algebraic structures on vector spaces, with geometric interpretations, particularly vector fields in multivariable calculus and applications in mathematical… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”