Solution (source code)

= Solution

A <semi-additive category> has <commutative-monoid enrichment>: each <hom-set> is a <commutative monoid>, and <composition in a category> preserves addition and zero in each variable. In the finite-biproduct convention, which we use here, it also has finite <products in a category> and <coproducts in a category>. A <preadditive category> has <abelian groups> as its <hom-sets>, with composition additive in each variable; this definition alone does not require finite <products in a category> or a <zero object>.

Let $P=\prod_{i=1}^n A_i$ with projections $p_i$. Define $i_j:A_j\to P$ by $p_i i_j=1_{A_j}$ for $i=j$ and $p_i i_j=0$ otherwise. Bilinearity gives
$$
p_k\left(\sum_j i_jp_j\right)=p_k,
$$
so product uniqueness gives $\sum_j i_jp_j=1_P$. For a family $f_j:A_j\to X$, set $f=\sum_j f_jp_j$. Then $fi_j=f_j$. If $h:P\to X$ has the same restrictions, $h=h\sum_j i_jp_j=\sum_j f_jp_j=f$. Thus the <product in a category> is also the <coproduct in a category>, with its canonical injections. Conversely, the analogous construction from a finite <coproduct in a category> gives projections and the same identities, proving that it is a <product in a category>.

For the empty family, a <terminal object> $T$ has a singleton endomorphism monoid, so $1_T=0$. Every map $T\to X$ equals its composite with $1_T=0$, hence equals the zero map; this map exists by enrichment. Therefore $T$ is also an <initial object>, a <zero object>. The dual argument applies to an <initial object>. Consequently \b[finite <products in a category> and <coproducts in a category> coincide canonically as <biproducts>], including the nullary case.