{"id":107,"date":"2006-08-09T11:51:14","date_gmt":"2006-08-09T11:51:14","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2006\/08\/09\/categorical-numbers\/"},"modified":"2006-08-09T11:51:14","modified_gmt":"2006-08-09T11:51:14","slug":"categorical-numbers","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2006\/08\/09\/categorical-numbers\/","title":{"rendered":"Categorical Numbers"},"content":{"rendered":"<p>Sorry for the delay in the category theory articles. I&#8217;ve been busy with work, and haven&#8217;t had time to do the research to be able to properly write up the last major topic that I plan to cover in cat theory. While doing my research on closed cartesian categories and lambda calculus, I came across this little tidbit that I hadn&#8217;t seen before, and I thought it would be worth taking a brief diversion to look at.<br \/>\nCategory theory is sufficiently powerful that you can build all of mathematics from it. This is something that we&#8217;ve known for a long time. But it&#8217;s not really the easiest thing to demonstrate.<br \/>\nBut then, I came across this lovely little article on wikipedia. It turns out that you can [build the natural numbers entirely in terms of categories][wikipedia] in a beautifully simple way.<br \/>\nBefore we dive into categorical numbers, let&#8217;s take a moment to remember what we really mean by natural numbers.<br \/>\nPeano Arithmetic<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nThe meanings of natural numbers are normally defined in terms of what we call *Peano arithmetic*. Peano arithmetic defines the natural numbers, **N** in terms of five fundamental axioms:<br \/>\n1. 0 &isin; **N** (0 is a natural number.)<br \/>\n2. &forall; a &isin; **N** &exist; a&#8217;=s(n), a&#8217; &isin; **N**. (Every natural number a has a successor, s(a))<br \/>\n3. &not; &exist; a &isin; **N** : s(a)=0. (No natural number has 0 as its successor.)<br \/>\n4. &forall; a,b &isin; **N**: s(a)=s(b) &rArr; a=b. (Each number has a unique successor.)<br \/>\n5.  (P(0) &and; &forall; a : P(a) &rArr; P(s(a))) &rArr; &forall; b &isin; **N** : P(b). (If a property P is true for 0; and it can be shown that for any number a, if it&#8217;s true for a, then it&#8217;s true for b, then that means that it&#8217;s true for all natural numbers. This is the *axiom of induction*.)<br \/>\nTo get to arithmetic, we need to add two operations: addition and multiplication.<br \/>\nWe can define addition recursively quite easily:<br \/>\n1. &forall; x &isin; **N**: x+0 = x<br \/>\n2. &forall; x,y &isin; **N**: s(x)+y=x+s(y)<br \/>\nAnd once we have addition, we can do multiplication:<br \/>\n1. &forall; x &isin; **N**: x * 0 = 0 &and; 0 * x = 0<br \/>\n2. &forall; x &isin; **N**: 1 * x = x<br \/>\n3. &forall; x,y &isin; **N**: s(x)*y = (x*y) + y<br \/>\nTo sum up: Peano arithmetic is based on a definition of the natural numbers in terms of five fundamental properties, called the Peano axioms, built on &#8220;0&#8221;, a successor function, and induction. If we have those five properties, we can define addition and multiplication; and given those, we have the ability to build up arbitrary functions, sets, and the other fundamentals of mathematics in terms of the natural numbers.<br \/>\nPeano Naturals and Categories<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nThe peano axioms can be captured in a category diagram for a relatively simple object called a *natural number object (NNO)*. A natural number object can exist in many categories: basically any category with a terminal object *can* have NNOs. Any closed cartesian category *does* have an NNO.<br \/>\nThere are two alternate constructions; a general construct that works for all NNO-containing categories; and a more specific one for closed cartesian categories. (You can show that they are ultimately the same in a CCC.)<br \/>\nI actually think that the general one is easier to understand, so that&#8217;s what I&#8217;ll describe. This is basically a construction that captures the ideas of successor and recursion.<br \/>\nGiven a category C with a terminal object **1**. A *natural number object* is an object *N* with two arrows z : 1 &rarr; *N*, and s : *N* &rarr; *N*, where z and s have the following property.<br \/>\n(&forall; a &isin; Obj(C), (q : 1 &rarr; a, f : a &rarr; a) &isin; Arrows(C)) : u &ordm; z = q &and; u &ordm; s = f &ordm; u.<br \/>\nThat statement means the same thing as saying that the following diagram commutes:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"cat-numbers.jpg\" src=\"https:\/\/i0.wp.com\/scientopia.org\/img-archive\/goodmath\/img_30.jpg?resize=218%2C106\" width=\"218\" height=\"106\" \/><\/p>\n<p>Let&#8217;s just walk through that a bit. Think of the object **N** as a set. &#8220;s&#8221; is successor. So S is an arrow from *N* to *N* that maps each number to its successor. *N* is &#8220;rooted&#8221; by the terminal object; that gives it its basic structure. The &#8220;z&#8221; arrow from the terminal object maps to the zero value in *N*.  So we&#8217;ve got an arrow that selects zero; and we&#8217;ve got an arrow that defines the successor.<br \/>\nThink of &#8220;q&#8221; as a predicate, and &#8220;u&#8221; as a statement that a value in *N* satisfies the predicate.<br \/>\nSo u &ordm; z, that is the path from 1 to a by stepping through z and u is a statement that the predicate &#8220;q&#8221; is true for z (zero); because composing u (the number I&#8217;m composed with satisfies q) and z (the number zero) gives us &#8220;q&#8221; (zero satifies q).<br \/>\nNow the induction rule part. *N* maps to *N* by s &#8211; that&#8217;s saying that s is an arrow from a number in *N* to its successor. If you have an arrow composition that says &#8220;q is true for n&#8221;, then f can be composed onto that giving you &#8220;q is true for n + 1&#8221;.<br \/>\nIf for all q, u is unique &#8211; that is, there is only *one* mapping where induction works; then you&#8217;ve got a categorical structure that satisfies the Peano axioms.<br \/>\n[wikipedia]: http:\/\/en.wikipedia.org\/wiki\/Natural_number_object<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sorry for the delay in the category theory articles. I&#8217;ve been busy with work, and haven&#8217;t had time to do the research to be able to properly write up the last major topic that I plan to cover in cat theory. While doing my research on closed cartesian categories and lambda calculus, I came across [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[76,43],"tags":[],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-category-theory","category-numbers"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-1J","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=107"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/107\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}