{"id":1704,"date":"2012-02-19T17:25:25","date_gmt":"2012-02-19T22:25:25","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/?p=1704"},"modified":"2012-02-19T17:25:25","modified_gmt":"2012-02-19T22:25:25","slug":"models-and-why-they-matter","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2012\/02\/19\/models-and-why-they-matter\/","title":{"rendered":"Models and Why They Matter"},"content":{"rendered":"<p> As I said in the last post, Church came up with &lambda;-calculus, which looks like it&#8217;s a great formal model of computation. But &#8211; there was a problem. Church struggled to find a <em>model<\/em>. What&#8217;s a model, and why would that matter? That&#8217;s the point of this post. To get a quick sense of what a model is, and why it matters?<\/p>\n<p> A model is basically a mapping from the symbols of a logical system to some set off objects, such that all statements that you can prove in the logical system will be true about the corresponding objects. Note that when I say object here, I don&#8217;t necessarily mean real-world physical objects &#8211; they&#8217;re just <em>something<\/em> that we can work with, which is well-defined and consistent.<\/p>\n<p> Why does it matter? Because the whole point of a system like &lambda;-calculus is because we want to use it for reasoning. When you have a logical system like &lambda;-calculus, you&#8217;ve built this system with its rules for a reason &#8211; because you want to use it as a tool for understanding something. The model provides you with a way of saying that the conclusions you derive using the system are meaningful. If the model isn&#8217;t correct, if it contains any kind of inconsistency, then your system is completely meaningless: it can be used to derive <em>anything<\/em>.<\/p>\n<p> So the search for a model for &lambda;-calculus is really important. If there&#8217;s a valid model for it, then it&#8217;s wonderful. If there isn&#8217;t, then we&#8217;re just wasting our time looking for one.<\/p>\n<p> So, now, let&#8217;s take a quick look at a simple model, to see how a problem can creep in. I&#8217;m going to build a logic for talking about the natural numbers &#8211; that is, integers greater than or equal to zero. Then I&#8217;ll show you how invalid results can be inferred using it; and finally show you how it fails by using the model.<\/p>\n<p> One quick thing, to make the notation easier to read: I&#8217;m going to use a simple notion of types. A type is a set of atoms for which some particular one-parameter predicate is true. For example, if <img src='http:\/\/l.wordpress.com\/latex.php?latex=P%28x%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='P(x)' style='vertical-align:1%' class='tex' alt='P(x)' \/> is true, I&#8217;ll say that x is a member of type P. In a quantifier, I&#8217;ll say things like <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%20in%20P%3A%20mbox%7Bem%20foo%7D&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x in P: mbox{em foo}' style='vertical-align:1%' class='tex' alt='forall x in P: mbox{em foo}' \/>  to mean <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%20%3A%20P%28x%29%20Rightarrow%20mbox%7Bem%20foo%7D&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x : P(x) Rightarrow mbox{em foo}' style='vertical-align:1%' class='tex' alt='forall x : P(x) Rightarrow mbox{em foo}' \/>. Used this way, we can say that P is a type predicate.<\/p>\n<p> How do we define natural numbers using logic?<\/p>\n<p> First, we need an infinite set of atoms, each of which represents one number. We pick one of them, and call it zero. To represent the fact that they&#8217;re natural numbers, we define a predicate <img src='http:\/\/l.wordpress.com\/latex.php?latex=%7Bcal%20N%7D%28x%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='{cal N}(x)' style='vertical-align:1%' class='tex' alt='{cal N}(x)' \/>, which is true if and only if x is one of the atoms that represents a natural number.<\/p>\n<p> Now, we need to start using predicates to define the fundamental properties of numbers. The most important property of natural numbers is that they are a sequence. We define that idea using a predicate, <img src='http:\/\/l.wordpress.com\/latex.php?latex=mbox%7Bem%20succ%7D%28x%2Cy%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='mbox{em succ}(x,y)' style='vertical-align:1%' class='tex' alt='mbox{em succ}(x,y)' \/>, where <img src='http:\/\/l.wordpress.com\/latex.php?latex=mbox%7Bem%20succ%7D%28x%2Cy%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='mbox{em succ}(x,y)' style='vertical-align:1%' class='tex' alt='mbox{em succ}(x,y)' \/> is true if and only if x = y + 1. To use that to define the ordering of the naturals, we can say: <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%20in%20%7Bcal%20N%7D%3A%20exists%20y%3A%20mbox%7Bem%20succ%7D%28x%2C%20y%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x in {cal N}: exists y: mbox{em succ}(x, y)' style='vertical-align:1%' class='tex' alt='forall x in {cal N}: exists y: mbox{em succ}(x, y)' \/>. <\/p>\n<p> Or in english: every natural number has a successor &#8211; you can always add one to a natural number and get another natural number.<\/p>\n<p> We can also define predecessor similarly, with two statements:<\/p>\n<ol>\n<li> <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%20in%20%7Bcal%20N%7D%3A%20exists%20y%20in%20%7Bcal%20N%7D%3A%20mbox%7Bem%20pred%7D%28x%2C%20y%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x in {cal N}: exists y in {cal N}: mbox{em pred}(x, y)' style='vertical-align:1%' class='tex' alt='forall x in {cal N}: exists y in {cal N}: mbox{em pred}(x, y)' \/>.<\/li>\n<li> <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%2Cy%20in%20%7Bcal%20N%7D%3A%20mbox%7Bem%20pred%7D%28y%2Cx%29%20Leftrightarrow%20mbox%7Bem%20succ%7D%28x%2Cy%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x,y in {cal N}: mbox{em pred}(y,x) Leftrightarrow mbox{em succ}(x,y)' style='vertical-align:1%' class='tex' alt='forall x,y in {cal N}: mbox{em pred}(y,x) Leftrightarrow mbox{em succ}(x,y)' \/><\/li>\n<\/ol>\n<p> So every number has a predecessor, and every number has a successor, and x is the predecessor of y if y is the successor of x.<\/p>\n<p> To be able to define things like addition and subtraction, we can use successor. Let&#8217;s define addition using a predicate Sum(x,y,z) which means &#8220;z = x + y&#8221;.<\/p>\n<ol>\n<li> <img src='http:\/\/l.wordpress.com\/latex.php?latex=forrall%20x%2Cy%20in%20%7Bcal%20N%7D%3A%20exists%20z%20in%20%7Bcal%20N%7D%20%3A%20Sum%28x%2Cy%2Cz%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forrall x,y in {cal N}: exists z in {cal N} : Sum(x,y,z)' style='vertical-align:1%' class='tex' alt='forrall x,y in {cal N}: exists z in {cal N} : Sum(x,y,z)' \/><\/li>\n<li> <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%2Cy%20in%20%7Bcal%20N%7D%3A%20Sum%28x%2C%200%2C%20x%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x,y in {cal N}: Sum(x, 0, x)' style='vertical-align:1%' class='tex' alt='forall x,y in {cal N}: Sum(x, 0, x)' \/><\/li>\n<li> <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%2Cy%2Cz%20in%20%7Bcal%20N%7D%3A%20exists%20a%2Cb%20in%20%7Bcal%20N%7D%3A%20Sum%28a%2Cb%2Cz%29%20land%20mbox%7Bem%20succ%7D%28a%2Cx%29%20land%20mbox%7Bem%20succ%7D%28y%2Cb%29%20Rightarrow%20Sum%28x%2C%20y%2C%20z%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x,y,z in {cal N}: exists a,b in {cal N}: Sum(a,b,z) land mbox{em succ}(a,x) land mbox{em succ}(y,b) Rightarrow Sum(x, y, z)' style='vertical-align:1%' class='tex' alt='forall x,y,z in {cal N}: exists a,b in {cal N}: Sum(a,b,z) land mbox{em succ}(a,x) land mbox{em succ}(y,b) Rightarrow Sum(x, y, z)' \/><\/li>\n<\/ol>\n<p> Again, in english: for any two natural numbers, there is a natural number that it their sum; x + 0 always = x; and for any natural number, x + y = z is true if (x + 1) + (y &#8211; 1) = z.<\/p>\n<p> Once we have addition, subtraction is easy: <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%2Cy%2Cz%20in%20%7Bcal%20N%7D%20%3A%20diff%28x%2Cy%2Cz%29%20Leftrightarrow%20sum%28z%2Cy%2Cx%29&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x,y,z in {cal N} : diff(x,y,z) Leftrightarrow sum(z,y,x)' style='vertical-align:1%' class='tex' alt='forall x,y,z in {cal N} : diff(x,y,z) Leftrightarrow sum(z,y,x)' \/><\/p>\n<p> That&#8217;s: x-y=z if and only if x=y+z.<\/p>\n<p> We can also define greater than using addition:<\/p>\n<p> <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%2Cy%20in%20%7Bcal%20N%7D%20%3A%20x%20%3E%20y%20Leftrightarrow&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x,y in {cal N} : x > y Leftrightarrow&#8217; style=&#8217;vertical-align:1%&#8217; class=&#8217;tex&#8217; alt=&#8217;forall x,y in {cal N} : x > y Leftrightarrow&#8217; \/><\/p>\n<ul>\n<li> <img src='http:\/\/l.wordpress.com\/latex.php?latex=mbox%7Bem%20succ%7D%28x%2Cy%29%29%20lor&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='mbox{em succ}(x,y)) lor' style='vertical-align:1%' class='tex' alt='mbox{em succ}(x,y)) lor' \/><\/li>\n<li> <img src='http:\/\/l.wordpress.com\/latex.php?latex=exists%20z%20in%20%7Bcal%20N%7D%3A%20mbox%7Bem%20succ%7D%28x%2C%20z%29%29%20land%20exists%20z%20in%20%7Bcal%20N%7D%3A%20mbox%7Bem%20succ%7D%28x%2Cz%29%20and%20z%20%3E%20y&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='exists z in {cal N}: mbox{em succ}(x, z)) land exists z in {cal N}: mbox{em succ}(x,z) and z > y&#8217; style=&#8217;vertical-align:1%&#8217; class=&#8217;tex&#8217; alt=&#8217;exists z in {cal N}: mbox{em succ}(x, z)) land exists z in {cal N}: mbox{em succ}(x,z) and z > y&#8217; \/>.<\/li>\n<\/ul>\n<p> That&#8217;s x > y if you can get to x from y by adding one repeatedly.<\/p>\n<p> So, we&#8217;ve got a nice definition of natural numbers here, right?<\/p>\n<p> Almost. There&#8217;s one teeny little mistake.<\/p>\n<p> We said that every natural number has a successor <em>and a predecessor<\/em>, and we also said that a number x is greater than a number y if you can get from y to x using a sequence of successors. That means that 0 has a predecessor, and that the predecessor of 0 is less than 0. But we&#8217;re supposed to be defining the natural numbers! And one of the standard axioms of the natural numbers is that <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%20in%20%7Bcal%20N%7D%3A%200%20le%20x&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x in {cal N}: 0 le x' style='vertical-align:1%' class='tex' alt='forall x in {cal N}: 0 le x' \/>. But we&#8217;ve violated that &#8211; we have both <img src='http:\/\/l.wordpress.com\/latex.php?latex=forall%20x%20in%20%7Bcal%20N%7D%3A%200%20le%20x&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='forall x in {cal N}: 0 le x' style='vertical-align:1%' class='tex' alt='forall x in {cal N}: 0 le x' \/>, and<br \/>\n<img src='http:\/\/l.wordpress.com\/latex.php?latex=exists%20x%20in%20%7Bcal%20N%7D%3A%200%20%3E%20x&#038;bg=FFFFFF&#038;fg=000000&#038;s=0' title='exists x in {cal N}: 0 > x&#8217; style=&#8217;vertical-align:1%&#8217; class=&#8217;tex&#8217; alt=&#8217;exists x in {cal N}: 0 > x&#8217; \/>. And with a contradiction like that in the system, we can prove <em>anything<\/em> we want, anything at all. We&#8217;ve got a totally worthless, meaningless system.<\/p>\n<p> That&#8217;s why mathematicians are so particular about proving the validity of their models: because the tiniest error can mean that anything you proved with the logic might not be true &#8211; your proofs are worthless.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I said in the last post, Church came up with &lambda;-calculus, which looks like it&#8217;s a great formal model of computation. But &#8211; there was a problem. Church struggled to find a model. What&#8217;s a model, and why would that matter? That&#8217;s the point of this post. To get a quick sense of what [&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":[32,33,43],"tags":[193,199,202],"class_list":["post-1704","post","type-post","status-publish","format-standard","hentry","category-lambda-calculus","category-logic","category-numbers","tag-logic-2","tag-models","tag-natural-numbers"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-ru","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/1704","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=1704"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/1704\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=1704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=1704"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=1704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}