second.
In fact, what we have done is define a category of categories and functors – the objects are categories, and the morphisms (between categories) are functors.
By studying categories and functors, we are not just studying a class of mathematical structures and the morphisms between them, we are studying the relationships between various classes of mathematical structures. This is a fundamental idea, which first surfaced in algebraic topology. Difficult topological questions can be translated into algebraic questions which are often easier to solve. Basic constructions, such as the fundamental group of a topological space, can be expressed as functors in this way, and the concept is pervasive in algebra and its applications.
Abstracting yet again, constructions are often "naturally related", a vague notion at first sight. This leads to the clarifying concept of natural transformation, a way to "map" one functor to another. Many important constructions in mathematics can be studied in this context. 'Naturality' is a principle, like general covariance in physics, that cuts deeper than is initially apparent.
Stanislaw Ulam, and some writing on his behalf, have claimed that related ideas were current in the late 1930s in Poland. Eilenberg was Polish and studied mathematics there in the 1930s. Category theory is also, in some sense, a continuation of Emmy Noether's (one of Mac Lane's teachers) work in formalizing abstract processes. Noether realized that in order to understand a type of mathematical structure, one needs to understand the processes preserving this structure. In order to achieve this understanding, Eilenberg and Mac Lane proposed an axiomatic formalization of the relation between structures and the processes preserving them.
The subsequent development of category theory was powered first by the computational needs of homological algebra; and later by the axiomatic needs of algebraic geometry, the field most resistant to being grounded in either axiomatic set theory or the Russell-Whitehead view of united foundations. General category theory, an extension of universal algebra having many new features allowing for semantic flexibility and higher-order logic, came later; it is now applied throughout mathematics.
Certain categories called topoi (singular topos) can even serve as an alternative to axiomatic set theory as a foundation of mathematics. These foundational applications of category theory have been worked out in fair detail as a basis for, and justification of, constructive mathematics. More recent efforts to introduce undergraduates to categories as a foundation for mathematics include Lawvere and Rosebrugh (2003) and Lawvere and Schanuel (1997).
Categorical logic is now a well-defined field based on type theory for intuitionistic logics, with applications in functional programming and domain theory, where a cartesian closed category is taken as a non-syntactic description of a lambda calculus. At the very least, category theoretic language clarifies what exactly these related areas have in common (in some abstract sense).
A category C consists of the following three mathematical entities:
From these axioms, it can be proved that there is exactly one identity morphism for every object. Some authors deviate from the definition just given by identifying each object with its identity morphism.
Relations among morphisms (such as fg = h) are often depicted using commutative diagrams, with "points" (corners) representing objects and "arrows" representing morphisms. The influence of commutative diagrams has been such that "arrow" and morphism are now synonymous.
Functors are structure-preserving maps between categories. They can be thought of as morphisms in the category of all (small) categories.
A (covariant) functor F from a category C to a category D, written F:C → D, consists of:
such that the following two properties hold:
A contravariant functor F: C → D, is like a covariant functor, except that it "turns morphisms around" ("reverses all the arrows"). More specifically, every morphism f : x → y in C