{"id":553,"date":"2007-11-29T15:54:58","date_gmt":"2007-11-29T15:54:58","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/11\/29\/from-sets-to-numbers-climbing-up-to-the-rationals\/"},"modified":"2007-11-29T15:54:58","modified_gmt":"2007-11-29T15:54:58","slug":"from-sets-to-numbers-climbing-up-to-the-rationals","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/11\/29\/from-sets-to-numbers-climbing-up-to-the-rationals\/","title":{"rendered":"From Sets to Numbers: Climbing Up to the Rationals"},"content":{"rendered":"<p> When last we left off, I&#8217;d used set theory to show how to construct the natural numbers; and then from the natural numbers, I showed how to construct the integers. Now, we can take the next step in building<br \/>\nup the full tower of numbers, showing how if we&#8217;ve got the natural numbers defined in sets, we can define<br \/>\nthe rational numbers using sets and our constructed integers.<\/p>\n<p><!--more--><\/p>\n<p> Before getting in to that, one question that generally strikes people around this level of<br \/>\nconstruction is that we&#8217;ve got a big stack of constructions here. We&#8217;ve got basic sets, which aren&#8217;t numbers. We&#8217;ve got special sets, which we&#8217;re using to represent natural numbers. Then we&#8217;re using the set-based natural numbers as representations of integers. And now, we&#8217;re going to start building more things using the integers. So we&#8217;ll be building a kind of number using a pair of other numbers, which are represented as another kind of number, which is represented with a fairly complicated set construction. So how do we tell all of these things apart?<\/p>\n<p> There are two answers to that: the mathematician&#8217;s answer, and the computer scientist&#8217;s answer.<\/p>\n<p> The mathematicians answer is: who cares? At any given point in time, we&#8217;re talking about one specific construction, and <em>only<\/em> that construction. So, for example, we&#8217;re talking about rational numbers,<br \/>\nwe can just assume that every value we see is a rational number. The logic by which we discuss things<br \/>\nkeeps them separate: we only talk about rational numbers using predicates on rational numbers. We don&#8217;t use integer predicates when we&#8217;re working with rationals, etc. We know what we&#8217;re talking about, and we simply <em>don&#8217;t<\/em> break our abstraction by treating a value that is understood to be an integer<br \/>\nas if it were a natural number, even though we may be using a construction where the integer is represented by a rational number.<\/p>\n<p> The computer scientist&#8217;s answer is that we can define representations to allow us to know what things are. So we can modify representations a bit. Every number, we&#8217;ll represent as an ordered pair. The first element of that pair is a natural number, which is a type identifier. The second element of that pair is the actual numeric representation that we&#8217;ve discussed before. So we can say that (0,X) means &#8220;X&#8221; interpreted as a natural number, (1,X) means &#8220;X&#8221; interpreted as an integer, (2,X) means &#8220;X&#8221; interpreted as<br \/>\na rational, and so on. For each new type of number we can construct, we just assign it a new numeric identifier. So every number is a pair of a natural number and something else, which we interpret according to the value of the first element. We can then encode that into the predicates &#8211; so natural number addition is only defined for numbers where the first element of the pair is &#8220;0&#8221;; rational addition is only defined for numbers where the first element is &#8220;2&#8221;. With this, we have a way of guaranteeing the<br \/>\nseparation that the mathematicians handwave: we can define things so that it&#8217;s impossible to use the<br \/>\ninteger subtraction operator on natural numbers.<\/p>\n<p> So, back to constructing numbers. We&#8217;re up to the point of constructing the rational numbers.<\/p>\n<p> How can we define rational numbers? The naive thing is to say:<br \/>\ngiven any two natural numbers N and M, the pair (N,M) is the rational number N\/M. And that <em>is<\/em> true: N\/M is always a natural number. But: that&#8217;s not a good definition. Because in our understanding of rational numbers, 1\/2, 2\/4, 3\/6, 4\/8, 5\/10, &#8230; are all <em>the same rational number<\/em>. But the simple construction of (N,M) will give us an infinite number of rationals, all of which are just different<br \/>\nversions of the same value, 1\/2.  So that basic set that we can define, the set of (N,M) values that<br \/>\nrepresent (N\/M), we&#8217;ll call <em>ratios<\/em>.<\/p>\n<p> What we need to do is group together the equivalent ratios, to give us a single set to represent each<br \/>\nrational number. So we want to create <em>equivalence classes<\/em> over the set of ratios. So formally, we<br \/>\ncan say that we&#8217;re going to partition the set of ratios into sets where for any set S, two values A\/B and<br \/>\nC\/D are in S if and only if A\/B and C\/D are indistinguishable using the operations of rational arithmetic.<br \/>\nOf course, that&#8217;s sort of circular: we can&#8217;t define rational arithmetic until we&#8217;ve defined the set of<br \/>\nvalues it operates on, but we&#8217;re defining the values in terms of the semantics of the operations. That&#8217;s<br \/>\nnot a problem: we&#8217;re working in the land of logic. So long as we ensure that the defined operations have<br \/>\nthe properties we need to determine when two values are equivalent, we can for now just say that there<br \/>\n<em>is<\/em> a set of such equivalence classes.<\/p>\n<p> That&#8217;s not a particularly satisfying solution to some of us. For those of you who, like me, like to see things be just a bit clearer, we can define a set of equivalence classes where for any two values A\/B and C\/D, they are in the same equivalence class if and only if A&times;D = B&times;C using integer arithmetic.<\/p>\n<p> So in terms of set theory, each rational number is actually an equivalence class containing an infinite number of members! To simplify things, we&#8217;ll describe each rational by a <em>representative<\/em>: a single canonical member of the rational&#8217;s equivalence class. The natural choice is the <em>simplest<\/em> member of the set: that is, the member A\/B for whom A and B share no integral divisors except &#8220;1&#8221;.<\/p>\n<p> Then we need to define arithmetic on the rationals. Once again, one of the nice things that we<br \/>\ncan do in set theory is define arithmetic operations using logical predicates &#8211; we don&#8217;t need to<br \/>\ndescribe a procedure.<\/p>\n<p> So, for example, given two rationals Y=A\/B and Z=C\/D, Y&times;Z = (A&times;C)\/(B&times;D). That&#8217;s pretty close to an operational definition &#8211; but it will frequently result in a value which is <em>not<\/em> the representative of its equivalence class. We won&#8217;t let that bother us: we know that it <em>is<\/em> a member of an equivalence class, and we don&#8217;t need to say how to find the representative, and so there <em>is<\/em> an equivalence class containing that number, and that equivalence class has a representative. So that&#8217;s all we need to say about multiplication.<\/p>\n<p> In the case of the rationals, defining addition is actually harder that defining multiplication. But<br \/>\nonce again, we have the advantage that we don&#8217;t need to say precisely how. Given two rationals,<br \/>\nthe sum of (A\/B)+(C\/D) is a rational G\/E where E = &alpha;&times;B and E=&beta;&times;D, and G=(&alpha;&times;A + &beta;&times;C).<\/p>\n<p> Subtraction and division should be obvious: define the arithmetic and multiplicative inverses; -(A\/B)\t = (-A)\/B, and (A\/B)<sup>-1<\/sup>=B\/A; and then use the definitions of addition and multiplication. You need to do a bit of work to take care of the undefinedness of the multiplicative inverse of 0, but that&#8217;s not hard.<\/p>\n<p> And there we go. We&#8217;ve got the rationals. Once we have the rationals, we can define the reals two different ways: via Dedekind cuts, and via Cauchy sequences. But that&#8217;s a topic for another day.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When last we left off, I&#8217;d used set theory to show how to construct the natural numbers; and then from the natural numbers, I showed how to construct the integers. Now, we can take the next step in building up the full tower of numbers, showing how if we&#8217;ve got the natural numbers defined in [&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":[56],"tags":[],"class_list":["post-553","post","type-post","status-publish","format-standard","hentry","category-set-theory"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-8V","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/553","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=553"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/553\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=553"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}