TITLE: Category theory and arithmetical identities
QUESTION [31 upvotes]: My question concerns categorical "proofs" or "guessing" of arithmetical identities using category theory. I’m not at all a specialist of CT but I try to put my hands on and to understand something in this fascinating subject. Trying to prove something concrete, the exercise was to prove the identity
$$ \gcd(n,m) \cdot \operatorname{lcm}(n,m) = n\cdot m$$
Using the concepts of product and coproduct in a specific category (objects are integers and arrows is "divisibility") I've been able to prove it with very minimalistic assumptions, only the notion of divisibility of integers. No use of prime numbers or unique factorization with primes or other specific theorems like Bezout theorem, etc...
I'm wondering if someone has other examples like that one. Someone gave me the reference

Marcelo Fiore, Tom Leinster, Objects of Categories as Complex Numbers, Advances in Mathematics 190 (2005), 264-277, doi:10.1016/j.aim.2004.01.002, arXiv:math/0212377,

which is interesting but it doesn't really answer my question. In that paper, if I've correctly understood, they show that if something is true with complex numbers it is true in more general categories.
I would be interested if someone has some "simple" examples of concrete applications of CT proving or "guessing" arithmetical identities
Thanks a lot for any clue

REPLY [26 votes]: A classic paper on this topic is Andreas Blass’s Seven trees in one (1994).
It starts with the observation that there is an explicit, constructive bijection between (finite) binary trees and seven-tuples of such trees: $T \cong T^7$.  It then shows how this bijection can be obtained from the algebraic proof in $\mathbb{N}[t]$ that $t = 1 + t^2$ implies $t = t^7$.  (Here $t = 1 + t^2$ expresses the defining property of finite binary trees: “each tree is either just a leaf, or a joined pair of two trees”.)  Finally, it generalises this result, showing that polynomial identities in $\mathbb{N}[t]$ correspond to constructively-definable bijections between suitable polynomial functors on sets, or their initial algebras.