TITLE: How many morphisms from 1 to 1+1 can there be?
QUESTION [36 upvotes]: Here is an interesting question raised by Alice Rhyl.
Let $C$ be a category with a terminal object $1$ and finite coproducts.  How many different morphisms $f : 1 \to 1 + 1$ can there be?
There are always two obvious morphisms $f : 1 \to 1 + 1$, coming from the definition of coproduct.  But if $C$ is the category with one object and one morphism, $1 + 1 = 1$ so these two obvious morphisms are equal and there's really just one.  
Can there be three different morphisms $f : 1 \to 1 + 1$?  I don't know.
There can be four.  Take $C = \mathrm{Set}^2$; then the terminal object in $C$ is $(1,1)$ (where $1$ is your favorite one-element set), and there are four different morphisms $f: (1,1) \to (1,1) + (1,1)$.  
Indeed, any power of two is possible; just take $C = \mathrm{Set}^n$.   
What other numbers are possible?  (I find finite cardinals more interesting here.)
So far $C$ has just been any category with a terminal object and finite coproducts.  In a paper I'm writing with Christian Williams, I'm more interested in the case where $C$ is a cartesian closed category with finite coproducts.  How many morphisms $f : 1 \to 1 + 1$ can there be in this case?
(All the examples I've given above are categories of this sort.)

REPLY [13 votes]: If all we want is a category with a terminal object and finite coproducts, the following works to show that any $n$ can occur. Let $R$ be a commutative ring of cardinality $n$ (for $n$ finite, it could be $\mathbb{Z}/(n \mathbb{Z})$). Let our category consist of pairs $(M, \mu)$ where $M$ is an $R$-module and $\mu$ is an $R$-module map $M \to R$, and where $\mathrm{Hom}((M,\mu),\ (N, \nu))$ is the set of $R$-module maps $\phi: M \to N$ such that $\phi \circ \nu = \mu$. Then $(R, \mathrm{Id})$ is the terminal object, and the coproduct of $(M, \mu)$ and $(N, \nu)$ is $(M \oplus N,\ \mu + \nu)$. 
So $1+1$ is $(R^{\oplus 2},\ [1\ 1])$ and $\mathrm{Hom}(1, 1+1)$ is $\left\{ \left[ \begin{smallmatrix} x \\ y \end{smallmatrix} \right] : x+y=1 \right\}$. There are $n$ solutions to $x+y=1$ in the ring $R$.
Furthermore, this category has all small limits and co-limits. Namely, let $D$ be a directed graph with vertex set $D_0$ and edge set $D_1$, and suppose we have elements $(M_v, \mu_v)$ for $v \in D_0$ and maps $\phi_e$ for edges $e \in D_1$. I claim that the co-limit is $(M, \mu)$ where $M$ is the colimit of the diagram of $M_v$ in the category of $R$-modules and the map $\mu: M \to R$ comes from the universal property of co-limits and the maps $\mu_v$. 
To compute the limit, build a new diagram in the category of $R$-modules by adding one more vertex $\infty$ to $D_0$, one edge from every other vertex to $\infty$, with $M_{\infty} = R$ and the map $M_v \to M_{\infty}$ given by $\mu_v$ for each $v$. Then I claim that the limit of our original diagram in our funny category is $(M, \mu)$ where $M$ is the limit of the new diagram in the category of $R$-modules and $\mu$ is the projection $M \to M_{\infty}=R$.

There is a very similar category which is a variety of algebras, thus fitting into Emil's answer. Let $R$ be a commutative ring of cardinality $n$. Define an $R$-affine space to be a set $A$ which, for every $k$-tuple $(r_1, \ldots, r_k)$ of elements of $R$ obeying $\sum r_j=1$, has a $k$-ary operation $\phi_{r_1, \ldots, r_k} : A^k \to A$ obeying certain conditions. The idea is that $\phi_{r_1, \ldots, r_k}(a_1, \ldots, a_k) = \sum r_j a_j$. The conditions can be found at nlab, but you have to ignore all places where they assume $R$ is a field. Basically, the axioms say that $\phi$ is invariant under permuting the $r_j$ and $a_j$ by the same permutation; that, if $a_j = a_j$, then we can replace $r_j$ and $r_k$ by $r_j+r_k$; and that we can expand nested $\phi$'s in the obvious way.
The free $R$-affine space on one element is a single point, and the free $R$-affine space on $2$ points has cardinality $|R|$.
To see the relation between this part of the answer and the part above the line, note that this is the "unbiased definition" of an affine space at nlab (except that we allow the empty set) and the part above the line 
is the "slice of Vect" definition (except that we don't require the map to $R$ to be surjective).
Useless generalizations: $R$ doesn't have to be commutative, and could be a rig (ring without negation), in which case the free $R$-affine space on two elements has cardinality $\# \{ (x,y) \in R^2 : x+y=1 \}$.