Many interesting mathematical patterns are based on
relationships between objects rather than whatever concrete meaning is
found inside those objects.

Category theory focuses on this external viewpoint,
illustrated by the description of sets solely in terms of the
functions between them (such is
the prototypical example of a category,
called Set, presented below).

Category theory is an enlightening way to describe mathematical structures.
Over its first 70 years of existence, it has proved very useful for
formulating the general concepts worth studying.
A more controversial and problematic aspect
is the effort to turn category theory into an axiomatic alternative to
set theory as the logical foundation of all mathematics...

Definition of a category :

A category consists of two classes
respectively dubbed objects and arrows
(or morphisms ) obeying the four postulates below.
(Traditionally, the names of objects are in UPPERcase; arrow names are in lowercase.)

Any arrow f goes from a source object A
to a target object B.
(If f is called a morphism, A is its
domain and B is its codomain.)

A

f

B

A well-defined composition operator exists among arrows:
For every arrow f from A to B and
every arrow g from B to C, their composition
gof
(pronounce
"g after f ") is an arrow from A to C.

Such an identity is necessarily unique (the proof is an easy exercise).

Diagrams and commuting diagrams :

A triangle formed by three objects (vertices) and three arrows (edges)
is said to commute
when the arrow going from the double source to the double target
is actually the composition of the other two.
Our last postulate about the existence of an identity arrow for every object B
could thus be expressed by stating that the following two triangles commute :

A

f

B

B

1B

1B

g

f

B

B

C

g

More generally, a diagram is said to commute when
the compositions of displayed arrows along two distinct paths
sharing the same origin and the same destination are always equal.
The simplest examples are just terser versions of the previous triangular diagrams:

A

f

B

B

g

C

1B

1B

Beyond introductory material like the above,
the loops corresponding to identity arrows are almost never displayed.
They're just always understood to be there. Their "trivial" presence
can neither impede nor facilitate the commuting of a diagram.

The founders of category theory (Mac Lane and Eilenberg)
have stressed that the entire structure of a category
resides in its arrows (every object being adequately represented by its identity arrow).
There's actually no need to display both an object and its identity.

All the diagrams we've drawn so far have been commuting ones,
but a diagram can be drawn and discussed even when it's not
known a priori to commute
(one purpose of such a discussion might be to show a posteriori
that the displayed diagram does commute).

Arguably, the simplest conceptual example of a category is the Set
category (see next section).
Unfortunately, it can be an intimidating example because its objects are so numerous that
they don't even form a set (there no such thing as a set of all sets).
Familiarity with the basic concepts described so far can be gained with a few categories
which have only finitely many objects and finitely many arrows...

The simplest category is the empty category or zero category, denoted
0 (bold zero). It has no objects and no arrows.

The categories 1 (one)
consists of one object and one identity arrow.
Likewise, the category 2
(two) has two objects and a total of three arrows:

A

A

f

B

1A

1A

1B

Both of those diagrams show all objects and arrows.
Beyond this point, we'll no longer show the identities. The category
3 (three) has three objects and six arrows but we only show
the three that are not identities:

(2014-11-25)
The Set category:The objects are sets. The morphisms are all the
functions between sets.

The abstract algebra of functions thus defines the category of sets.
The notion of cardinality emerges (the notion of membership is obfuscated).

The composition
of two functionsf and g,
denoted fog
(and commonly pronounced
"f after g ") is the function defined by the equation:

fog (x) =
f ( g (x) )

(2014-11-26)
RelThe objects are sets and the arrows are
relations between them.

By definition, a
relation between two sets is a part of their cartesian
product. The composition of two relations is the relation which
contains (x,z) if ans only if there is an element y
such that (x,y) is in the first relation and (y,z)
in the second.

Sets and relation form a large category, denoted Rel,
of which the previous category of sets and functions
(Set) is just a subcategory.

(2014-11-24) Examples of CategoriesCategories, large and small, abstract or concrete.

A category is said to be small when its objects and its arrows
both form sets. Conversely, when either type of constituents form a
properclass,
a category is said to be a large category.
For example, the Set category is large, because
the collection of all sets is a proper class (not a set).

A large category is said to be locally small when, for any pair
of its objects X and Y, the morphisms from X to Y
form a set, denoted Hom(X,Y).

A large category can be neither a member of a class nor a component
(i.e., object or arrow) of a category.

Some militant category theorists are satisfied to consider categories as
"useful fictions" and cannot be bothered with fundamental considerations
or logical paradoxes.
They will gladly consider monsters like the category of all categories
where objects and/or arrows don't even form classes. I beg to differ here.

To prevent foundational queezes, we could only consider
small categories and a finite number of large ones, including
the well-established large categories listed below
(with a standard name, normally capitalized and printed in bold type).
Feel free to add your own...

A category is a subcategory of another when
all the objects (resp. arrows) of the former
are objects (resp. arrows) of the latter.
For example, Set is a proper
subcategory of Rel (since all functions are relations).
So is Sym.

By definition, a concrete category is a subcategory of Set.
Neither Rel nor Sym are concrete categories.

Some small categories capture just one instance of a mathematical structure

A functor from a category to another maps objects and arrows of the first
respectively to objects and arrows of the second, while preserving
domains and codomains, identities and composition of arrows.

The opposite of a category C is the category Cop
whose objects are the same as C and whose arrows are opposites
of the arrows of C (the opposite of an arrow from A to B is an arrow
from B to A).

(2014-11-26)
Isomorphisms (or equivalences ) in a categoryIsomorphisms are invertible arrows. In a groupoid, that's all there is.

In a category, an arrow (morphism) f
from A to B is said to be an isomorphism if there
is an arrow g from B to A such that:

gof = 1Afog = 1B

For example, in the Set category, the isomorphisms
are the bijections.

In a monoid category M
(corresponding to a single-object category whose morphisms are labeled with the elements of
the monoid) the isomorphisms are
simply the invertible elements
(which form the group M*).

A category whose arrows are all isomorphisms is called a groupoid.
(Some authors use the word groupoid
to denote a magma. I don't.)

Historically, this was the first example of a universal mapping property,
characterizing a unique kind of equivalent objects
in term of all possible morphims between objects in a given category...

The object X is a product of two objects
A1 and A2 when there are two morphisms
(called canonical projections)
p1 and p2 of source X
and of respective targets A1 and A2 such that,
for any domain Y and any two morphisms of source Y and respective targets
A1 and A2 , there is a unique
morphism f from Y to X which makes this diagram commute:

Y

f1

f2

f

A1

X

A2

p1

p2

In this, the convention is used that a dotted line indicates uniqueness
(i.e., no other arrow has the same source and target as a dotted arrow).

When an object X is a product, we observe that 1X
must be the only arrow from X to X.
(HINT: Consider Y = X.)

As is usual with constructions based on such a universal mapping property,
the above product X may not be uniquely defined, but if there is another
satisfactory object X' with the same property, then there's an
isomorphism between X and X'.
Indeed, consider the counterpart of the above for X',
which is a commuting diagram valid for any choice of Z,
g1 and g2 :

The name of the concept and/or early attempts at defining it can be traced
to Saunders Mac Lane (1948) and to two doctoral
sudents of Eilenberg, namely
Alex Heller (1950)
and David Buchsbaum (1954).
This was neatly finalized by
Grothendieck in 1957.

(2014-12-04)
Category Theory vs. Set TheoryWhich one would provide the best foundation for Mathematics?

Categoricians have, in their everyday work, a clear view of what could lead to
contradiction, and [they] know how to build ad hoc safeguards.Jean Bénabou
(1985)

The situation hasn't changed much since Bénabou
published the above words...
When consistency isn't vouched for by the "safe" framework
of set theory, categorial arguments are only convincing
for those who have acquired the expertise Bénabou refers to.
Since the value of any mathematical argument resides in its ability to convince
nonexperts, it would be highly desirable to have a consistent logical foundation
for full-blown category theory (covering the actual practice).
Otherwise, the belief cannot be dismissed that category theory is just a discovery tool,
not a language for expressing ultimate proofs.
Other theories which are now fully accepted once had a similar status
(infinitesimal calculus being just one example).

Besides Jean Bénabou, one of the few opponents of set-based
Bourbakism within French Academia was
Roger Apéry (1916-1994)
who was an early advocate of category theory.

As sets are just the objects of a specific category,
it can be tempting to view categories as more fundamental than sets themselves.

In the late 1950's,
the Bourbaki group
pondered that fact, halfway through
its monumental work of describing much of mathematics in terms of set theory.
They considered the possibility of adopting the categorial viewpoint instead,
at the great cost of rewriting previously published work and
jeopardizing the entire project by diverting the energies of the participants.

"Sergent" presumably refers to Pierre Sergent
(Ulm, 1949).
Cartier describes him as "active" in the Bourbaki group at the time, implying that
he was never made a full member.

Cartier doesn't say which side of the fence
Eilenberg was on, possibly because Eilenberg was
rarely in France at the time...

Charles Ehresmann (who developed his own flavor of category theory after 1957)
had left Bourbaki in 1950, for obscure reasons
(his second wife, the categorician Andrée Ehresmann, is on record
as stating that the Bourbaki project had already lost much of its original appeal by that time).