Every preorder $(P,\leq)$ can be regarded as a category. The object set is $P$, and a morphism $x \to y$ exists (and is unique) iff $x \leq y$. These are precisely those categories in which every diagram commutes. But still, it is interesting to apply category theory to preorders. A limit is just an infimum, a colimit is a supremum. In particular, initial (terminal) objects are least (largest) elements. Monotonic maps are just functors. Galois connections are just adjunctions between preorders.
We can define ideals and prime ideals in $P$. If $p \in P$ is an element, one says that $p$ is a meet prime iff the generated ideal ${\downarrow}p$ is a prime ideal, i.e. iff $p$ is not the largest element and $\inf(x,y) \leq p$ implies $x \leq p$ or $y \leq p$.
If $P = \mathbb{N}^+$ and $\leq$ is the relation of divisibility reversed(!), then prime elements are precisely the usual prime numbers. You can omit this reversion by looking at join prime elements.
More generally, if $P$ is the preorder of ideals of a ring $R$, ordered by inclusion, then prime elements are precisely the prime ideals of $R$ in the sense of ring theory.
One can generalize many notions of number theory / ring theory to preorders resp. lattices (see Wikipedia for a start; I have also found many papers by a quick google research). In order to answer your interesting question "That is, can one explain (or at least motivate) deeper ideas in elementary number theory in terms categorical language?" I would like to see an explicit "deeper idea in elementary number theory" first - then we may try to explain it in category-theoretic terms (although I doubt that we will gain anything from that).
That's a question. Well for start as shown in Mac Lane Categories for the working mathematician there are two different way to approach categories, functor and natural transformations:
- you can either regard categories as some family of sets and operation between them (eventually adding some axioms to set theory since you would like to work with large collections like the class of all sets)
- or you can define categories as those structures which satisfy the axioms of the elementary theory of categories, which is a theory in first order (multi sorted) logic.
Of course if you use as meta-theory ZFC (actually at least NBG for the size problems I've mentioned above) then the two definition are essentially the same, and so you can see category theory as a theory developed inside set theory.
Nonetheless just because we can interpret the axioms of category theory inside a set theory doesn't mean that we have to do so. Indeed we can interpret category theory axioms in other foundational theories such as dependent type theory.
From another perspective if we add to the axioms of category some other axioms we can get the first order theory of a topos with some other stuff (natural number object, axiom of choice [expressed as the property that every epimorphism is split]...) we get the axioms that characterize a category with enough structure to be almost equivalent to $\mathbf{Set}$, the category of sets and functions between them. In such theory we can develop all the usual constructions of set theory and so this theory (of a special category) can be used as a foundational theory itself.
So we have two ways to look at categories: as structures in set theory and as theories of structures, some of which can be used to rebuild mathematics.
This second way to look at category theory is really interesting in particular in connection with the study of constructive mathematics, since the theory of particular categories allows one to build constructive foundational theories, and category theory gives also the means to compare and study these theories.
I could say more but I don't want to be too long. Here are some references:
the two definitions of category (axiomatic vs set-theoretic) can be found in Mac Lane's Categories for the working mathematician
for the use of category theories as a foundational theories I suggest you take a look to this short post of Leinster and his related paper on arxiv.
For more about the interaction between category theory and set theory you can also google a little bit, some keywords for the research could be categorical logic, topos theory, foundation of category theory, category theory as foundational theory.
Hope this helps.
Best Answer
$\require{AMScd}$You can define natural numbers as follows (or in a similar programming language that supports the same structures you need; I'm using Haskell because this comes from a lecture I gave):
You don't have to really understand what's going on, if you are not familiar with Haskell. This is just the way you tell Haskell that a new data type, called
N
contains terms ("elements") of two possible kinds: eitherZ
(zero, of course), or an element of the formSuc n
for another $n\in \mathbb N$.This defines the type of natural numbers: there is nothing else inside $\mathbb N$ other than $0,1=Suc\; 0,2=Suc\; (Suc\; 0),\dots$; from this it follows basically everything you know about the natural numbers. For example, the
plus
function can be defined "by induction", because in order to definen m +
you only have to tell me what is0 m +
and what is(Suc n) m +
; all else follows. So:This works: for example,
1 1 + = 2
:So far so good. We can define things using induction. But what happened exactly? Category theory is helpful to understand it.
Define a category $\textsf{Dyn}$ whose objects are triples $(X, t : X \to X,x : X)$, i.e. diagrams $$ \begin{CD} 1 @>>x> X @>>t> X \end{CD} $$ and morphisms between $(X,t,x)$ and $(Y,g,y)$ consist of functions $u : X \to Y$ such that $u(x)=y$ and $u\circ t=g\circ u$, i.e. of commutative diagrams $$ \begin{CD} 1 @>>x> X @>>t> X \\ @| @VuVV @VVuV \\ 1 @>>y> Y @>>g> Y \end{CD} $$ The object $\mathbf{N}=(\mathbb{N}, \text{s} : \mathbb N \to \mathbb N, 0 : \mathbb N)$, or rather the type
N
of the type declaration above, belongs to this category if we let $\text{s}$ be the functionSuc :: N -> N
sending a natural number to its successor.Let $\mathbf{X} = (X,t,x)$ be any object of $\sf Dyn$; then, there is an arrow $u : \mathbf N \to\mathbf X$ in $\sf Dyn$ such that $$ \begin{CD} 1 @>>z> \mathbb N @>>> \mathbb N \\ @| @VuVV @VVuV \\ 1 @>>x> X @>>t> X \end{CD} $$ This means that given an initial value $u(0)=x$ and any endomorphism of the set $X$, there is a unique possible way to define a sequence of element $u(n)$ of $X$ recursively, by setting $u(0) = x$ and $u(n+1) = t(u(n))$.
Moreover, such a function $u$ is unique with respect to this property; if there is another sequence $v : \mathbb N \to X$ with the same property, the equality of $u,v$ can be assessed ``by induction'' using $t$: $u(0)=v(0)=x$, and $u(n+1)=t(u(n))=t(v_n)=v(n+1)$. This means precisely that $\bf N$ is an initial object of the category $\textsf{Dyn}$.
The category $\sf Dyn$ models the notion of a discrete dynamical system: a set $X$ and an initial state $x : X$ are given, together with a function $t : X \to X$ mapping evolution of the system in discrete time, according to the function $t$.
This universal property amounts exactly to the request you see in the Wikipedia page.