{"id":419,"date":"2007-05-14T21:56:28","date_gmt":"2007-05-14T21:56:28","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/05\/14\/fun-with-set-theory-cantors-diagonalization\/"},"modified":"2007-05-14T21:56:28","modified_gmt":"2007-05-14T21:56:28","slug":"fun-with-set-theory-cantors-diagonalization","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/05\/14\/fun-with-set-theory-cantors-diagonalization\/","title":{"rendered":"Fun With Set Theory: Cantor&#039;s Diagonalization"},"content":{"rendered":"<p> While I&#8217;ve been writing about the Surreal numbers lately, it reminded me of some of the fun of Set theory. As a result, I&#8217;ve been going back to look at some old books. Since I&#8217;ve been enjoying it, I thought you folks would as well.<\/p>\n<p> Set theory, along with its cousin, first order predicate logic, is pretty much the<br \/>\nfoundation of nearly all modern math. You <em>can<\/em> construct math from a lot of<br \/>\ndifferent foundations, but axiomatic set theory is currently pretty much <em>the<\/em> dominant approach. (Although Topoi seem to be making some headway&#8230;)<\/p>\n<p> There&#8217;s a reason for that. Set theory starts with some of the <em>simplest<\/em> ideas, and extends in a reasonably straightforward way to encompass the most astonishingly complicated one. It&#8217;s truly remarkable in that &#8211; none of the competitors to set theory<br \/>\nas a foundation can approach the intuitive simplicity of set theory.<\/p>\n<p> So I&#8217;m going to write a bit about set theory as I explore my old books. And I thought that a good place to start was Cantor&#8217;s diagonalization. Cantor is the inventor of set theory, and the diagonalization is an example of one of the first major results that Cantor published. It&#8217;s also a good excuse for talking a little bit about where set theory came from, which is not what most people expect. Set theory was originally created as a tool for talking about the relative sizes of different infinities.<\/p>\n<p><!--more--><\/p>\n<p> Almost anyone who went to school in the last 40 years has had <em>some<\/em> exposure to sets, so we tend to think of them in terms of foundations. It surprises most people that sets were <em>not<\/em> proposed as a foundation at all: in fact, set theory started as<br \/>\nan outgrowth of number theory! Back in the 19th century, Cantor was doing work on<br \/>\nnumber theory and algebra, and invented what grew into set theory as a tool for comparing<br \/>\nthe sizes of various sets of numbers. The original motivation behind the ideas that ended up growing into set theory was Cantors recognition of the fact that there&#8217;s a <em>difference<\/em> between the size of the set of rational numbers, and the size of the set of real numbers. They&#8217;re both infinite &#8211; but they&#8217;re <em>not<\/em> the same!<\/p>\n<p> Cantor&#8217;s original idea was to abstract away the details of numbers &#8211; order, structure, etc., and just look at them as collections of objects &#8211; that is, as sets. Then, if you can create a one-to-one correspondence between two sets of numbers, then those sets must be the same size. But when you look at the set of real numbers and the set of rational numbers, there&#8217;s no way to create a one-to-one mapping: in fact, you can easily prove that <em>any<\/em> one-to-one mapping between the rationals and the reals will necessarily<br \/>\nomit some of the real numbers. <\/p>\n<p> It&#8217;s worth taking the time to repeat that basic proof here. I&#8217;m going to use a slightly simplified version, which shows that you can&#8217;t map between the natural numbers and the reals between 0 and 1; since it&#8217;s easy to show that there&#8217;s a one-to-one mapping between the natural numbers and the rationals; and that there&#8217;s a one-to-one mapping between the set of all reals between 0 and 1 and the set of all reals, it means the same thing, but there are less tricks involved.<\/p>\n<p> It&#8217;s a basic proof by contradiction. Suppose that we <em>can<\/em> create a one-to-one correspondence between the natural numbers and the reals between 0 and 1. What that would mean is that there would be a total one-to-one onto function R from the natural numbers to the reals. So we could create a complete list of all of the real numbers: R(0), R(1), R(2), &#8230;<\/p>\n<p> If we could do that, then we could <em>also<\/em> create another function, D (for <em>digit<\/em>), where D(x,y)=the <em>y<\/em>th digit of the binary expansion of R(x). So D is effectively a table where every row is a real number, and every column is a digit position in the binary expansion of a real number. D(x,3) is the third digit of the binary expansion of x. So, for example, if x=3\/8, then the binary expansion of x is 0.011. So D(3\/8,1)=0, D(3\/8,2)=1, D(3\/8,3)=1, D(3\/8,4)=0, &#8230;<\/p>\n<p> Now, here comes the nifty part. Take the table for D, and start walking down the diagonal. So we&#8217;re going to go down the table looking at D(1,1), D(2,2), D(3,3), and so on. And as we walk down that diagonal, we&#8217;re going to write down digits. For D(0,0), the first digit, we&#8217;ll write 0 if D(0,0)=1, and 1 if D(0,0)=0. We&#8217;ll do the same thing for each digit. For the <em>i<\/em>th digit, if D(i,i)=0, we&#8217;ll write 1, and if D(i,i)=1, we&#8217;ll write 0.<\/p>\n<p> The result that we get is a series of binary digits &#8211; that is, a binary expansion of some number. Let&#8217;s call that number T. T is <em>different<\/em> from every row in D in at least one digit &#8211; for the <em>i<\/em>th row, T is different at digit <em>i<\/em>. So there&#8217;s no x where R(x)=T. But T is clearly a real number between 0 and 1. So the mapping can&#8217;t<br \/>\npossible work. And since we didn&#8217;t specify the structure of the mapping &#8211; we just assumed that there <em>was one<\/em>, that means that there&#8217;s no possible mapping that will work: this construction will always create a counterexample showing that the mapping is incomplete.<\/p>\n<p> So the set of all real numbers between 0 and 1 is <em>strictly larger<\/em> than the set of all natural numbers. And by extension, the set of all real numbers is <em>strictly larger<\/em> than the set of  all rational numbers.<\/p>\n<p> That argument is called Cantor&#8217;s diagonalization. And it&#8217;s pretty much the argument<br \/>\nthat put set theory on the map.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While I&#8217;ve been writing about the Surreal numbers lately, it reminded me of some of the fun of Set theory. As a result, I&#8217;ve been going back to look at some old books. Since I&#8217;ve been enjoying it, I thought you folks would as well. Set theory, along with its cousin, first order predicate logic, [&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-419","post","type-post","status-publish","format-standard","hentry","category-set-theory"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-6L","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/419","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=419"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/419\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}