{"id":549,"date":"2007-11-19T14:53:08","date_gmt":"2007-11-19T14:53:08","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/11\/19\/from-sets-to-arithmetic\/"},"modified":"2007-11-19T14:53:08","modified_gmt":"2007-11-19T14:53:08","slug":"from-sets-to-arithmetic","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/11\/19\/from-sets-to-arithmetic\/","title":{"rendered":"From Sets to Arithmetic"},"content":{"rendered":"<p> Even though this post seems to be shifting back to axiomatic set theory, don&#8217;t go thinking that we&#8217;re<br \/>\ndone with type theory yet. Type theory will make its triumphant return before too long. But before<br \/>\nthat, I want to take a bit of time to go through some basic constructions using set theory.<\/p>\n<p> We&#8217;ve seen, roughly, how to create natural numbers using nothing but sets &#8211; that&#8217;s basically what<br \/>\nthe ordinal and cardinal number stuff is about. Even doing that much is tricky &#8211; witness my gaffe about<br \/>\nordinals and cardinals and countability. (What I was thinking of is the difference between the &epsilon; series in the ordinals, and the &omega; series in the cardinals, not the ordinals and cardinals themselves.) But if we restrict ourselves to sets of finite numbers (note: sets of finite numbers, <em>not<\/em> finite sets of numbers!), we&#8217;re pretty safe.<\/p>\n<p> Of course, we haven&#8217;t defined arithmetic &#8211; we&#8217;ve just defined numbers. You might think it would be<br \/>\npretty important to define arithmetic on the numbers. If you thought that, you&#8217;d be absolutely<br \/>\nCorrect. So, that&#8217;s what I&#8217;m going to do next. First, I&#8217;m going to define addition and subtraction &#8211; multiplication can be defined in terms of addition. Division can be defined in terms of multiplication<br \/>\nand subtraction &#8211; but I&#8217;m going to hold off on defining division until we get to rational numbers.<\/p>\n<p><!--more--><\/p>\n<p> If we want to define arithmetic, first we need to define what it is. What is natural number addition?<\/p>\n<p> It&#8217;s a total function from a pair of integers to a single integer. <\/p>\n<p> One problem: what&#8217;s a function? We haven&#8217;t really defined functions yet. We know about<br \/>\nsets, we know about logical predicates, and we&#8217;ve constructed the natural numbers. But we haven&#8217;t said anything about functions. So before we can define addition, we need to define functions.<\/p>\n<p> In set theory, a function is a special kind of relation. A relation, in turn, is a set of<br \/>\nordered pairs. For a relation, r, r = {(x,y) : R(x,y))}. In other words, a relation<br \/>\nis really a name for a predicate over the set of all ordered pairs that describes a relationship<br \/>\nbetween x and y &#8211; a two-parameter predicate. A function is a relation where, for any x, there is<br \/>\n<em>no more<\/em> that one pair with any given value of x in its first position. If f is a function,<br \/>\nand (x,y)&isin;f, then we can also write y=f(x). This is called <em>application syntax<\/em>.<\/p>\n<p> That sounds a tad confusing: but just look at a simple example. Say that we want a function<br \/>\nfrom the members of the set {1, 2, 3, 4} to itself.  We could write one such function as f = {(1,2), (2,3), (3,4), (4,1)}. Then f(2) just means the second member of the pair in f that starts with 2: f(2)=3.<\/p>\n<p> We&#8217;ve still got a problem, though. What&#8217;s an ordered pair? We&#8217;ve only built sets and numbers; we&#8217;ve defined functions in terms of these &#8220;ordered pair&#8221; things, but we can&#8217;t use that definition until we&#8217;ve got pairs.<\/p>\n<p> The naive thing to do is to say that a pair is a set: (x,y) = {x,y}. But that doesn&#8217;t work:  (x,y)&ne;(y,x), but {x,y}={y,x}. There&#8217;s no notion of ordering in sets, but an ordered pair is ordered &#8211; that&#8217;s why it&#8217;s called an ordered pair! So we need some way of distinguishing between the first and second<br \/>\nvalues in an ordered pair, <em>without<\/em> any notion of ordering. It turns out to be pretty easy: (x,y) = {x,{x,y}}. There&#8217;s a set with two values, and one of them is a subset of the other. So we can recognize the one that&#8217;s the first element, because it&#8217;s the value that&#8217;s an element of the other; and then we can look at the other set, and see what value is inside of it besides the first one.<\/p>\n<p> Let&#8217;s look at a quick example. Suppose we wanted the ordered pair (2,1).<br \/>\nIn set form, 2 = {&empty;,{&empty;}}, and 1 = {&empty;}. So the ordered pair (2,1) would be the set<br \/>\n{2,{1,2}}. (Or expanded, {{&empty;,{&empty;}}, {{&empty;}, {&empty;,{&empty;}}}}). So if we were given<br \/>\nthe set {{1,2},2}, and we knew it was an ordered pair, then we could look at it, and say there are two<br \/>\nmembers, a and b. a = {1,2}; b = 2. b&isin;a, so b=2 is the first element of the pair. a = {1,2}, so<br \/>\nthe second element of our ordered pair is the member of a that is different from b, so the second element of the pair is 1. What if the pair is something like (1,1)? Then the set form is {1,{1}}, and since<br \/>\none element is a member of the other, and the other has only one element, then we know it&#8217;s an equal pair.<\/p>\n<p> That gives us ordered pairs &#8211; and therefore relations, and therefore functions.<\/p>\n<p> Now we&#8217;ve got the hardware we need. To define arithmetic, we&#8217;re going to define<br \/>\nfunctions for the operations. We <em>don&#8217;t<\/em> need to say how to do them: we just need<br \/>\nto define their meaning. You&#8217;ll see what I mean by that in a minute. <\/p>\n<p>If A is a natural number, then by our construction of the natural numbers, we know<br \/>\nhow to increment it. We&#8217;ll define our functions using that.<\/p>\n<p> <b>Addition: <\/b> Addition is a function from a pair of numbers to a number. So it&#8217;s<br \/>\na set of ordered pairs, whose first element is an ordered pair. So it&#8217;s a set of<br \/>\npairs of the form {((x,y),z) where:<\/p>\n<ol>\n<li> if x=0, then z = y<\/li>\n<li> if y=0, then z=x<\/li>\n<li> otherwise, let x&#8217; = successor(x) and let y&#8217; = predecessor(y) then z = Add(x&#8217;,y&#8217;).<\/li>\n<\/ol>\n<p> That last line is a simple example of what I was talking about. We don&#8217;t worry<br \/>\nabout how to do it; we just define things in terms of logical relation. We know<br \/>\nthat every number has a successor. Because every number has a successor, every number<br \/>\nexcept 0 has a predecessor. We don&#8217;t need to say how to get it &#8211; we just know that<br \/>\nit exists, and for the purposes of defining what addition means, that&#8217;s good enough.<br \/>\nSubtraction is a better example of that. x-y is the set {((x,y),z) | ((z,y),x)&isin;Add} &#8211;<br \/>\nthat is, x-y=z if and only if z+y=x. That doesn&#8217;t tell us anything about how to subtract,<br \/>\nbut it does define what subtraction means.<\/p>\n<\/p>\n<p> <b>Multiplication:<\/b> multiplication is very similar, and relies on addition. Multiply is<br \/>\na set of ordered pairs, just like addition: Mult = {((x,y),z)} where:<\/p>\n<ol>\n<li> If x = 0 or y = 0 then z = 0.<\/li>\n<li> If y = 1 then z = x<\/li>\n<li> Otherwise, z = Add(y, Mult(predecessor(x),y))<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Even though this post seems to be shifting back to axiomatic set theory, don&#8217;t go thinking that we&#8217;re done with type theory yet. Type theory will make its triumphant return before too long. But before that, I want to take a bit of time to go through some basic constructions using set theory. We&#8217;ve seen, [&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":[43,56],"tags":[],"class_list":["post-549","post","type-post","status-publish","format-standard","hentry","category-numbers","category-set-theory"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-8R","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/549","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=549"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/549\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=549"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}