TITLE: A categorical method to, say, determine the cardinality of a group
QUESTION [10 upvotes]: I am trying to figure out how much one can figure out about an object using category theory. Ideally, any property that is well defined up to isomorphism should be computable using only category theory. Let us say that we are trying to figure out how many elements are in a group? For a set, we could "simply" count the morphisms to it from the terminal object. Obviously, this wouldn't work. Is there a "categorical" method to find the cardinality of a group? If one wants a rigorous definition of what I mean by "categorically", here is your compass and straightedge:

You have an abstract symbol for the object in question.
For any two abstract symbols for objects $G$ and $H$, you can get abstract symbols for $Hom(G,H)$
For any abstract symbol for an object $G$, you can get the abstract symbol for $id_G$.
For any two abstract symbols for morphisms $f$ and $g$ such that $f \circ g$ is defined, you can get the abstract symbol of $f \circ g$
In terms of the objects and morphisms for abstract symbols you already have, you can get the abstract symbol of any object that uniquely (up to isomorphism) satisfies a given universal property (if needed, I can clarify this.)

Using a finite number of steps, I am trying to find the cardinality of the group. Note for example, you can't take the forgetful functor from $Grp$ to $Set$ (since you can't compute a functor on an abstract symbol.)
I am thinking one method would be to count how many automorphisms there are, but am I not sure how to get the cardinality of the group from this.
If these set of "rules" are too restrictive, it would be interesting to see how they could be lightened to make it possible.

REPLY [6 votes]: A bunch of bits and pieces from a bunch of people:
Let us say we are trying to find the cardinality of the Group $G$. First, we select the group, $\bullet$ (unique up to isomorphism) such that for any other group, there is a unique arrow in and out of $\bullet$. Now, we select a group $\mathbb{Z}$, unique up to isomorphism, such that it only has two idempotent homomorhpisms, and it admits at least two morphisms to any other group besides $\bullet$ (thanks Todd Trimble). Now we find how many morphisms there are from $\mathbb{Z}$ to $G$ (special thanks to Steven Gubkin). This is $|G|$.
Proof
The group $\bullet$ is the trivial group. Now, the group $\mathbb{Z}$ of integers satisfies the properties above via the proof here. Now, for any other group $H$ which satisfies the properties, we know that there is a nontrivial morphism $f : H \rightarrow \mathbb{Z}$. Now the image of $f$ will be a group of integers, and so must be multiples of a given integer $n$ (which won't be zero since $f$ is nontrivial.) We can take a map from this to all the integers, so that we can turn $f$ into a surjection $\bar f$. Now, we make a morphism from $\mathbb{Z}$ to $H$, $i$, such that $i(1) = x$ for some $\bar f(x) = 1$.
Since $\bar f(i(n)) =\bar f(x+x+x+\dotsb)=\bar f(x)+ \bar f(x)+ \bar f(x)+\dotsb=1+1+1+\dotsb=n$, $\bar f \circ i = id_\mathbb{Z}$. This means that $i \circ \bar f$ is idempotent, and since $i(\bar f(x)) = x$, it is not the zero morphism. Since $H$ has only two idempotents (the zero morphism and $\operatorname{id}_H$), and $i \circ \bar f \neq 0$, $i \circ \bar f = id_H$. (Thanks Slade.) Therefore they are inverses. Therefore we can select $\mathbb{Z}$ up to isomorphism.
For each element of $G$, $x$ we make a morphism from $\mathbb{Z}$ to $G$, $h$, such that $h(n) = n * x$. Also, for any morphism $h: \mathbb{Z} \rightarrow G $, $h(n) = n * h(1)$, where $h(1)$ is an element of $G$. Therefore, the morphisms between the integers and $G$ are in one to one correspondence with the elements of $G$. Therefore $|\operatorname{Hom}(\mathbb{Z}, G)| = |G|$.
$\square$