programming musings: Posts tagged 'math' urn:http-jao-io:-tags-math-html 2017-05-06T01:51:30Z gödel's incompleteness illustrated urn:http-jao-io:-blog-2017-05-06-go-CC-88del-s-incompleteness-illustrated 2017-05-06T01:51:30Z 2017-05-06T01:51:30Z jao <p>I am having a great time reading Smullyan&rsquo;s <a href="https://global.oup.com/academic/product/gdels-incompleteness-theorems-9780195046724?cc=es&amp;lang=en&amp;">Gödel&rsquo;s Incompleteness Theorems</a>, a thin volume with the most elegant description of Gödel&rsquo;s and Tarski&rsquo;s work i&rsquo;ve read so far. It&rsquo;s also the most succint, and it starts with a very nice and very clear <em>demonstration</em> of indecidability that is the simplest i have ever seen. I like it a lot, and it&rsquo;s short enough for a quick blog post. Here it goes.</p> <!-- more--> <p>Imagine you have a machine that knows how to print strings composed of finite combinations of the characters <code>P</code>, <code>N</code>, <code>(</code>, <code>)</code> and <code>~</code>. We&rsquo;ll call any string composed of any number of these characters an <em>expression</em>. Thus <code>P~</code>, <code>(P~)</code> or <code>~PN(P)</code> are expressions. But only some expressions are valid. Valid expressions are called <code>sentences</code> and our machine can only print sentences. Sentences must have one of the following forms:</p> <ul> <li><code>P(X)</code></li> <li><code>~P(X)</code></li> <li><code>PN(X)</code></li> <li><code>~PN(X)</code></li></ul> <p>where <code>X</code> is any expression. So, for instance, <code>P(N)</code>, <code>~PN(~P(NNP))</code> are sentences, but <code>N(P)</code> or <code>(P(NP))</code> are not.</p> <p>Everything our machine prints is a sentence, but we don&rsquo;t know whether our machine is capable of printing all possible sentences. We&rsquo;ll say that the sentence <code>X</code> is <em>printable</em> if our machine can print it.</p> <p>Our sentences can be assigned a meaning. Let&rsquo;s define the <em>norm</em> of an expression <code>X</code> as the expression <code>X(X)</code>, and with that give the following interpreations to our sentences:</p> <ul> <li><code>P(X)</code> means that the expression <code>X</code> is printable</li> <li><code>PN(X)</code> means that <code>X</code>&rsquo;s norm (i.e., <code>X(X)</code>) is printable</li> <li><code>~P(X)</code> means that the expression <code>X</code> is <strong>not</strong> printable</li> <li><code>~PN(X)</code> means that <code>X</code>&rsquo;s norm (i.e., <code>X(X)</code>) is <strong>not</strong> printable</li></ul> <p>With those meanings associated to sentences, we can actually say whether a sentence is <em>true</em> or <em>false</em>, and our little machine becomes self-referential: it prints sentences that say what the machine can or cannot print!</p> <p>Now, let&rsquo;s assume that our machine never lies: it only prints true sentences. The question is: will our machine be able to print all true sentences? Or is there a sentence that is true but our machine cannot print?</p> <p>Think about it for a bit.</p> <p>The trick is to find a sentence that is self-referential, and says out loud &ldquo;i cannot be printed&rdquo;. If a sentence that means &ldquo;this sentence cannot be printed&rdquo; were printable, that sentence would be false, but we are supposing that our machine never lies. Therefore, our machine cannot print the sentence &ldquo;this sentence cannot be printed&rdquo;, which is then a true sentence.</p> <p>In symbols, our sentence is <code>~PN(~PN)</code>. This sentence says that the norm of <code>~PN</code> is not printable, but remember that the norm of <code>X</code> is <code>X(X)</code>, so the norm of <code>~PN</code> is <code>~PN(~PN)</code>.</p> <p>So you see, as soon as you have a system that is capable of self-reference, you&rsquo;ll be able to prove that the system is incomplete, in the sense that, if it is accurate, it won&rsquo;t be able to express all truths about itself. Gödel was able to find a way of expression arithmetic propositions as numbers, and that opened the door to self-reference. And the fun began!</p> <p>This is just an appetizer: if you are not scared by a bit of math (and it&rsquo;s only a bit), by all means give Smullyan&rsquo;s book a try. It&rsquo;s much, much better than any of his famous puzzle collections.</p>