programming musings: Posts tagged 'math'programming musings: Posts tagged 'math'
http://jao.io/tags/math.html
Sat, 06 May 2017 00:51:30 UTSat, 06 May 2017 00:51:30 UT1800gödel's incompleteness illustrated
http://jao.io/blog/2017/05/06/gödel-s-incompleteness-illustrated/?utm_source=math&utm_medium=RSS
urn:http-jao-io:-blog-2017-05-06-gödel-s-incompleteness-illustratedSat, 06 May 2017 00:51:30 UTjao
<p>I am having a great time reading Smullyan’s <a href="https://global.oup.com/academic/product/gdels-incompleteness-theorems-9780195046724?cc=es&lang=en&">Gödel’s Incompleteness Theorems</a>, a thin volume with the most elegant description of Gödel’s and Tarski’s work i’ve read so far. It’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’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’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’t know whether our machine is capable of printing all possible sentences. We’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’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>’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>’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’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 “i cannot be printed”. If a sentence that means “this sentence cannot be printed” were printable, that sentence would be false, but we are supposing that our machine never lies. Therefore, our machine cannot print the sentence “this sentence cannot be printed”, 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’ll be able to prove that the system is incomplete, in the sense that, if it is accurate, it won’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’s only a bit), by all means give Smullyan’s book a try. It’s much, much better than any of his famous puzzle collections.</p>