TITLE: Categorical foundations without set theory
QUESTION [47 upvotes]: Can there be a foundations of mathematics using only category theory, i.e. no set theory? More precisely, the definition of a category is a class/set of objects and a class/set of arrows, satisfying some axioms that make commuting diagrams possible. So although in question 7627, where psihodelia asked for alternative foundations for mathematics without set theory, there Steven Gubkin said that Lawvere and McCarthy did some work in reformulation the set theoretic axioms ZFC as the axioms of elementary topoi, this manner of foundations is still not complete since a category is still ultimately a set!
J Williams in his answer below noted that via metacategories, we can have a first order axiomatization of categories. However, this does not provide a foundations of mathematics using only category theory, since set theory permeates the formulation of first order logic. In first order logic, structures are sets together with constants, functions and relations. Here constants, functions and relations are also sets. So even if we say that categories are first order axiomatizable, at the very end, categories are still defined in terms of sets.
I admit in wanting foundations totally in terms of categories, then there will be some kind of recursiveness. However, this recursiveness should not be seen as a problem since as described above, first order axiomatization of sets like ZFC, are written in the language of first order logic which (at least in a meta-level) are sets themselves. In fact, this recursiveness is very much a feature of symbolic logic and is partially responsible for the successful that a single primitve concept of set/set-membership can describe so much (or all?) of mathematics.
I'm aware also in certain proofs of equivalence of categories in mainstream math, like GAGA theorems by Serre, there is a need to use categories where the objects are of classes of different levels, like the NBG set theory. In the end, the reasons provided for why the argument of using classes can be pushed down to essentially small category, this in the end invokes NBG set theory.

REPLY [26 votes]: Since Tom Leinster queries my reference to actual/completed versus
potential/incomplete infinities, maybe we should ask a philosopher
whether I am using these terms in the standard way.
In any case, I am not doing metaphysics. I am just describing the way in
which it appears to me that mathematicians actually work,
in contrast to the way they say they work because they have
been trained to say such things.
When you compare my remarks with the others on this page,
please note that they are based on thinking about these things for
myself over 25 years, originally from a categorical perspective
but increasingly influenced by symbolic logic,
and not on reciting bits of textbooks.
To do ordinary arithmetic, you may need very (arbitrarily) large
numbers, but you don't all of them together.
So far as I can gather from history, mathematicians up to the mid-19th
century managed very well to deal with things in this way,
for example defining functions as expressions.
Post-Cantor, 20th century mathematicians got into the habit of
introducing the completed infinity before the structure.
For example, we say "a group is a set with...",
relegating the essence of symmetry to second place.
This is like saying that humanity is a collection of pieces of flesh,
onto which faces are painted as an afterthought.
Categorists, being part of the pure mathematical culture,
did the same thing, in the vast majority of cases with great profit.
However, when it comes to foundations, treating the universe
first as a completed infinity (and only afterwards containing
products, function-spaces, powersets or whatever other structure
you require) inevitably leads into the set-theoretic trap.
By contrast, type theoretic methods build up the universe
by means of the actual operations that you actually want to 
consider, just as the symmetry group of the Rubik cube is built
up from individual rotations.  Moreover, despite the fact that
type theory looks completely different from category theory or
algebra, it is an accurate underpinning of the actual methods
of reasoning of mathematics.  See, for example, my discussion
of the idiom "there exists" in
my book.
This is not dogmatic Finitism or Logicism and is readily 
adaptable to considering the object $\bf N$ along with individual
natural numbers, an internal category $\bf Set$ along with 
individual types, and so on.
Now let me consider the other approaches to this question.
First order logic.
This was the first usable general technique
in mathematical logic. Like other disciplines, it starts with the
completed infinity and adds properties to it.
Does it presuppose a set theory? Well, yes, in the same sense
that a boot-loader presupposes a primitive operating system.
I would be more convinced that first-order logic is independent
of set theory if there were a branch of model theory that had
examples of structures whose carriers were topological spaces
or algebraic varieties.
In fact, first order logic can be set up in the type-theoretic
way that I have described above.
But if you're going to do that, you may as well set up the type
theory that you actually want to use.
If we're looking for a metalanguage specificaly for
categorical logic
(say, in which to construct toposes) then first order logic is
not the right structure.  It is easy to describe an internal
category in a category with all finite finits, and, by adding
more diagrams, we can talk about internal toposes too.
However, it's much more interesting to consider free
internal structures, for which we need an arithmetic universe,
although unfortunately there is next to zero literature on this topic.
Fibrations, 2-categories, etc.
None of what I have said 
contradicts the use of these categorical techniques.
I personally consider that fibrations,
and especially hyperdoctrines,
are obfuscation, but other people find them useful.
However, they organise the world,
but they do not bring it into existence,
which was the thrust of the original question.