{"id":3191,"date":"2015-06-26T15:00:07","date_gmt":"2015-06-26T19:00:07","guid":{"rendered":"http:\/\/www.goodmath.org\/blog\/?p=3191"},"modified":"2015-06-26T15:00:07","modified_gmt":"2015-06-26T19:00:07","slug":"truth-in-type-theory","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2015\/06\/26\/truth-in-type-theory\/","title":{"rendered":"Truth in Type Theory"},"content":{"rendered":"<p> Now, we&#8217;re getting to the heart of type theory: judgements. Judgements are the basic logical statements that we want to be able to prove about computations in type theory. There&#8217;s a basic set of judgements that we want to be able to make.<\/p>\n<p> I keep harping on this, but it&#8217;s the heart of type theory: type theory is all about understanding logical statements as specifications of computations. Or, more precisely, in computer science terms, they&#8217;re about understanding true logical statements as <em>halting<\/em> computations.<\/p>\n<p> In this post, we&#8217;ll see the ultimate definition of truth in type theory: every logical proposition is a set, and the proposition is true if the set has any members. A non-halting computation is a false statement &#8211; because you can never get it to resolve an expression to a canonical value.<\/p>\n<p> So remember as we go through this: judgements are based on the idea of logical statements as specifications of computations. So when we talk about a predicate <em>P<\/em>, we&#8217;re using its interpretation as a specification of a computation. When we look at an expression <em>3+5<\/em>, we understand it not as a piece of notation that describes the number 8, but as a description of a computation that adds 3 to 5. &#8220;3+5&#8221; not the same computation as &#8220;2*4&#8221; or &#8220;2+2+2+2&#8221;, but as we&#8217;ll see, they&#8217;re equal because they evaluate to the same thing &#8211; that is, they each perform a computation that results in the same canonical value &#8211; the number 8.<\/p>\n<p> In this post, we&#8217;re going to focus on a collection of canonical atomic judgement types:<\/p>\n<dl>\n<dt><img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20%5Ctext%7Bset%7D&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A \\text{set}' style='vertical-align:1%' class='tex' alt='A \\text{set}' \/><\/dt>\n<dd> This judgement says that <em>A<\/em> is a set.<\/dd>\n<dt><img src='http:\/\/l.wordpress.com\/latex.php?latex=A%20%3D%20B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A = B' style='vertical-align:1%' class='tex' alt='A = B' \/><\/dt>\n<dt><em>A<\/em> and <em>B<\/em>are equal sets.<\/dd>\n<dt><img src='http:\/\/l.wordpress.com\/latex.php?latex=a%20%5Cin%20A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a \\in A' style='vertical-align:1%' class='tex' alt='a \\in A' \/><\/dt>\n<dd><em>a<\/em> is an element of the set <em>A<\/em><\/dd>\n<dt><img src='http:\/\/l.wordpress.com\/latex.php?latex=a_1%20%3D%3D%20a_2%20%5Cin%20A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a_1 == a_2 \\in A' style='vertical-align:1%' class='tex' alt='a_1 == a_2 \\in A' \/><\/dt>\n<dd><img src='http:\/\/l.wordpress.com\/latex.php?latex=a_1&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a_1' style='vertical-align:1%' class='tex' alt='a_1' \/> and <img src='http:\/\/l.wordpress.com\/latex.php?latex=a_2&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a_2' style='vertical-align:1%' class='tex' alt='a_2' \/> are equal members of the set <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/>.<\/dd>\n<dt><img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is a proposition.<\/dt>\n<dd>&#8230;<\/dd>\n<dt>The proposition <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is true.<\/dt>\n<dd>&#8230;<\/dd>\n<\/dl>\n<p> The definition of the meanings of judgements is, necessarily, mutually recursive, so we&#8217;ll have to go through all of them before any of them is complete.<\/p>\n<dl>\n<dt>An object <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is a Set<\/dt>\n<dd>\n When I say that <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is a set in type theory, that means that:<\/p>\n<ul>\n<li> I know the rules for how to form the canonical expressions for the set;<\/li>\n<li> I&#8217;ve got an equivalence relation that says when two canonical members of the set are equal.<\/li>\n<\/ul>\n<\/dd>\n<dt>Two Sets are Equal<\/dt>\n<dd>\n<p> When I say that <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> and <img src='http:\/\/l.wordpress.com\/latex.php?latex=B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='B' style='vertical-align:1%' class='tex' alt='B' \/> are equal sets, that means:<\/p>\n<ul>\n<li> <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> and <img src='http:\/\/l.wordpress.com\/latex.php?latex=B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='B' style='vertical-align:1%' class='tex' alt='B' \/> are both sets.<\/li>\n<li> If <img src='http:\/\/l.wordpress.com\/latex.php?latex=a&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a' style='vertical-align:1%' class='tex' alt='a' \/> is a canonical member of <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/>, then <img src='http:\/\/l.wordpress.com\/latex.php?latex=a&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a' style='vertical-align:1%' class='tex' alt='a' \/> is also a canonical member of <img src='http:\/\/l.wordpress.com\/latex.php?latex=B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='B' style='vertical-align:1%' class='tex' alt='B' \/>, and vice versa.<\/li>\n<li> If <img src='http:\/\/l.wordpress.com\/latex.php?latex=a&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a' style='vertical-align:1%' class='tex' alt='a' \/> and <img src='http:\/\/l.wordpress.com\/latex.php?latex=b&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='b' style='vertical-align:1%' class='tex' alt='b' \/> are canonical members of <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/>, and they&#8217;re also equal in <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/>, then <img src='http:\/\/l.wordpress.com\/latex.php?latex=a&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a' style='vertical-align:1%' class='tex' alt='a' \/> and <img src='http:\/\/l.wordpress.com\/latex.php?latex=b&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='b' style='vertical-align:1%' class='tex' alt='b' \/> are also equal canonical members of <img src='http:\/\/l.wordpress.com\/latex.php?latex=B&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='B' style='vertical-align:1%' class='tex' alt='B' \/> (and vice versa).<\/li>\n<\/ul>\n<p> The only tricky thing about the definition of this judgement is the fact that it defines equality is a property <em>of a set<\/em>, not of the elements of the set. By this definition, tt&#8217;s possible for two expressions to be members of two different sets, and to be equal in one, but not equal in the other. (We&#8217;ll see in a bit that this possibility gets eliminated, but this stage of the definition leaves it open!)\n<\/dd>\n<dt>An object is a member of a set<\/dt>\n<dd>\n   When I say <img src='http:\/\/l.wordpress.com\/latex.php?latex=a%20%5Cin%20A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a \\in A' style='vertical-align:1%' class='tex' alt='a \\in A' \/>, that means that if I evaluate <img src='http:\/\/l.wordpress.com\/latex.php?latex=a&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a' style='vertical-align:1%' class='tex' alt='a' \/>, the result will be a canonical member of <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/>.\n  <\/dd>\n<dt>Two members of a set are equal<\/dt>\n<dd> If <img src='http:\/\/l.wordpress.com\/latex.php?latex=a%20%5Cin%20A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a \\in A' style='vertical-align:1%' class='tex' alt='a \\in A' \/> and <img src='http:\/\/l.wordpress.com\/latex.php?latex=b%20%5Cin%20A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='b \\in A' style='vertical-align:1%' class='tex' alt='b \\in A' \/> and <img src='http:\/\/l.wordpress.com\/latex.php?latex=a%20%3D%20b&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a = b' style='vertical-align:1%' class='tex' alt='a = b' \/>, that means when if you evaluate <img src='http:\/\/l.wordpress.com\/latex.php?latex=a&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a' style='vertical-align:1%' class='tex' alt='a' \/>, you&#8217;ll get  a canonical expression <img src='http:\/\/l.wordpress.com\/latex.php?latex=a%27&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a'' style='vertical-align:1%' class='tex' alt='a'' \/>; and when you evaluate <img src='http:\/\/l.wordpress.com\/latex.php?latex=b&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='b' style='vertical-align:1%' class='tex' alt='b' \/>, you&#8217;ll get a canonical expression <img src='http:\/\/l.wordpress.com\/latex.php?latex=b%27&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='b'' style='vertical-align:1%' class='tex' alt='b'' \/>. For <img src='http:\/\/l.wordpress.com\/latex.php?latex=a%20%3D%3D%20b&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a == b' style='vertical-align:1%' class='tex' alt='a == b' \/> to be true, then <img src='http:\/\/l.wordpress.com\/latex.php?latex=a%27%20%3D%20b%27&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a' = b'' style='vertical-align:1%' class='tex' alt='a' = b'' \/>, that is, the canonical expressions resulting from their evaluation must also be equal.<\/p>\n<p>   This nails down the problem back in set equivalence: since membership equivalence is defined in terms of evaluation as canonical values, and every expression evaluates to exactly one canonical expression (that&#8217;s the definition of canonical!), then if two objects are equal in a set, they&#8217;re equal in all sets that they&#8217;re members of.\n  <\/dd>\n<dt> An object <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is a proposition<\/dt>\n<dd>\n Here&#8217;s where type theory really starts to depart from the kind of math that we&#8217;re used to. In type theory, a proposition is a set. That&#8217;s it: to be a proposition, <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> has to be a set.\n<\/dd>\n<dt> The proposition <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is true<\/dt>\n<dd>\n   And the real meat of everything so far: if we have a proposition <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/>, and <img src='http:\/\/l.wordpress.com\/latex.php?latex=A&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='A' style='vertical-align:1%' class='tex' alt='A' \/> is true, what that means is that <img src='http:\/\/l.wordpress.com\/latex.php?latex=a&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='a' style='vertical-align:1%' class='tex' alt='a' \/> has at least one element. If a proposition is a non-empty set, then it&#8217;s true. If it&#8217;s empty, it&#8217;s false.\n<\/dd>\n<\/dl>\n<p> Truth in type theory really comes down to membership in a set. This is, subtly, different from the predicate logic that we&#8217;re familiar with. In predicate logic, a quantified proposition can, ultimately, be reduced to a set of values, but it&#8217;s entirely reasonable for that set to be empty. I can, for example, write a logical statement that &#8220;All dogs with IQs greater that 180 will turn themselves into cats.&#8221; A set-based intepretation of that is the collection of objects for which it&#8217;s true. There aren&#8217;t any, because there aren&#8217;t any dogs with IQs greater than 180. It&#8217;s empty. But logically, in terms of predicate logic, I can still say that it&#8217;s &#8220;true&#8221;. In type theory, I can&#8217;t: to be true, the set has to have at least one value, and it doesn&#8217;t.<\/p>\n<p> In the next post, we&#8217;ll take these atomic judgements, and start to expand them into the idea of <em>hypothetical<\/em> judgements. In the type-theory sense, that means statements require some other set of prior judgements before they can be judged. In perhaps more familiar terms, we&#8217;ll be looking at type theory&#8217;s equivalent of the contexts in classical sequent calculus &#8211; those funny little <img src='http:\/\/l.wordpress.com\/latex.php?latex=%5CGamma&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='\\Gamma' style='vertical-align:1%' class='tex' alt='\\Gamma' \/>s that show up in all of the sequent rules.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now, we&#8217;re getting to the heart of type theory: judgements. Judgements are the basic logical statements that we want to be able to prove about computations in type theory. There&#8217;s a basic set of judgements that we want to be able to make. I keep harping on this, but it&#8217;s the heart of type theory: [&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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[292],"tags":[],"class_list":["post-3191","post","type-post","status-publish","format-standard","hentry","category-type-theory"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-Pt","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/3191","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=3191"}],"version-history":[{"count":1,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/3191\/revisions"}],"predecessor-version":[{"id":3192,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/3191\/revisions\/3192"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=3191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=3191"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=3191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}